Chapter 11 · Simulation

I/O: Polling, Interrupts, DMA

← Chapter 11
Units
Latency
Speed 2/s

IRQ 0 CPU busy 0 Moved 0/0 Step 0/0

I/O: Polling, Interrupts, DMA

A block made of units is moved between the device and memory through the device controller. With polling the CPU busy-waits on the status register and copies every unit itself; with interrupts the device raises one IRQ per unit and the interrupt service routine (ISR) copies the unit; with DMA the DMA controller moves the whole block and raises a single completion IRQ. The diagram shows which component is active; the lanes below show CPU activity and transferred data over time.

Usage

  • Choose the I/O method, the number of units (1–64), the device latency and the transfer direction.
  • Play or step through; the side panel shows the CPU mode, the controller registers and where the CPU time goes.
  • Compare methods shows the interrupt count and the CPU busy time of the three methods for the same transfer.

Terms

Polling
The CPU reads the status register in a loop until it is READY, then copies.
Interrupt
The device raises one IRQ per unit; the ISR copies the unit.
DMA
The DMA controller copies the block; a single IRQ at the end.
Status
Controller register: BUSY or READY.
Data
Controller register holding one unit.
Latency
Time the device needs per unit (1, 2 or 4).
CPU busy
Time units the CPU spends on this I/O.

Legend

polling ISR I/O work user work ● data unit ⚡ IRQ

Keys

←→ stepSpace playHomeEnd first / lastEsc close