Operating System

Interrupt

Interrupts are one of the most fundamental concepts to understand.

Virtually all computers provide a mechanism by which other modules (I/O, memory) may interrupt the normal sequencing of the processor.

This mechanism is implemented through what is called an ā€œinterruptā€.

Difference between interrupt and exception?

Interrupts originate from outside the current execution context, and are typically generated by hardware devices (like I/O operations, timers) or software signals for system calls, whereas exceptions occurs as a result of the program’s execution.

Why interrupts?

Interrupts are provided primarily as a way to improve processor utilization. For example, most I/O devices are much slower than the processor. Imagine if the processor had to wait for the I/O every time…

Concepts

Resuming a process is very similar to how we enter and resume from an interrupt.

The most common types of interrupts:

See Interrupt Processing for a detailed mechanism of how interrupts work (has image below).