The CPU has one external interrupt pin[1]. A programmable interrupt controller (PIC) is used to allow multiple external devices to send interrupts to the CPU through this one shared pin. From the wiki:
Does this mean only 15 external interrupts are possible? Can all the devices found in modern PCs/laptops that are external to the CPU really be serviced with just 15 interrupts? For example a laptop might have a speaker, a touchpad, a keyboard, a camera, a wifi card, various USB ports, a HDMI port, a VGA port, an ethernet port, and SD card port, a headphone jack, a bluetooth controller, a magnet sensor, a harddrive etc.In the beginning (IBM PC and XT), only a single 8259 PIC chip was used, which provided 8 IRQs to the system.
...
The IBM PC/AT extended the PC architecture by adding a second 8259 PIC chip...This gives a total of 15 interrupts. Why 15 and not 16? That's because when you cascade chips, the PIC needs to use one of the interrupt lines to signal the other chip.
Also to which interrupt number are the external interrupts configured to? Is the single CPU interrupt pin hardwired to the number 32 (the first available IDT entry following the 31 reserved for internal use by the CPU)? Or is the OS responsible for choosing the number?
For example in xv6, external interrupts are defined as follows:
Code: Select all
#define T_IRQ0 32 // IRQ 0 corresponds to int T_IRQ
#define IRQ_TIMER 0
#define IRQ_KBD 1
#define IRQ_COM1 4
#define IRQ_IDE 14
#define IRQ_ERROR 19
#define IRQ_SPURIOUS 31
[1]: A simple x86 CPU like the 8086