1.2.1e - interrupts Flashcards
What is an interrupt?
A signal to the processor indicating an event needs attention.
What are hardware interrupts?
Signals from devices (e.g. keyboard press).
What are software interrupts?
Signals from programs (e.g. divide by zero error).
What happens when an interrupt is received?
CPU pauses current task and executes an Interrupt Service Routine (ISR).
What is the ISR?
Interrupt Service Routine – handles the interrupt.
What is the purpose of interrupts?
To allow immediate response to important events.
What is an interrupt vector?
A list of addresses to ISR functions.
What is context switching?
Saving current state to resume later.
What is the role of the stack in interrupts?
Stores register values during the ISR.
What happens after an ISR finishes?
The CPU resumes the previous task from the saved state.
Why are interrupts prioritised?
So urgent tasks are handled before less critical ones.
What is polling?
Repeatedly checking for events – less efficient than interrupts.
How do interrupts improve CPU efficiency?
Avoids wasting cycles checking for events.
What kind of events can trigger interrupts?
I/O operations, errors, timers.
What’s the difference between maskable and non-maskable interrupts?
Maskable can be ignored temporarily
What is a timer interrupt?
Signals the end of a time slice in scheduling.
What’s a keyboard interrupt?
Triggered when a key is pressed or released.
How does an OS use interrupts?
For multitasking, I/O handling, and time management.
Can interrupts be nested?
Yes, higher-priority interrupts can interrupt lower ones.
Why is interrupt handling important in real-time systems?
Ensures time-sensitive tasks are handled promptly.
What is an interrupt flag?
Indicates that an interrupt has occurred.
What is priority-based interrupt handling?
Highest priority interrupt is serviced first.
What’s the danger of too many interrupts?
Can lead to missed or delayed processing (interrupt storm).
What must happen before an ISR runs?
CPU state must be saved.