---
title: "Short note: principles of I/O software"
subject: "Operating System"
chapter: 6
key: "semester_6/operating_system:io-software-principles-note"
source: https://www.bctengineer.com/q/semester_6/operating_system/io-software-principles-note
site: BCT Engineering
---

# Short note: principles of I/O software

Operating System · Chapter 6: I/O Management and Disk Scheduling

- Asked in: 2073 Bhadra, 3.5 marks
- Video: [5.12 Principles of IO Software Goals of Interrupt handlers](https://www.youtube.com/watch?v=TjfPUZSblJg) — ngit_kmec
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/io-software-principles-note
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-6

## Question

Write a short note on 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.

## Answer

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/sda` in 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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. According to the error-handling principle, where should errors be handled?
   A. Only in the user program
   B. As close to the hardware as possible, with upper layers told only if lower ones fail
   C. Only by the device-independent layer
   D. By the OS after the program ends
   Answer: B. The controller tries first, then the driver (e.g. retry), and upper layers hear only if those fail. (Key point: Error handling principle)

2. Hardware is interrupt driven, yet user programs use blocking calls. Why?
   A. Blocking calls are easier to write, so the OS makes interrupt-driven I/O look blocking
   B. Interrupts are not supported by user programs
   C. Blocking calls are faster than interrupts
   D. Hardware cannot generate interrupts for files
   Answer: A. The OS hides asynchrony from programmers for convenience. (Key point: Blocking vs interrupt-driven)

3. What does device independence mean?
   A. Each device needs its own program
   B. Devices work without drivers
   C. Only disks can be accessed uniformly
   D. Programs can access any I/O device without knowing in advance which it is
   Answer: D. A program reading a file should work for floppy, hard disk or USB. (Key point: Device independence)

4. Which pair is correct for sharable and dedicated devices?
   A. Printer is sharable; disk is dedicated
   B. Tape is sharable; disk is dedicated
   C. Disk is sharable; printer and tape are dedicated
   D. All devices are sharable
   Answer: C. Disks can be used by many users, printers and tapes by one at a time, and the OS must avoid deadlock. (Key point: Sharable vs dedicated)

## Related in other subjects

- [Testing principles and testability](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Atesting-principles) — Software Engineering, chapter 8
