Sun. Jan 22nd, 2023

Role of interrupts in a computer system

Interrupts are signals sent to the CPU by external devices (most commonly IO devices) which require action to be taken.

When the operating system loads up, it populates the IDT with the address of the code that should run in response to these interrupts.

When an interrupt is received by the CPU, all execution is paused, further interrupts are temporarily disabled, and the code in the operating system referenced by the relevant entry in the IDT is called. Upon completion, the CPUs resumes its original task, and further interrupts are again serviced.