๐ค Computer Science/Operating System
OS midterm ์ฃผ์ ๊ฐ๋ ์์ฝ
yesolz
2024. 5. 1. 17:09
728x90
- von Nuemann architecture
- assert ํจ์: ์๋ฌ ๊ฒ์ถ. ํน์ ์กฐ๊ฑด ๊ฑฐ์ง์ด๋ฉด ํ๋ก๊ทธ๋จ ์ค๋จ
- bus: Device controller์ memory๋ฅผ ์ฐ๊ฒฐํ๋ ๊ฒฝ๋ก
- local buffer: ๊ฐ Device controller๊ฐ ๊ฐ์ง๊ณ ์๋ ๋ฒํผ
- IDT: ์ธํฐ๋ฝํธ๋ฅผ ๋ฐ์ผ๋ฉด ์ด ํ ์ด๋ธ์ ์ฐธ์กฐํจ
- Device driver: Device controller์ OS ๊ฐ์ ํต์ ์ ๋ด๋นํจ
- kilo / mega / giga / tera: ์ฉ๋ ๋จ์
- address space ๊ตฌ์ฑ: code, data, stack, heap
- process 5๊ฐ์ง ์ํ: new, ready, running, blocked, exit
- fork ๋ฆฌํด ๋ฐธ๋ฅ:
- ๋ถ๋ชจ: ์์ PID
- ์์: 0
- ์คํจ: -1
- zombie process: wait ํธ์ถํ์ง ์๊ณ ์ฃฝ์ ํ๋ก์ธ์ค (๋ถ๋ชจ๊ฐ ์ฃฝ์ผ๋ฉด ๊ณ์ ๊ธฐ๋ค๋ฆผ)
- orphan process: ๋ถ๋ชจ๋ ์ฃฝ์์ง๋ง ์์์ ์ด์ ์๋ ํ๋ก์ธ์ค
- ํด๊ฒฐ์ฑ 2๊ฐ์ง: cascading termination(๋ถ๋ชจ๊ฐ ์ฃฝ์ผ๋ฉด ์์๋ ๊ฐ์ด ์ฃฝ์) / reparenting(init process๋ก ๋ถ๋ชจ ๋ณ๊ฒฝ)
- ์ปค๋๋ชจ๋ / ์ ์ ๋ชจ๋
- privileged instruction: ์ค์ ์ฝ๋, ์ปค๋๋ชจ๋์์๋ง ์คํ๋จ
- hardware timer: OS๊ฐ ๊ฐ์์ timer interrupt๋ฅผ ๋ฐ์์ํด (interrupt handler table)
- ์ปค๋ ๋ชจ๋ ์คํ: ์ธํฐ๋ฝํธ(ํ๋์จ์ด,asynchronously) / ์์คํ ์ฝ(์ํํธ์จ์ด,synchronously)
- IPC mechanism: signal, signal handler
- pipe: ๋ ํ๋ก์ธ์ค ๊ฐ ํต์
- ordinary pipe: unidirectional(๋จ๋ฐฉํฅ), ์ฃผ๋ก ๋ถ๋ชจ-์์ ๊ฐ ํต์
- named pipe: bidirectional(์๋ฐฉํฅ), half-duplex
- file descriptor
- ํ์ค์
์ถ๋ ฅ ํ์ผ๋์คํฌ๋ฆฝํฐ:
- 0 stdin
- 1 stdout
- 2 stderr
- ํ์ดํ ํ์ผ๋์คํฌ๋ฆฝํฐ:
- pipefd[0] read
- pipefd[1] write
- parallelism: multi ํ๋ก์ธ์, ๋ณ๋ ฌ ์ฒ๋ฆฌ
- process์์ OS code๋ก ๋์ด๊ฐ๋ ๊ฒฝ์ฐ & ํ๋ก์ธ์ค ๊ฐ switching: system call, interrupt
- concurrency vs parallelism (parallelism ์๊ธฐ๋ฉด concurrent ํ๊ฒ ๋๋ค (O)
- OS ์ค์ผ์ค๋ง ํ: Ready Queue, Waiting Queue, (+Priority Queue, Completion Queue)
- PCB: ํ๋ก์ธ์ค ์ปจํ ์คํธ์ ์ ๋ณด, Process Control Block
- FCFS, SJF, STCF(Shortest Time to Completion First), RR: ์ค์ผ์ค๋ง ์๊ณ ๋ฆฌ์ฆ
- starvation / preemptive
- average waiting time(๋๊ธฐ ์๊ฐ), turnaround time(๋๊ธฐ ์๊ฐ๊ณผ ์คํ ์๊ฐ), response time(์๋ต ์๊ฐ์ ํ๋ก์ธ์ค์ ์คํ์ด ์์๋๊ธฐ ์ ์ ์ธก์ )
- priority scheduling
- priority inversion ํด๊ฒฐ:
- PIP(Priority Inheritance Protocol): ๋์ ์ฐ์ ์์ ํ๋ก์ธ์ค๊ฐ ์ ์ ์ฐ์ ์์ ๋๊ฒจ์ค. ๊ณต์ ์์์ ์ ์ ํ๋ ํ๋ก์ธ์ค์ ์ฐ์ ์์๋ฅผ ์์ฒญํ๋ ํ๋ก์ธ์ค์ ์ฐ์ ์์๋ก ์ผ์์ ์ผ๋ก ์์
- PCP(Priority Ceiling Protocol): ๋ฎ์ ์ฐ์ ์์ ํ๋ก์ธ์ค๊ฐ ์์์ ์์ฒญํ ๋ ์ฐ์ ์์๋ฅผ ๋์
- CPU bound process / I/O bound process
- MLQ / MLFQ: ๋ค์ค ํ ์ค์ผ์ค๋ง
- MLQ - ํ๋ก์ธ์ค ํน์ง ๋ณ๋ก ํ ์ ์, ์ฐ์ ์์, time quantum
- MLFQ (Multi-Level Feedback Queue) - + ๋์ ์ผ๋ก ์ฐ์ ์์ ์ ์ฅ
- proportional share ์ค์ผ์ค๋ง: ๋กํฐ๋ฆฌ ์ค์ผ์ค๋ง
- CFS(Completely Fair Scheduling): ๋ฆฌ๋ ์ค ์ค์ผ์ค๋ง, ์ฐ์ ์์๊ฐ wait time๊ณผ CPU-time์ ๋ฐ๋ผ ๋ณํํจ, aging, targeted latency(์ต์ 1๋ฒ์ ์ค์ผ์ค๋ง ๋์ด์ผ ํ๋ ๊ธฐ๊ฐ)
- Multiple-Processor scheduling:
- AMP(Asymmetric Multiprocessing): ๋ก๋ ๋ฐธ๋ฐ์ฑ์ ์ํ ๋จ์ผ ํ๋ก์ธ์, ๋น๋ฒํ ์ค์ผ์ค๋ง ๋ฌธ์ ๋ฐ์
- SMP(Symmetric Multiprocessing): ๊ฐ ํ๋ก์ธ์๊ฐ ๋ ๋ฆฝ์ ์ผ๋ก ์ค์ผ์ค๋ง, multicore processor -> push migration / pull migration
- UMA(Uniform Memory Access) vs NUMA(Non-Uniform Memory Access): ๋ฉ๋ชจ๋ฆฌ ์ ๊ทผ ์๋์ ๋ฐ๋ฅธ ์ฐจ์ด
- UMA - ๋ฉ๋ชจ๋ฆฌ ์ ๊ทผ์๊ฐ ๋ชจ๋ ํ๋ก์ธ์ ๋์ผ
- NUMA - ๋ค๋ฆ, Local memory ์กด์ฌ. remote memory ์ ๊ทผํ ๋ ๋ ๋ง์ ์๊ฐ ์์
- affinity: ํ๋ก์ธ์ค๊ฐ ํ์ฌ ์คํ ์ค์ธ ํ๋ก์ธ์์ ๋ํ ์ ํธ๋ (soft / hard-์ง์ ๊ฐ๋ฅ)
- POSIX(Portable Operating System Interface): UNIX ๋ฐ ์ ๋์ค ๊ณ์ด OS์์ ์ด์์ฑ ์๋ ์์ฉ ํ๋ก๊ทธ๋จ์ ๊ฐ๋ฐํ๊ธฐ ์ํ ํ์ค ์ธํฐํ์ด์ค. ์๋ก ๋ค๋ฅธ ์์คํ
๊ฐ์ ํธํ์ฑ ์ ๊ณต. system calls, library functions, command and utilities ์ ์ํจ
- 1. ์์คํ ์ฝ(System Calls): ์ด์ ์ฒด์ ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๊ธฐ ์ํ ํ์ค ์ธํฐํ์ด์ค
- 2. ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจ์(Library Functions): ๊ณ ์์ค์ ์ ํธ๋ฆฌํฐ ํจ์์ API
- 3. ์ปค๋งจ๋ ๋ฐ ์ ํธ๋ฆฌํฐ(Command and Utilities): ํ์ค ๋ช ๋ นํ ์ ํธ๋ฆฌํฐ ๋ฐ ์.
728x90