
프로그램이 만들어지는 과정.
컴퓨터(CPU)가 이해할 수 있는 기계어로 구성된 파일
자체로는 수행이 이루어지지 못함
프로세스로 변환되기 위한 정보가 삽입되어야 함
Relocatable Addresses(Relative Address)로 표현
심볼들의 주소가 상대적인 값으로 표현됨
(시작주소로부터 26바이트 지점)


GCC는 Start-up Code Object 파일을 추가하여 프로그램을 컴파일 하며, 이 때 기본 라이브러리들도 동적으로 링크 된다.
Process를 시작하기 위해 커널은 PC(프로그램 카운터)를 _start함수의 주소로 지정한다.
_start함수는 동적으로 링크된 C 라이브러리 및 쓰레드 환경을 초기화하기 위해 _libc_start_main함수를 호출한다.
라이브러리 초기화를 진행한 이후, 프로그램의 main함수가 호출된다.


서로 다른 프로세스들간에는 침범하지 못한다. (Protection Domain)

New : The Process is being created
Running : Instructions are being executed
Waiting : The process is waiting for some event to occur
Ready : The process is waiting to be assigned to a processor
Terminated : The process has finished execution
커널 내에 Ready Queue, Waiting Queue, Running Queue를 두고 프로세스들을 상태에 따라 관리한다.

When CPU switches to a new process, kernel must save the state of the old(current) process(기존 프로세스 상태 저장) and load the saved state for the new process(새로운 프로세스 로드).
Context switching time is overhead
System can't do useful work while switching
Context switching time depends on H/W support
간단한 명령어 셋 구성 -> 클럭 속도 높임 -> 빠른 수행 속도
절약된 물리적 공간에 보다 많은 레지스터 장착
Context Switch 시 레지스터 내용 변경에 보다 큰 오버헤드가 발생함.
e.g., ARM Processor
Register Window (Berkeley RISC Design)

memory에 접근하는 수를 최대한 줄이고자 Register를 이용
참고

프로세스들은 Concurrently하게 실행될 수 있으며, 동적으로 생성/종료 된다.
OS provides process creation and process termination mechanisms
Process Creation (i.e., fork())

Child process is a duplicate of the parent process.
Child process has a program loaded into it

A process terminates when it finished executing its final statement and asks the OS to delete it by using exit system call.
The abort function causes abnormal process termination to occur.
Information sharing
Computation speed-up
Modularity
Convenience
