Interrupt
Interrupt
They
temporarily halt the current operations, save the state of the system, and execute a function or
service routine to address the event. Once the interrupt is serviced, the processor resumes its
previous task.
## Types of Interrupts
1. **Interrupt Request (IRQ)**: A signal sent to the CPU by hardware or software indicating an
event needing immediate attention.
2. **Interrupt Service Routine (ISR)**: A special function or handler that executes in response to
an interrupt.
3. **Interrupt Vector Table (IVT)**: A table that holds the addresses of ISRs for different
interrupt types.
4. **Maskable Interrupts**: Interrupts that can be ignored or "masked" by the CPU if necessary.
5. **Non-Maskable Interrupts (NMI)**: High-priority interrupts that cannot be ignored by the
CPU.
6. **Interrupt Controller**: A device that manages multiple interrupts and prioritizes them
before sending them to the CPU.
7. **Context Switching**: The process of saving the state of the current task and restoring the
state of the ISR.
8. **Polling**: An alternative to interrupts where the CPU continuously checks the status of a
device to see if it needs attention.
9. **Latency**: The delay between the generation of an interrupt and the start of the ISR.
## Detailed Explanation
By understanding interrupts and their handling mechanisms, systems can achieve efficient and
responsive operation, allowing the CPU to respond quickly to important events while continuing
to execute its primary tasks.