operating-systems io

Definition

IO Functions

IO functions are mechanisms controlling data transfer between the processor and peripheral devices, ranging from high CPU involvement to complete autonomy.

Mechanisms

Programmed IO

Processor issues IO command and busy-waits for completion.

Cost: High CPU utilisation. Only suitable for very fast devices.

Interrupt-driven IO

Processor issues IO command and continues useful work. IO module interrupts on completion.

Benefit: Better CPU utilisation than programmed IO.
Cost: Still requires interrupt per word/byte transferred.

Direct Memory Access (DMA)

Processor delegates transfer to a DMA Controller which copies data autonomously between device and memory.

Mechanism: CPU provides starting address, device address, and transfer size. DMA “steals” bus cycles (cycle stealing) during transfer.

Benefit: CPU interrupted only once after entire block transfer.

IO Channel

Evolution of DMA with its own instruction set. CPU places IO instructions in memory; channel executes them independently.

Selector Channel: Manages multiple high-speed devices, one active at a time.
Multiplexer Channel: Handles multiple slow/medium devices simultaneously via interleaving.