Interrupts

August 23, 2018 | 5 Tags | 0 Comment

Interrupts

An interrupt is a signal from a device attached to a computer or from a program indicating an event that needs immediate attention. For instance, when you hit a key on the keyboard, and interrupt is signalled to the CPU. If everything is set up correctly, the CPU will stop the currently running code and call a function that will read port 0x60 (the keyboard’s output port) to find out what the keyboard is sending. Then the function returns to the last running code before the keyboard caused the interrupt.

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

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

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 segment:offset, which represents the address of a routine to be called when the CPU receives an interrupt.

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
Samuel Yang image
Samuel Yang

If you like this tutorial, you can support me

Donate Now

Related Posts