The CPU needs to interact with many different types of external hardware — keyboards, disks, printers, network cards — each with different speeds, data formats, and interfaces. The OS must classify and manage them appropriately.
I/O devices are classified by their function (input/output/storage/communication) and data transfer mode (block vs character vs stream), determining how the OS handles them.
Devices are classified into:
- By function: Input (keyboard), Output (monitor), Storage (disk), Communication (NIC)
- By data transfer: Block devices (disk, fixed-size blocks), Character devices (keyboard, stream of bytes), Stream devices (audio/video)
- By speed: Slow (keyboard), Medium (disk), Fast (GPU, network)
- Block devices transfer fixed-size blocks (512B, 4KB), seekable
- Character devices transfer bytes sequentially, not seekable
- Speed varies from very slow (keyboard) to very fast (10GbE NIC)
- Hybrid devices exist (touchscreen = input + output)
- Built from: O System, Device Driver
- Builds into: Block Driver, Character Driver, Network Driver
- Related: Device Controller, System Bus
- Contrasts with: CPU (computes, not I/O)
- Some devices are both input and output (touchscreen, modem)
- Block devices may emulate character devices for certain operations
- Device classification blurs with modern hardware (GPU does both compute and output)