The CPU needs to communicate with external hardware devices (keyboards, disks, printers, network cards), but each device speaks a different “language” with different speeds, data formats, and control mechanisms. Without a unified system, every program would need device-specific code.
The I/O System is the OS subsystem that manages communication between the CPU and external devices, providing abstraction layers so applications can perform I/O without knowing hardware details.
- Applications make I/O requests via system calls (
read(),write(),open()) - The request flows through layered I/O software (user-level → device-independent → device driver → interrupt handler)
- The device driver translates generic OS commands into device-specific instructions
- The device controller executes the operation on the physical hardware
- Completion is signaled via interrupt, and data is returned to the application
- Provides uniform interface to diverse hardware through abstraction layers
- Handles buffering, caching, and error reporting at device-independent layer
- Uses interrupts to avoid CPU busy-waiting
- Supports multiple I/O techniques: polling, interrupt-driven, DMA
- Built from: System Bus, Device Driver, Interrupt Handler
- Builds into: O Request to Hardware Operation, O Software Structure
- Related: Device Controller, DMA, Polling
- Contrasts with: O Software (one layer in the system)
- Device drivers run in kernel mode — a buggy driver can crash the entire OS
- Interrupt storms can overwhelm the CPU if devices generate too many interrupts
- Some devices don’t support interrupts and require polling
- DMA conflicts can occur if the DMA controller isn’t properly programmed