🎓 BookMCQ
← Back to 13. I/O Systems

📝 Kernel I/O Subsystem (5 MCQs)

Kernel Services Between Applications and Devices

The kernel I/O subsystem provides shared services that coordinate data exchange between applications, device drivers, and hardware. It manages I/O requests, device-independent interfaces, buffering, caching, scheduling, error reporting, and access control. By centralising these functions, the kernel reduces duplicated device-management logic and provides consistent handling of different devices and workloads.

Why Device Management Needs Common Kernel Services

Devices differ in speed, transfer size, access patterns, and failure behaviour. Handling every detail separately inside applications would increase complexity and produce inconsistent resource management. The kernel provides common mechanisms while drivers retain device-specific knowledge. This division supports portability, sharing, and coordination among processes that request the same hardware resources.

Request Processing Through Drivers and Queues

An application submits a request through a system call or subsystem interface. The kernel validates it, identifies the relevant device, and places it in an appropriate queue. Shared services may buffer or cache data, schedule requests, and invoke the driver. The driver programs the controller, while completion and error handlers update the request state.

Example of Concurrent File Read Requests

Two processes request different blocks from the same storage device. The kernel's block layer records both requests and may reorder or merge them to improve device access. The driver dispatches the selected operations, and completion information is returned to the appropriate processes through the file system and I/O interfaces.

Abstraction, Coordination and Resource Overhead

The kernel I/O subsystem allows applications to use common operations while managing device-specific details internally. Buffering and caching can reduce delays, and scheduling can improve throughput under contention. These services consume memory and CPU time, however, and poor queue management or excessive copying can increase latency rather than improve performance.

Misconceptions About Kernel I/O Services

'The kernel I/O subsystem is the device driver' is incorrect because it includes shared services and driver interfaces. 'Every I/O request immediately reaches hardware' ignores queues, caches, and deferred execution. 'Caching and buffering are identical' is false because caching preserves reusable data, while buffering temporarily holds data during transfer or rate matching.

Exam Focus: Kernel I/O Request Lifecycle

Trace an I/O request from the system call interface through validation, queuing, driver execution, and completion. Identify the roles of buffering, caching, scheduling, and error handling. Questions may ask how shared kernel services differ from device-specific drivers or how multiple processes can safely compete for the same device.

Key Terms of the Kernel I/O Subsystem

  • Kernel I/O subsystem - Shared services for device operations.
  • Driver - Software controlling a particular device.
  • I/O queue - Holds pending device requests.
  • Buffering - Temporarily stores data during transfers.
  • Caching - Retains data for later reuse.
1
Easy
2
Medium
2
Hard

📝 All Kernel I/O Subsystem MCQs

Q1. A driver receives interrupt vector number 45 from a device. Which statement correctly describes its priority and maskability?

A.It is a non‑maskable interrupt with the highest priority.
B.It is a maskable interrupt with medium priority, allowing higher‑priority interrupts to preempt it. ✅
C.It is a non‑maskable interrupt but with low priority.
D.It is a maskable interrupt that cannot be preempted by any other interrupt.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The correct answer is B because vectors 32–255 are maskable, so vector 45 can be masked and has a priority that can be superseded by higher‑priority interrupts. Option A is wrong because only vectors 0–31 are non‑maskable. Option C mixes properties incorrectly, and option D misstates that maskable interrupts are never preempted. In real systems, a driver relies on this behavior to let critical interrupts interrupt less important device handling.

Q2. After the OS has booted, a hot‑plug PCI network card reports interrupt vector 120. What must the OS do to ensure the new device’s interrupts are serviced correctly?

A.Ignore it because interrupt vectors are fixed at boot.
B.Register a new handler in the vector table at entry 120 and enable the corresponding IRQ line. ✅
C.Replace the existing handler at vector 120, even if it belongs to another device.
D.Reboot the system to re‑probe all hardware.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Answer B is correct: the OS must install a handler at vector 120 and enable the IRQ so the CPU can jump to the routine when the device raises an interrupt. Option A is false because modern OSes support dynamic interrupt registration. Option C would corrupt another device’s service routine, causing system instability. Option D is unnecessary; hot‑plug support avoids rebooting. This reflects how a kernel dynamically updates its interrupt vector table for new hardware.

Q3. If a low‑priority maskable interrupt (vector 90) arrives while the CPU is handling a non‑maskable exception (vector 14), what will the CPU do?

A.It will immediately service the low‑priority interrupt.
B.It will finish the non‑maskable exception before considering the maskable interrupt. ✅
C.It will discard the low‑priority interrupt.
D.It will treat the low‑priority interrupt as non‑maskable.
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The CPU must complete the non‑maskable exception (vector 14) before attending to any maskable interrupt, so B is correct. Option A contradicts the definition of non‑maskable events. Option C is wrong because maskable interrupts are not discarded; they wait. Option D misclassifies the interrupt type. In practice, this ordering guarantees that critical errors are resolved before routine device servicing proceeds.

Q4. Why does the interrupt mechanism allow a high‑priority interrupt to preempt a low‑priority one without disabling all interrupts?

A.Because high‑priority interrupts are always non‑maskable.
B.Because the CPU maintains separate priority levels, enabling selective masking. ✅
C.Because low‑priority interrupts are ignored once any interrupt occurs.
D.Because the OS disables the interrupt controller during low‑priority handling.
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Option B is correct: the CPU uses interrupt‑priority levels so it can mask lower‑priority requests while still accepting higher‑priority ones. Option A is incorrect because high‑priority interrupts can be maskable. Option C is false; low‑priority interrupts remain pending. Option D misrepresents OS behavior; the controller is not globally disabled. Understanding this selective masking explains how a kernel can keep the system responsive while still protecting critical operations.

Q5. What is the primary purpose of dividing the interrupt vector space into non‑maskable (0‑31) and maskable (32‑255) ranges in the Intel Pentium architecture?

A.To allocate more vectors for device interrupts than for exceptions.
B.To ensure that critical system errors can be serviced even when interrupts are disabled. ✅
C.To simplify the hardware design by using a single priority level.
D.To allow user programs to define their own interrupt vectors.
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The division exists so that vectors 0–31 represent non‑maskable exceptions that must be handled even if the CPU has disabled maskable interrupts, making answer B correct. Option A describes a side effect but not the primary reason. Option C is wrong because the architecture actually uses multiple priority levels. Option D is incorrect; user programs cannot directly define these vectors. This design protects the OS from losing essential error handling while still permitting flexible device interrupt management.

🔗 Related Topics (MCQs)