5 lessons
How does the CPU even talk to a keyboard or a screen?
A keyboard isn't memory, but the CPU still needs to read from it. Here's the simple trick that lets the exact same LOAD/STORE instructions talk to any device at all.
Interrupts: letting the device tap the CPU on the shoulder
Instead of the CPU constantly asking "are you ready yet?", what if the device could just interrupt whatever the CPU is doing the moment it actually has something? That's an interrupt.
What happens when two devices interrupt at the exact same time?
Real computers have dozens of devices that can all demand attention. Here's how the CPU figures out which interrupt fired, and which one to service first when several arrive together.
DMA: letting devices copy data without bothering the CPU at all
Interrupts fixed waiting for slow devices, but transferring a huge file still means the CPU babysitting every single word. DMA is the trick that removes the CPU from that loop entirely.
Polling vs interrupts vs DMA - choosing the right tool
Three ways to move data in or out of a computer, each solving a real limitation of the one before it. Here's how to reason about which one a given device actually needs.