An interrupt vector table (IVT) is a table in memory that maps interrupt numbers to handler addresses, so that the processor knows exactly which code to run when a hardware interrupt, exception or software trap occurs. In the area of drivers & devices, it is the first link in the chain that connects a device signal to the interrupt service routine inside a driver.
Each entry is called a vector, and the index of the entry is the vector number. The term originates from the fixed table of the original Intel 8086, but it is widely used for the equivalent structure on any architecture, including the Interrupt Descriptor Table on modern x86 processors and the vector tables of ARM cores.
How the processor uses the interrupt vector table
When an interrupt arrives, the processor performs a hardware-defined dispatch sequence without any help from software. It finishes or abandons the current instruction, saves the minimal state needed to resume, obtains the vector number, reads the matching table entry and jumps to the stored handler address, usually after switching to a privileged mode.
The vector number comes from different sources depending on the event. Exceptions such as division by zero or a page fault have fixed numbers defined by the architecture, software traps carry the number in the instruction itself, and external device interrupts receive their number from an interrupt controller such as the APIC on x86 or the GIC on ARM.
The following table shows where the vector number originates for each class of event.
| Event class | Example | Source of the vector number |
|---|---|---|
| Processor exception | Page fault, invalid opcode | Fixed by the CPU architecture |
| Software interrupt or trap | int 0x80, svc | Encoded in the instruction |
| External device interrupt | Network card, disk controller | Programmed into the interrupt controller |
| Message signaled interrupt | PCI Express device | Written in the message data by the device |
| Inter-processor interrupt | TLB shootdown, reschedule | Chosen by the sending kernel |
Real-mode IVT versus protected-mode IDT
On x86, the term has a narrow historical meaning and a broader general one. The original real-mode IVT is a fixed array at physical address 0x00000 to 0x003FF, holding 256 entries of 4 bytes, each a segment and offset pair. BIOS services such as int 0x10 for video and int 0x13 for disk access relied on it.
Protected-mode and 64-bit x86 systems replace it with the Interrupt Descriptor Table (IDT), whose location is set by the lidt instruction and whose entries also carry privilege levels and stack-switching information. The comparison below summarizes the differences.
| Property | Real-mode IVT | 64-bit IDT |
|---|---|---|
| Location | Fixed at address 0 | Anywhere, set by lidt |
| Entry size | 4 bytes | 16 bytes |
| Number of entries | 256 | 256 |
| Entry contents | Segment and offset only | Handler address, privilege, gate type, stack index |
| Access control | None | Descriptor privilege level per gate |
| Typical users | BIOS, DOS, boot code | Windows, Linux, macOS kernels |
Vector tables on other architectures
The idea of a lookup table for interrupt entry points appears on nearly every processor family, but its layout varies. Some designs store addresses, while others store short blocks of executable code at fixed offsets.
The table below compares common implementations that operating system and firmware developers encounter.
| Architecture | Table form | Location control | Notes |
|---|---|---|---|
| ARMv8-A (AArch64) | 16 code slots of 128 bytes | VBAR_ELx register per exception level | Slots split by exception type and origin |
| ARM Cortex-M | Array of handler addresses | VTOR register | Entry 0 holds the initial stack pointer |
| RISC-V | Single handler or vectored jumps | mtvec and stvec registers | Mode bit selects direct or vectored |
| x86-64 | Array of 16-byte gate descriptors | IDTR register | Called IDT rather than IVT |
How drivers connect to the vector table
Device drivers in modern operating systems never write vector table entries directly. The kernel owns the table and installs small, generic entry stubs in every slot; a driver then registers its handler through an API such as request_irq() on Linux or IoConnectInterrupt and the newer IoConnectInterruptEx on Windows.
When the interrupt fires, the stub saves registers, identifies the interrupt line and calls every handler registered for it, which allows shared interrupt lines among several devices. This two-level design keeps the table under kernel control and lets the kernel add accounting, interrupt latency measurement and deferred processing in one place.
- Top half: the short handler reached from the vector, which acknowledges the device and schedules further work.
- Bottom half: deferred work such as softirqs, tasklets, workqueues or Windows DPCs that runs with interrupts enabled.
- MSI and MSI-X: give each device queue its own vector, reducing the need to share lines.
Security and reliability risks
Because every interrupt passes through it, the vector table is a high-value target for attackers and a frequent cause of hard-to-diagnose crashes. Rootkits once hooked IDT entries to intercept system calls, which led Windows to protect the table with Kernel Patch Protection on 64-bit editions. Modern kernels also map the table read-only after initialization, and hypervisor-based protections can block any later change to the table base register.
The table below lists typical failures and the defenses that kernel developers apply against them.
| Problem | Effect | Mitigation |
|---|---|---|
| Overwritten entry | Jump to attacker code or crash | Read-only mapping and integrity checks |
| Missing handler for a vector | Double fault or triple fault reset | Install default handlers for all entries |
| Exhausted vectors on large systems | Devices cannot receive interrupts | Per-CPU tables and MSI-X allocation |
| Wrong table base after boot | Immediate system hang | Set the base register early in startup |
The simple explanation
An interrupt vector table is like the emergency contact list on a hospital wall. When an alarm goes off, the staff do not search for help; they look up the alarm number and call the listed person at once.
The processor does the same thing. Each kind of interruption has a number, and the table tells the processor exactly which piece of code to run for that number, without any delay or guesswork.
How it is used in practice
An embedded engineer builds firmware for a motor controller based on an ARM Cortex-M4 microcontroller. The linker places the vector table at the start of flash memory: entry 0 holds the initial stack pointer, entry 1 the reset handler, and further entries point to handlers for the timer, the UART and an encoder input.
To support field updates, the engineer adds a bootloader that occupies the first 32 KiB of flash. After verifying the application image, the bootloader writes the application’s table address into the VTOR register and jumps to its reset handler. From then on, every timer tick reaches the application’s own handler, and firmware updates no longer require a programmer cable.