Interrupts are used to demand attention from the CPU. There are processor, hardware and software driven interrupts. The PC was designed as an interrupt driven system. Communications between the CPU, hardware and software occurs by means of of flags or interrupts which signal when a device or piece of software needs attention from the CPU. The PC is limited to 256 interrupts each of which receives a number. The Programmable Interrupt Controller (PIC) controls which interrupt gets the attention of the CPU and when. Basically, the lower numbered interrupts receive attention from the CPU before the higher numbered interrupts. The PC interrupts can be divided into six categories:
1. Processor Interrupts - Interrupts 00h to 07h are called by the processor directly, but can also be called from software using the INT instruction.
2. Hardware Interrupts - The hardware interrupts differ from all the software interrupts in that they have a direct channel to the processor thorough an Interrupt Request Line or IRQ. There are 16 IRQ lines on PC's (there are 8 IRQ lines on 8086/8088 based computers). These lines are hardwired on the motherboard and directly access the processor. The 8259 Programmable Interrupt Controller or PIC on the motherboard manages all the hardware interrupts. These controllers receive the requests from the various devices and pass the request along to the processor after converting them to specific instructions.
This allows a device or subsystem to work in the background until a particular event occurs that demands attention, like a keystroke or sound. An interrupt is created by asserting a logic level on an Interrupt Request (IRQ) line. This lines are accessed from any of the computers bus slots. An XT computer had 8 IRQ's, while the AT provides 16. These lines are controlled through the Programmable Interrupt Controller which in turn triggers the desired interrupt request to the CPU. Below is a listing of the hardware interrupts for a PC compatible computer:
IRQ
|
Interrupt
|
Function
|
0
|
08h
|
System timer IC
|
1
|
09h
|
Keyboard controller IC
|
2
|
0Ah
|
Second IRQ controller IC
|
3
|
0Bh
|
Serial port 2 (COM 2: 2F8h-2FFh and COM 4: 2E8h-2EFh) or hardware modem use
|
4
|
0Ch
|
Serial port 1 (COM 1: 3F8h-3FFh and COM 3: 3E8h-3EFh) or serial port mouse use
|
5
|
0Dh
|
Parallel port 2 (LPT 2: 378h or 278h) or general adapter use (typically used for sound cards)
|
6
|
0Eh
|
Floppy disk controller
|
7
|
0Fh
|
Parallel port 1 (LPT 1: 3BCh [mono] or 378h [color]
|
8
|
70h
|
Real time clock or RTC
|
9
|
71h
|
Unused (redirected to IRQ 2)
|
10
|
72h
|
USB on systems so equipped (can be disabled) or general adapter use
|
11
|
73h
|
Windows sound system on systems so equipped (can be disabled) or general adapter use
|
12
|
74h
|
Motherboard mouse port on systems so equipped or general adapter use
|
13
|
75h
|
Math coprocessor
|
14
|
76h
|
Primary AT/IDE hard disk controller
|
15
|
77h
|
Secondary AT/IDE hard disk controller on systems so equipped (can be disabled) or general adapter use
|
An AT systems uses IRQ 2 on the motherboard so instead of leaving it empty, IRQ 9 now is wired to this IRQ, in effect, cascading, or redirecting, the IRQ. So IRQ 9 is now redirected to IRQ 2. When a interrupt request is made, the CPU saves the current state of registers in a small amount of memory called the stack, then the CPU is directed to the interrupt vector table, which is a list of program locations that represent each interrupt. Here, the CPU locates the interrupt handler for the desired interrupt request and executes the routine. Once the desires task is finished, the prior register contents are popped from the stack they are being held in and the CPU will continue with it's task it was performing prior to the interrupt.
3. Software Interrupts - These interrupts are generated by the ROM BIOS during the start up of the computer. These interrupts are used for general low-level services.
4. DOS Interrupts - These interrupts are available when DOS is running and provide additional routines for enhanced access to devices and other resources.
5. ROM Basic Interrupts - These interrupts are available when Basic is running.
6. General use Interrupts - These interrupts are available for use by other programs.
Interrupt Vector Table
- When power is applied to a computer, the POST procedure creates a table of interrupt vectors that is 1024 bytes and contains a maximum of 256 interrupts. This table lists pointers to interrupt service routines. The interrupt vector table starts at memory location 0000:0000h and ends at 0000:03FCh. An interrupt vector is a 4-byte value of the form offset;segment, which represents the address of a routine to be called when the CPU receives an interrupt. The interrupt vector table is first initialized by the start up ROM but changes are made to it's contents as the first ROM Extensions and later the operating system files are loaded. The ability to update the contents of the interrupt vector table provides a means to easily expand operating system services.
Interrupt
|
Address
|
Type
|
Function
|
00h
|
0000:0000h
|
Processor
|
Divide By Zero
|
01h
|
0000:0004h
|
Processor
|
Single Step
|
02h
|
0000:0008h
|
Processor
|
Nonmaskable Interrupt (NMI)
|
03h
|
0000:000Ch
|
Processor
|
Breakpoint Instruction
|
04h
|
0000:0010h
|
Processor
|
Overflow Instruction
|
05h
|
0000:0014h
|
BIOS/Software
|
Print Screen
|
05h
|
0000:0014h
|
Hardware
|
Bounds Exception (80286, 80386)
|
06h
|
0000:0018h
|
Hardware
|
Invalid Op Code (80286, 80386)
|
07h
|
0000:001Ch
|
Hardware
|
Math Coprocessor Not Present
|
08h
|
0000:0020h
|
Hardware
|
Double Exception Error (80286, 80386) (AT Only)
|
08h
|
0000:0020h
|
Hardware
|
System Timer - IRQ 0
|
09h
|
0000:0024h
|
Hardware
|
Keyboard - IRQ 1
|
09h
|
0000:0024h
|
Hardware
|
Math Coprocessor Segment Overrun (80286, 80386) (AT Only)
|
0Ah
|
0000:0028h
|
Hardware
|
IRQ 2 - Cascade from Second programmable Interrupt Controller
|
0Ah
|
|
Hardware
|
Invalid Task Segment State (80286, 80286) (AT Only)
|
0Ah
|
|
Hardware
|
IRQ 2 - General Adapter Use (PC Only)
|
0Bh
|
0000:002Ch
|
Hardware
|
IRQ 3 - Serial Communications (COM 2)
|
0Bh
|
|
Hardware
|
Segment Not Present (80286, 80386)
|
0Ch
|
0000:0030h
|
Hardware
|
IRQ 4 - Serial Communications (COM 1)
|
0Ch
|
|
Hardware
|
Stack Segment Overflow (80286, 80386)
|
0Dh
|
0000:0034h
|
Hardware
|
Parallel Printer (LPT 2) (AT Only)
|
0Dh
|
|
Hardware
|
IRQ 5 - Fixed Disk (XT Only)
|
0Dh
|
|
Software
|
General Protection Fault (80286, 80386)
|
0Eh
|
0000:0038h
|
Software
|
IRQ 6- Diskette Drive Controller
|
0Eh
|
|
Software
|
Page Fault (80386 Only)
|
0Fh
|
0000:003Ch
|
Software
|
IRQ 7 - Parallel printer (LPT 1)
|
10h
|
0000:0040h
|
Software
|
Video
|
10h
|
|
Software
|
Numeric Coprocessor Fault (80286, 80386)
|
11h
|
0000:0044h
|
Software
|
Equipment List
|
12h
|
0000:0048h
|
Software
|
Memory Size
|
13h
|
0000:004Ch
|
Software
|
Fixed Disk/ Diskette
|
14h
|
0000:0050h
|
Software
|
Serial Communication
|
15h
|
0000:0054h
|
Software
|
System Services
|
16h
|
0000:0058h
|
Software
|
Keyboard
|
17h
|
0000:005Ch
|
Software
|
Parallel Printer
|
18h
|
0000:0060h
|
Software
|
Load ROM Basic (PC Only)
|
18h
|
|
Software
|
Process Boot Failure (XT, AT)
|
19h
|
0000:0064h
|
Software
|
Boot Strap Loader
|
1Ah
|
0000:0068h
|
Software
|
Time of Day
|
1Bh
|
0000:006Ch
|
Software
|
Keyboard Break
|
1Ch
|
0000:0070h
|
User
|
User Timer Tick
|
1Dh
|
0000:0074h
|
BIOS Table
|
Video Parameter Table
|
1Eh
|
0000:006Ch
|
BIOS Table
|
Diskette parameter table
|
1Fh
|
0000:007Ch
|
User
|
Video Graphics Characters
|
20h-3Fh
|
0000:0080h - 0000:00FCh
|
Software
|
Reserved for DOS
|
40h
|
0000:0100h
|
Software
|
Diskette Boot Revector
|
41h
|
0000:0104h
|
BIOS Table
|
Fixed Disk Parameter Table
|
42h
|
0000:0108h
|
BIOS Table
|
EGA Default Video Driver
|
43h
|
0000:010Ch
|
User
|
Video Graphics Characters
|
44h - 45h
|
0000:0110h - 0000:0114h
|
Software
|
Reserved
|
46h
|
0000:0118h
|
BIOS Table
|
Fixed Disk Parameter Table
|
47h - 49h
|
0000:011Ch - 0000:0124h
|
Software
|
Reserved
|
4Ah
|
0000:0128h
|
User
|
User Alarm
|
4Bh - 6Fh
|
0000:012Ch - 0000:01BCh
|
Software
|
Reserved
|
70h
|
0000:01C0h
|
Hardware
|
IRQ 8 - Real Time Clock
|
71h
|
0000:01C4h
|
Hardware
|
IRQ 9 - Redirect Cascade
|
72h
|
0000:01C8h
|
Hardware
|
IRQ 10 - General Adapter Use
|
73h
|
0000:01CCh
|
Hardware
|
IRQ 11 - General Adapter Use
|
74h
|
0000:01D0h
|
Hardware
|
IRQ 12 - General Adapter Use/ PS/2 Mouse
|
75h
|
0000:01D4h
|
Hardware
|
IRQ 13 - Math Coprocessor Exception
|
76h
|
0000:01D8h
|
Hardware
|
IRQ 14 - Primary Hard Disk Controller
|
77h
|
0000:01DCh
|
Hardware
|
IRQ 15 - Secondary Hard Disk Controller / General Adapter Use
|
posted on 2006-10-24 13:20
yuhen 阅读(844)
评论(3) 编辑 收藏 引用 所属分类:
技术文档