- 2073 Bhadra · 3.5 marks
Short note: principles of I/O software
Short answer
Principles of I/O software are device independence, uniform naming, error handling close to hardware, synchronous interface over interrupt-driven transfers, buffering, and handling sharable versus dedicated devices. These are realized by layering I/O software into interrupt handlers, drivers, device-independent software, and user-level software.
Write a short note on principles of I/O software.
The goals of I/O software are described by the following principles.
- Device independence: programs should be able to access any I/O device without knowing it in advance. A program reading a file should work whether the file is on a floppy, hard disk or USB stick.
- Uniform naming: a file or device name is just a string or integer and does not depend on the device (e.g.
/dev/sdain UNIX, all mounted in one tree). - Error handling: errors should be handled as close to the hardware as possible. The controller tries to fix it first, then the driver (e.g. retry a read); upper layers hear about it only if the lower layers fail.
- Synchronous (blocking) vs asynchronous (interrupt-driven) transfers: the hardware is interrupt driven, but user programs find blocking calls easier to write, so the OS makes interrupt-driven I/O look blocking.
- Buffering: data from a device cannot always be stored directly at the final destination (e.g. network packets), so buffers are used for checking, decoupling speed differences and packet size matching.
- Sharable vs dedicated devices: disks can be shared by many users; printers and tape drives are dedicated. The OS must handle both without causing deadlocks.
These principles are achieved by organising the I/O software in layers: interrupt handlers, device drivers, device-independent software and user-level software.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Testing principles and testability · Software Engineering, chapter 8