Operating Systems
Processes and threads, CPU scheduling, synchronization, deadlock, memory, paging, virtual memory, file systems and disks, with a simulator for every algorithm.
- 1
What an operating system does
The OS manages the hardware and gives programs simple abstractions. User mode and kernel mode, system calls, interrupts, booting and the kinds of kernel.
- 2
Processes
A process is a program in execution: its memory layout, its process control block, the five process states, context switches, and fork, exec and wait.
- 3
Threads and race conditions
Threads share a process's memory but each has its own stack. Why that makes count++ unsafe: a race condition you can cause yourself, step by step.
- 4
CPU scheduling: FCFS and SJF
How the scheduler picks the next process, the measures that judge it (turnaround, waiting and response time), first come first served, and shortest job first.
- 5
Round robin, SRTF and priority
Preemptive scheduling with the timer: shortest remaining time first, priority scheduling with aging, round robin and the choice of time quantum, and multilevel queues.
- 6
Synchronization: locks and semaphores
The critical-section problem and its three rules, Peterson's solution, hardware atomic instructions, mutex locks, semaphores, and the producer-consumer, readers-writers and dining-philosophers problems.
- 7
Deadlock
When processes wait for each other forever: the four conditions, resource-allocation graphs, prevention, avoidance with the banker's algorithm, and detection and recovery.
- 8
Memory: addresses and allocation
Logical and physical addresses, base and limit registers, fixed and variable partitions, first fit, best fit and worst fit, and internal and external fragmentation.
- 9
Paging
Pages and frames, the page table, splitting an address into page number and offset, the TLB and effective access time, and multi-level page tables.
- 10
Virtual memory and page replacement
Demand paging and what happens on a page fault, its cost, the FIFO, Optimal and LRU replacement algorithms, Belady's anomaly, and thrashing.
- 11
File systems
Files and directories, contiguous, linked (FAT) and indexed allocation, inodes and the biggest file they allow, free-space bitmaps, journaling and permissions.
- 12
Disks and disk scheduling
How a hard disk finds data (seek, rotation, transfer), the FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK algorithms, what changes with SSDs, and RAID.