L1 Introduction + Kernel Abstraction
Two conflicting Roles of OS
User-Friendliness (Service Provider) VS Efficiency (Resource Manager)
Service Provider
provide standard services to execute program, I/O, file system, …
Abstraction is the key
ex. File system: files persist at crash, handle super large files
Resource Manager
cost, time, energy
coordination: multi apps work together
memory protection, concurrency
ex. File system: reused deleted space, prevent accessing other files
Dual Mode CPU
CPU Control Flow
프로그램을 실행하는 것은 결국 CPU이다.
JAL, BXX, JALR 등으로 control이 옮겨 다닌다.
Exception
Async Exception (Interrupt): timer, keyboard, network, disk
Sync Exception (Trap): div0, syscall
내외부적 요인으로 인해 Exception Handler로 control이 넘어가게 된다.
Exceptional Control FLow
exception 발생시, 해당 번호의 exception handler의 PC를 가져온다.
User Program에서 Handler로 Exceptional Control Flow를 주고
처리 후
Return: 하던걸 마저 한다
no return: segfault같은경우 user program을 그냥 터트린다.