Introduction:
Interrupt can stop job and start another more important job, and every part of information below support you to understand how interrupts work.
What is an interrupt?
Definition : an event external to the currently executing process that causes a change in the normal flow of instruction execution. Usually generated by hardware devices external to the CPU.
Why Interrupts?
People like connecting devices .
- A computer is much more than the CPU
- Keyboard, mouse, screen, disk drives
- Scanner, printer, sound card, camera, etc.
These devices occasionally need CPU service
- But we can’t predict when.
External events typically occur on a macroscopic
timescale .
- we want to keep the CPU busy between events
Give each device a wire (interrupt line) that it can use to signal the processor
- When interrupt signaled, processor executes a routine called an interrupt handler to deal with the interrupt.
- No overhead when no requests pending.
Intel 430HX Motherboard :
Programmable interrupt controller (PIC) part of the “South-bridge” chip :
Programmable interrupt controller (PIC) part of the “South-bridge” chip :
- Commonly 8259A chip
- 8 inputs, 1 output
- Can be chained together
- Newer systems use “Advanced PIC” (APIC) for SMP support Principle is the same
Hardware Interrupt Handling :
- Interrupt controller signals CPU that interrupt has occurred, passes interrupt number.
- Interrupts are assigned priorities to handle simultaneous interrupts.
- Lower priority interrupts may be disabled during service.
- Uses interrupt number to determine which handler to start.
- Interrupt vector associates handlers with interrupts.
3 - Basic program state saved (as for system call) .
4 - CPU jumps to interrupt handler .
5- When interrupt done, program state reloaded and
program resumes .
Software Interrupt Handling :
Typically two parts to interrupt handling
- The part that has to be done immediately
- So that device can continue working
- The part that should be deferred for later
- So that we can respond to the device faster
- So that we have a more convenient execution context
No comments:
Post a Comment