本文将mark下IRQs相关notes。

An interrupt request (IRQ) is a hardware signal sent to the processor instructing it to suspend its current activity and handle some external event, such as a keyboard input or a mouse movement. In x86 based computer systems, IRQs are numbered from 0 to 15. Newer computers, including x86-64 systems, provide more than these 16 interrupts (usually 24). Some interrupts are reserved for specific purposes, such as the keyboard and the real-time clock; others have common uses but may be reassigned; and some are left available for extra devices that may be added to the system.

Here is a list of the IRQs and their common purposes in the x86 system:

In Linux, IRQ mappings are stored in the /proc/interrupts file:

In the picture above, you can see the names of the drivers that are using each IRQ. For example, the keyborad is using IRQ 1, the mouse is using IRQ 12.

File ‘/proc/interrupts’ is the procfs Linux interface to the interrupt subsystem, and it presents a table about the number of interrupts on every CPU core in the system in the following form:

  • First column: interrupt number
  • CPUx columns: interrupt counters for every CPU core in the system
  • Next column: interrupt type:
    • IO-APIC-edge — edge-triggered interrupt for the I/O APIC controller
    • IO-APIC-fasteoi — level-triggered interrupt for the I/O APIC controller
    • PCI-MSI-edge — MSI interrupt
    • XT-PIC-XT-PIC — interrupt for the PIC controller
  • Last column: device (driver) associated with this interrupt

参考资料:

  1. IRQ (Interrupt Request)
  2. Interrupt Request Lines (IRQs) by Stephen Bucaro
  3. External Interrupts in the x86 system. Part 2. Linux kernel boot options