CSE Roadmap

Core tier · about 3 hours · 8 parts

Part 1 of 8 · 1 min read

Why this page comes fifth

In this module you will

  • Explain why interrupts beat polling for slow devices, and when polling wins.
  • Walk through what the processor and the kernel do when an interrupt arrives.
  • Tell an interrupt, a trap and an exception apart, with examples of each.
  • Explain masking, priorities and the interrupt vector.
  • Read /proc/interrupts and write a program that reacts to a timer event.

Page 2 said that the kernel gets control in three ways: a system call, a trap and an interrupt. System calls were covered there. This page covers the other two. Interrupts make multiprogramming work (page 1), the timer interrupt returns the processor to the OS (page 2), and the kernel's first action at boot is to set up the table that handles them (page 4). The main sources are "Operating System Concepts" (OSC), chapter 1, and "Modern Operating Systems" (MOS), chapter 2. Code was compiled and run on Linux before it was written here. Numbers marked "made up" only show the idea.

About this example About this example

Real: The /proc/interrupts listing and the program outputs came from the Linux test machine. The software timer program ran for 1.0 second.

Scripted: Costs in microseconds and event rates marked "made up to show the idea" were chosen for the examples.

Not real: The eight-step description of the interrupt path is a simplified account of what MOS describes.