Operating Systems Cheat Sheet
Formulas
TAT = CT − AT WT = TAT − BT
Need = Max − Allocation
Physical = frame × page_size + offset
EAT = h(TLB + m) + (1 − h)(TLB + 2m)
Pages = 2^(logical bits) / page_size
Algorithms at a glance
Scheduling: FCFS · SJF · SRTF · Priority (+aging) · RR · MLFQ
Page replacement: FIFO · LRU · Optimal · LFU · Clock
Disk: FCFS · SSTF · SCAN · C-SCAN · LOOK · C-LOOK
Deadlock: prevent · avoid (Banker's) · detect & recover · ignore
Remember
fork(): 0 in child, child PID in parent; n forks → 2^n processes
Deadlock needs ALL FOUR: mutual exclusion, hold & wait, no preemption, circular wait
FIFO can show Belady's anomaly; LRU and Optimal cannot
Threads share code/data/heap; each has its own stack + registers
Full Operating Systems documentation