OS_Chapter_2.5, 2.7

ssonjh·2021년 4월 7일
0

OS

목록 보기
10/17

👀 2.5 Linkers and Loaders

  • Source code compiled into object files designed to be
    loaded into any physical memory location – relocatable
    object file
  • Linker combines these into single binary executable file
    • Also brings in libraries
  • Program resides on secondary storage as binary executable
  • Must be brought into memory by loader to be executed
    • Relocation(linking and loading) assigns final addresses to program
    parts and adjusts code and data in program to match those
    addresses
  • Object, executable files have standard formats, so operating
    system knows how to load and start them

Summary

  1. source code가 compiled되면, object file을 생성한다.
    -> physical memory 위치에 load된다.
  2. Linker는 object file들을 합쳐 하나의 binary 실행 파일을 만든다.
    또한, library를 실행 파일에 연결한다.
  3. program은 실행 가능한 binary 형태로 secondary storage에 저장된다.
  4. 이 program은 loader가 memory에 가져와야 실행할 수 있다.
  5. Relocation(linking and loading)은 program의 한 part에 최종 주소를 할당하고, 해당 주소에 맞게 code와 data를 조정한다.
  • object file과 실행 파일은 표준 포맷이 있어 OS가 load, start를 할 수 있다.


👀 2.7 Operating System Design and Implementation

📕 Design

  • Design and Implementation of OS not “solvable”, but some
    approaches have proven successful
  • Internal structure of different Operating Systems can vary widely
  • Start the design by defining goals and specifications

User goals and System goals

  • User goals : convenient to use, easy to learn, reliable, safe, and fast
  • System goals :
    easy to design, implement, and maintain
    flexible, reliable, error-free, and efficient

Summary

  • OS 설계 및 구현은 "해결 가능"이 아니지만, 일부 접근 방식은 성공적이었음이 입증되었다.
  • OS에 따라 내부 구조가 크게 달라질 수 있다.
  • 목표사양을 중심으로 설계를 시작한다.
    -> Hardware나 시스템 유형의 영향을 받는다.

User의 목표

  • 편한 사용, 배우기 쉬움, 신뢰성, 안전성, 빠르기

System의 목표

  • 쉬운 설계, 구현, 유지
  • 유연함, 신뢰성, 오류X, 효율성

  • Important principle to separate
    Policy: What will be done?
    Mechanism: How to do it?
    -> Mechanisms determine how to do something, policies decide
    what will be done

  • The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later


  • Specifying and designing an OS is highly creative task of
    software engineering
  • Implementation: written in various languages nowadays

Summary

  • 분리원칙 (Segregation Principle)
    정책 : 무엇을 할 것인가?
    매커니즘 : 어떻게 할 것인가?

  • 정책을 메커니즘에서 분리하는 것은 매우 중요한 원칙이며, 정책 결정이 나중에 변경되도록 할 경우 최대한의 유연성을 허용한다.


  • OS를 지정, 설계하는 것은 software engineering의 매우 창의적인 작업이다.
  • 현재는 여러 언어로 구현되어 쓰이고 있다.

📙 Implementation

  • Much variation
    • Early OSes in assembly language
    • Then system programming languages like Algol, PL/1
    • Now C, C++
  • Actually usually a mix of languages
    • Lowest levels in assembly
    • Main body in C
    • Systems programs in C, C++, scripting languages like PERL,
    Python, shell scripts
  • More high-level language easier to port to other hardware
    • But slower
  • Emulation can allow an OS to run on non-native hardware

Summary

  • 초기 OS는 Algol, PL/1과 같은 assembly language로 만들어졌다.
  • 현재는 여러 language가 mix되어 쓰인다.
    -> Lowest levels에는 assembly가 쓰이고, Main은 C이다.
    -> Systems programs에는 C나 C++이 쓰이고,
    -> PERL, Python, shell scripts와 같은 scripting languages가 쓰인다.
  • high-level languages는 다른 hardware에 비해 적용시키기 더 쉽다.
    -> 하지만 더 느리다.
  • Emulation을 통해 OS를 해당 hardware가 아닌 곳에서 돌릴 수 있다.

Emulation : 하나의 시스템이 다른 시스템을 흉내 내도록 하는 것

0개의 댓글