Interrupts
In short: An interrupt is a signal with which hardware or software interrupts the processor so that it immediately handles an urgent event.
In more detail: Instead of constantly asking whether a key was pressed (polling), the keyboard reports via interrupt. The processor saves its state, runs the responsible handler and then returns to the interrupted work.
In Depth
- Hardware interrupts: Keyboard, network card, timer, storage.
- Software interrupts/traps: System calls and faults such as division by zero or page faults.
- Interrupt vector: A table says which routine belongs to which number.
- Keep it short: The handler should be quick. Heavy work is deferred (bottom half).
- Timer interrupt: Drives the operating system and enables time slices for multitasking.
See also: Process scheduling