Course Summary
An operating system is the core system software responsible for resource management. Looking back over the whole course, one thread runs through every chapter: the operating system takes the process as its unit of management, treats the CPU, memory, files, and I/O devices as its objects of management, and balances “efficient, fair, reliable” through scheduling, synchronization, allocation, and protection. This page gathers the five modules into a single map, so that a concept you met in one chapter can be located again in the others.
| Module | Core content | Key mechanisms and algorithms |
|---|---|---|
| Operating System Fundamentals | Concepts, characteristics, functions, historical development | Kernel mode vs. user mode, interrupts and exceptions, system calls, architectures |
| Process Management | Processes and threads, scheduling, synchronization, deadlock | State transitions, scheduling algorithms, semaphores, monitors, the Banker’s algorithm |
| Memory Management | Contiguous and non-contiguous allocation, virtual memory | Dynamic partitions, paging/segmentation, page replacement algorithms, the working set |
| File Systems | File organisation, directories, physical allocation, disk management | Directory structures, inodes, disk scheduling algorithms, free space management |
| I/O Systems | Device classification, control methods, buffering | Interrupts, DMA, SPOOLing, the layered I/O subsystem |
2.1 Operating System Fundamentals
The operating system provides an interface between users and hardware and has four defining characteristics: concurrency, sharing, virtualisation, and asynchronism. Its core functions are processor management, memory management, device management, and file management. The key to the runtime environment is the switch between kernel mode and user mode, triggered by interrupts, exceptions, and system calls. Architecturally, a monolithic kernel performs well but is tightly coupled, a microkernel is more reliable but pays a performance cost, and layered and modular structures compromise between the two.
2.2 Process Management
- Processes and threads: a process is the basic unit of resource allocation, a thread is the basic unit of CPU scheduling; the three-state transition (ready, running, blocked) is the foundation for understanding scheduling.
- Processor scheduling: first-come first-served (FCFS) is fair but has a long average wait; shortest job first (SJF) minimises turnaround but needs the burst time in advance; round robin (RR) responds quickly; the multilevel feedback queue combines the strengths of several and is what real systems actually use.
- Synchronisation and mutual exclusion: the critical-section problem can be solved by software (Peterson’s algorithm) or by hardware (interrupt masking, test-and-set, compare-and-swap); semaphores and monitors are the higher-level synchronisation tools; the classic problems are producer-consumer, readers-writers, and dining philosophers.
- Deadlock: the four necessary conditions (mutual exclusion, hold and wait, no preemption, circular wait) must all hold; the counter-measures are prevention, avoidance (the Banker’s algorithm), detection, and recovery.
2.3 Memory Management
- Contiguous allocation: dynamic partition allocation can use first fit, best fit, or worst fit; it produces fragmentation, which compaction addresses.
- Non-contiguous allocation: paging (page number + offset) removes external fragmentation, segmentation (segment number + offset) matches logical structure, and segmented paging combines the two.
- Virtual memory: built on the principle of locality, demand paging loads only the pages that are needed; the page replacement algorithms (FIFO, LRU, OPT) and the working set model together determine performance.
2.4 File Systems
- Files and directories: files are classified by content and purpose; directory structures grew from single-level and two-level to tree structures; hard links share an inode, symbolic links store a path string.
- Physical allocation: contiguous allocation is simple but creates external fragmentation, linked allocation removes fragmentation but makes random access slow, and indexed allocation supports direct access.
- Disk management: the disk scheduling algorithms (FCFS, SSTF, SCAN, C-SCAN) aim to reduce seek time; free space is managed with a bitmap or a free list.
2.5 I/O Systems
The I/O control methods progressed from program polling, to interrupts, to DMA, and on to channels, each step reducing the CPU’s involvement. Buffering (single, double, circular) smooths out speed mismatches, and SPOOLing turns an exclusive device into a shared one. The I/O subsystem is layered as “user-level interface → device-independent layer → device driver layer → hardware control layer”.
| Algorithm | Where it applies | Core idea |
|---|---|---|
| FCFS / SJF / RR | Process scheduling | In arrival order / by burst time / by rotating time slices |
| Banker’s algorithm | Deadlock avoidance | Safety check; allocate only while the system is in a safe state |
| First / best / worst fit | Dynamic partition allocation | Allocate the first / smallest / largest free partition |
| FIFO / LRU / OPT | Page replacement | First in first out / least recently used / furthest in the future |
| SSTF / SCAN / C-SCAN | Disk scheduling | Shortest seek / elevator-style sweep / circular sweep |
- Follow the main thread: use “resource management” as the spine and connect the five modules — process management handles the CPU, memory management handles memory, the file system handles secondary storage, the I/O system handles devices.
- Memorise the algorithms: the four algorithm families (scheduling, replacement, deadlock, disk) are the core of both exams and engineering. Focus on comparing each algorithm’s advantages, disadvantages, and applicable scenarios.
- Understand by deriving: for the classic problems — semaphore synchronisation, the Banker’s algorithm, page replacement — work through the procedure by hand once. Understanding matters more than recall.
- Solve across modules: operating system questions often cross chapters (virtual memory with page replacement, file systems with disk scheduling), so keep the links between modules in mind.
| Term | Abbreviation | Explanation |
|---|---|---|
| Operating System | OS | System software that manages the hardware and software resources of a computer |
| Kernel | - | The core part of an operating system |
| System Call | - | The interface through which an application requests services from the kernel |
| Kernel Mode | - | Privileged execution mode, with access to every resource |
| User Mode | - | Unprivileged execution mode, with restricted access |
| Interrupt | - | An external device asks the CPU to handle something |
| Exception | - | An abnormal event during program execution |
| Concurrency | - | Several tasks execute in an interleaved fashion |
| Virtualisation | - | Physical resources are presented to programs as logical resources |
| Asynchronism | - | The moment at which an event happens is not deterministic |
| Process | - | A program in execution; the basic unit of resource allocation |
| Thread | - | A schedulable flow of execution; the basic unit of CPU scheduling |
| Round Robin | RR | Scheduling that rotates a fixed time slice among ready processes |
| Semaphore | - | A synchronisation primitive with a counter used for P/V operations |
| Monitor | - | A high-level synchronisation construct built on mutual exclusion and condition variables |
| Banker’s Algorithm | - | A deadlock-avoidance algorithm that allocates resources only in a safe state |
| Deadlock | - | A state in which a set of processes each wait for an event only another of them can cause |
| Paging | - | Memory management that splits the logical address space into fixed-size pages |
| Segmentation | - | Memory management that divides the logical address space by logical units |
| Page Table | - | The table that maps page numbers to frame numbers |
| Page Replacement | - | The choice of which resident page to evict when a page fault occurs |
| Working Set | - | The set of pages a process references over a given time window |
| Inode | - | The file system record that stores a file’s metadata and block addresses |
| Disk Scheduling | - | Choosing the order in which pending disk requests are served |
| Buffering | - | Storing data in a temporary area to absorb speed mismatches between devices |
| SPOOLing | - | Simulating a shared device by buffering jobs on secondary storage |
| Direct Memory Access | DMA | A transfer mode in which a device moves data without CPU involvement |
| Effective Access Time | EAT | The average time of one memory reference, weighted over hits and page faults |
