đ 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.
đ 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?
đ 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?
đ 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?
đ 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?
đ 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?
đ 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.