← 🔌 I/O Interface, Interrupts & DMA
Subtopic 3 of 8

9.3Interrupt-driven I/O

The idea

In interrupt-driven I/O the CPU carries on with other work, and the device interrupts it when ready.

Think of it like this: You do other chores and the oven beeps when the cake is done.

Why it exists

It lets the CPU overlap computation with I/O.

How it works

  1. CPU starts the I/O and returns to the program.
  2. Device raises an interrupt when ready.
  3. CPU saves state, runs the ISR (moves the word), restores state.
  4. Overhead is only the save/restore and the ISR.

Worked example: Compare

Polling wasted 5 cycles; interrupt-driven only spent 3 on save, ISR and restore.

Now play with it

  • →Press Play: the CPU shows green "work" while the device is busy.
12345678910
CPUworkworkworkworkworksaveISRrestworkwork
DevicebusybusybusybusybusyIRQ

The CPU keeps computing while the device works. Overhead is only the context save/restore and the ISR itself.

Check yourself

When does the CPU normally recognise an interrupt?

Remember: Interrupts: CPU works until the device asks.
Exam notes (the dense version)

Device raises INTR when ready; CPU saves context, jumps to ISR, returns (IRET). CPU does useful work meanwhile. Still moves each word through the CPU.

Previous year questions: I/O Interface, Interrupts & DMA (8)

PYQs are grouped by topic, so this is the full set for I/O Interface, Interrupts & DMA; try the ones that match this subtopic. Open all 8 on the topic page.