› Module 9: I/O and Disk Management › 9.1 I/O Hardware & Software Layers
M O D U L E

Module 9: I/O and Disk Management

I/O hardware, layered software drivers, disk geometry, and seek scheduling algorithms

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: Layered Structure of Operating System I/O Software User-Level I/O Software Libraries (stdio), Spooling (printers) Device-Independent OS Software Buffering, Caching, Error reporting, Protection Device Drivers Device-specific code; talks to controller registers Interrupt Handlers Wakes driver when hardware I/O operation finishes Hardware (Controllers & Devices) Physical magnetic disks, SSDs, NICs, keyboards

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: Disk Head Movement Comparison (Queue: 98, 183, 37, 122, 14, 124, 65, 67 | Head Start = 53) Cylinder Number (0 to 199) FCFS (Total = 640 cyl) SSTF (Total = 236 cyl) SCAN (Elevator) = 331 cylinders • C-SCAN travels in one direction only to provide uniform wait times.

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.
MODULE COMPREHENSIVE QUIZ

Module 9 Final Quiz

Test your understanding across all 2 topics of this module with interview-grade questions, tricky edge cases, and code output predictions.

Take Module 9 Final Quiz →
Yukti Mascot