Abstract
- Also known as Interrupt Service Routine (ISR)
- A set of Instruction at a fixed address within Kernel, responding to the Interrupts (中断) like System Call (系统调用) by performing the following 3 items
5 Steps
- Saves the state of the CPU for the Process (进程) like stack pointers into the process’s Process Control Block (PCB). So the interrupted process can be resumed later
- Does its other business
- Invokes the Process Scheduler
- Restore register/CPU
- Return from interrupt
C Implementation
Any variables changed inside the interrupt handler should be declared with volatile
Interrupt Handler Pointer
- It contains the Memory Address to the start of the Instruction of the Interrupt Handler