中斷描述符表(Interrupt Descriptor Table,IDT)將每個異常或中斷向量分別與它們的處理過程聯繫起來,IDT也是由8字節長描述符組成的一個數組。
IDT表可以存放在線性地址空間的任何地址,處理器使用IDTR寄存器來定位IDT表的位置。
IDTR寄存器中含有32位的基地址和16位的長度值。
LIDT和SIDT指令分別用於加載和保存IDTR寄存器的內容。
The x86 allows up to 256 different interrupt or exception entry points into the kernel, each with a different interrupt vector.A vector is a number between 0 and 255. An interrupt's vector is determined by the source of the interrupt: different devices, error conditions, and application requests to the kernel generate interrupts with different vectors. The CPU uses the vector as an index into the processor's interrupt descriptor table (IDT), which the kernel sets up in kernel-private memory, much like the GDT. From the appropriate entry in this table the processor loads:
- the value to load into the instruction pointer (EIP) register, pointing to the kernel code designated to handle that type of exception.
- the value to load into the code segment (CS) register, which includes in bits 0-1 the privilege level at which the exception handler is to run.
中斷描述符表和中斷向量表的區別聯繫
在保護模式下,中斷向量表中的表項由8個字節組成,根據中斷號可以索引其在中斷向量表中的位置,在該模式下,中斷向量表也可稱爲中斷描述符表IDT.
表中的每個entry稱爲一個門描述(gate descriptor) ,通過它進入相應的處理程序。
中斷門(interrupt gate)分類: