What it is: A table used by the CPU to map interrupt/exception numbers to their corresponding handlers (ISRs). Setup: The kernel initializes the IDT during boot. Each entry contains:

  • Address of the ISR (Interrupt Service Routine).
  • Privilege level (kernel/user).
  • Type (trap, interrupt gate, etc.). CPU Interaction: The CPU uses the IDTR register (set via lidt instruction) to locate the IDT. When an interrupt occurs, the CPU indexes into the IDT using the interrupt vector number to find the ISR.