- 2072 Asoj · 3+6 marks
Disk scheduling; device-independent I/O software
Short answer
Disk scheduling orders pending I/O requests to minimize seek time; common algorithms include FCFS, SSTF, SCAN, C-SCAN, LOOK. Device-independent I/O software provides a uniform interface to drivers, with buffering, error reporting, naming, protection, caching, scheduling, and device-independent block size. Example: write(fd,buf,n) works identically for disk, USB, or terminal.
What is disc scheduling? Explain details about the device independent I/O software with example.
Disk scheduling
Disk scheduling is the method by which the OS decides the order in which pending disk I/O requests are served, in order to reduce the total seek time (arm movement) and improve throughput and fairness. Disk access time = seek time + rotational latency + transfer time; seek time is the largest part and the only one the scheduler can reduce easily.
Common algorithms:
| Algorithm | Idea | Remark |
|---|---|---|
| FCFS | Serve in arrival order | Fair, but long arm movement |
| SSTF/SSF | Serve the nearest cylinder first | Low movement; starvation possible |
| SCAN (elevator) | Move in one direction serving requests to the disk end, then reverse | No starvation, good for heavy load |
| C-SCAN | Serve in one direction only; on reaching the end return to start | More uniform waiting time |
| LOOK / C-LOOK | Like SCAN/C-SCAN but turn back at the last request | Less movement |
Example: head at 50, queue 90, 20, 60. FCFS: 40 + 70 + 40 = 150. SSTF (60, 90, 20): 10 + 30 + 70 = 110.
Device-independent I/O software
Device-independent I/O software is the layer of the OS that performs I/O functions common to all devices and gives a uniform interface to the user-level programs, so that device specific details remain in the drivers.
Functions:
- Uniform interfacing for device drivers: all drivers present the same functions to the kernel, so a new driver can be added without changing the OS.
- Buffering: holds data temporarily in kernel buffers (user buffer vs kernel buffer, double buffering) to cope with speed differences.
- Error reporting: handles programming errors (illegal operation) and passes on actual I/O errors.
- Allocating and releasing dedicated devices: devices such as printers and tapes are given to one process at a time (open/close).
- Providing a device-independent block size: hides different sector sizes of disks by presenting a uniform logical block size.
- Naming and protection: device names (such as /dev/sda) map to the proper driver; access permissions are checked.
- Caching and scheduling: block cache and disk scheduling.
Example: a program calls write(fd, buf, n). The call works the same whether fd refers to a file on a disk, a USB drive or the terminal; the device-independent layer checks permissions, buffers the data and selects the driver, and only then the driver talks to the specific controller.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Programmed I/O, DMA, device-independent software · Operating System, chapter 6
- Device-independent I/O software with example · Operating System, chapter 6
- Disk scheduling: FCFS, SSF, SCAN at 53 · Operating System, chapter 6 · asked 3×
- Disk scheduling with 100 cylinders · Operating System, chapter 6 · asked 2×
- Disk scheduling with 150 cylinders · Operating System, chapter 6 · asked 2×
- Disk scheduling, 1000 cylinders, head at 345 · Operating System, chapter 6