9.1 I/O Hardware & Software Layers
Because hardware I/O devices vary widely in transfer speeds, access protocols, and data formats, operating systems organize I/O management into modular layers, hiding device-specific quirks beneath clean, uniform abstractions.
Figure 9.1: Each layer hides physical device complexity from the layer above, presenting a unified read/write interface.
9.2 Disk Structure & Disk Scheduling Algorithms
Because physical disk head movement (seek time) represents the largest performance bottleneck in secondary storage, operating systems reorder pending block read/write requests using Disk Scheduling Algorithms to minimize total head travel.
Figure 9.2: FCFS generates erratic back-and-forth head thrashing; SSTF services closest cylinders first; SCAN and C-SCAN sweep smoothly like an elevator.
Disk Scheduling Algorithms Compared
- FCFS: Services requests in arrival order. Perfectly fair, zero starvation, but severe head travel.
- SSTF (Shortest Seek Time First): Selects the request closest to the current head position. Greatly reduces seek time, but causes starvation of distant requests.
- SCAN (Elevator Algorithm): The disk arm sweeps in one direction servicing requests until reaching the disk boundary, then reverses direction.
- C-SCAN (Circular SCAN): Services requests in one direction only; upon hitting the boundary, returns immediately to the beginning without servicing requests on the return sweep, providing uniform wait times.
- LOOK & C-LOOK: Practical optimizations of SCAN/C-SCAN where the head arm reverses as soon as the last pending request is reached, avoiding wasted seeks to the physical disk ends.