An IRQ (Interrupt ReQuest line)

Primary tabs

introduction

An IRQ (Interrupt ReQuest line) is a hardware line - a bit of wire on the motherboard. Hardware, such as I/O devices, keyboards, and disk drives, can use IRQs to interrupt the CPU, to get its attention.

When the device wants something it turns on its IRQ. The OS then takes care of whatever the device wants. The OS finally turns off the IRQ.

what it is

An IBM PC has a woefully inadequate quantity of IRQs. There are 16, numbered 0 to 15.

Most IRQs are used up, and a few are free. The BIOS makes a list of IRQs and then dishes them out to devices that need IRQs. The OS can either use this list or make its own. The Linux kernel ignores the BIOS and makes up its own list.

issalarg@ifw01:~$ cat /proc/interrupts
           CPU0
  0:    2089470          XT-PIC  timer
  1:         10          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  5:          1          XT-PIC  parport0
  6:          5          XT-PIC  floppy
  7:        128          XT-PIC  eth3
  8:          1          XT-PIC  rtc
  9:        127          XT-PIC  acpi, eth2
 10:       3737          XT-PIC  eth1
 11:       4175          XT-PIC  uhci_hcd:usb1, eth0
 12:        812          XT-PIC  i8042
 14:      22516          XT-PIC  ide0
 15:      71485          XT-PIC  ide1
NMI:          0
LOC:          0
ERR:          0
MIS:          0
issalarg@ifw01:~$

The lack of free IRQs creates problems for adding four NICs to an old IBM PC. The first three cards get IRQ5, IRQ10, and IRQ11. None are left over for the fourth card. Luckily, a BIOS usually lets the user borrow an IRQ from a device he is not using, such as a parallel port.

IBM PC IRQs (from http://www.debianhelp.co.uk/infrastructure/hardware)
IRQ description example
0 timer output (8254)
1 keyboard controller  
2 cascade to IRQ8–IRQ15 on PC-AT  
3 secondary serial port (io-port=0x2F8) (/dev/ttyS1)
4 primary serial port (io-port=0x3F8) (/dev/ttyS0)
5 free, often used by a sound card soundblaster (SB16: io-port=0x220, DMA-low=1, DMA-high=5)
6 floppy disk controller (io-port=0x3F0) (/dev/fd0, /dev/fd1)
7 parallel port (io-port=0x378) (/dev/lp0)
8 RTC (Real Time Clock)  
9 software interrupt (int 0x0A), redirect to IRQ2  
10 free, often used by a network card (NE2000: io-port=0x300)
11 free, often used by a sound card soundblaster (SB16-SCSI: io-port=0x340, SB16-IDE: io-port=0x1E8,0x3EE)
12 PS/2 mouse  
13 free, was 80287 math coprocessor  
14 primary IDE controller (/dev/hda, /dev/hdb)
15 secondary IDE controller (/dev/hdc, /dev/hdd)

 

what it isn't

 

where it is

history