Interrupts
Interrupts
INTERRUPTS
Learning Objectives:
Definition of Interrupts
An interrupt is a signal sent from a device or software to the processor to request immediate attention.
It temporarily stops the execution of the current process, allowing the CPU to address a task of higher
priority before resuming the previous operations.
Purpose of Interrupts
Interrupts help in efficient multitasking and resource management by allowing the CPU to:
TYPES OF INTERRUPTS
1. Hardware Interrupts: This is an electronic signal from an external hardware device that indicates it
needs attention from the operating system. Hardware interrupts can be Maskable (ignorable) or
non-maskable (important, not to be ignored).
1. Interrupts are added to an area called the Interrupt Service Routine [ISR] which holds
instructions that will need to be fetched, decoded and executed to complete the commands of
the interrupt
2. Saving the Current State: The CPU pauses execution and saves the current instruction pointer
and register values onto the stack. The use of the stack ensures that the CPU can return to the
exact state it was in before handling the interrupt, maintaining system stability.
3. Identifying the Interrupt: The CPU checks the interrupt vector table to find the corresponding
ISR.
4. Executing the ISR: The ISR runs the appropriate response for the interrupt.
5. Restoring the State: Once the ISR completes, the saved values are retrieved from the stack.
6. Resuming Normal Execution: The CPU resumes the previously interrupted task.
ASSIGNMENT
Tabulate 5 differences between hardware and software interrupts (To be done in your notebooks)