9.4 Interrupt Descriptor Table

中断描述符表

The interrupt descriptor table (IDT) associates each interrupt or exception identifier with a descriptor for the instructions that service the associated event. Like the GDT and LDTs, the IDT is an array of 8-byte descriptors. Unlike the GDT and LDTs, the first entry of the IDT may contain a descriptor. To form an index into the IDT, the processor multiplies the interrupt or exception identifier by eight. Because there are only 256 identifiers, the IDT need not contain more than 256 descriptors. It can contain fewer than 256 entries; entries are required only for interrupt identifiers that are actually used.

中断描述符表(IDT)将每个中断或异常标识与指向服务相关事件的指令描述符联系起来。就象GDT和LDT一样,IDT是一个8字节的描述符数组。但与GDT和LDT不同的是,IDT的第一个项包含一个描述符。处理器将中断或异常的标识乘以8来取得IDT的索引。因为仅有256个标识符,IDT不需要包含多于256个描述符。可以包含少于256个项;仅那些被实际使用到的中断标识需要相对应的项。

The IDT may reside anywhere in physical memory. As Figure 9-1 shows, the processor locates the IDT by means of the IDT register (IDTR). The instructions LIDT and SIDT operate on the IDTR. Both instructions have one explicit operand: the address in memory of a 6-byte area. Figure 9-2 shows the format of this area.

IDT可以放在物理内存的任何地方。正如图9-1所示,处理器通过IDT寄存器(IDTR)的数值来定位IDT。指令LIDT和SIDT操作IDTR。两个指令都有一个明确的操作数:一个6字节的内存区域作为地址。图9-2展示了内存区域的格式。

【译】x86程序员手册32-9.4 中断描述符表-LMLPHP

【译】x86程序员手册32-9.4 中断描述符表-LMLPHP

LIDT (Load IDT register) loads the IDT register with the linear base address and limit values contained in the memory operand. This instruction can be executed only when the CPL is zero. It is normally used by the initialization logic of an operating system when creating an IDT. An operating system may also use it to change from one IDT to another.

LIDT(装入IDT寄存器)将内存操作数装入IDT寄存器,基内包含一个线性地址和限长值。这个指令仅当CPL为0时被执行。操作系统通常在初始化中创建一个IDT后使用该指令。操作系统也可以用它将IDT修改成另一个。

SIDT (Store IDT register) copies the base and limit value stored in IDTR to a memory location. This instruction can be executed at any privilege level.

SIDT(保存IDT寄存器内容)拷贝存储在IDTR中的基址和限长值保存到内存中。这条指令可以在任何特权级别上执行。

9.5 IDT Descriptors 中断描述符

The IDT may contain any of three kinds of descriptor:

IDT表可以包含以下三种描述符

  • Task gates  任务门
  • Interrupt gates 中断门
  • Trap gates 陷阱门

Figure 9-3 illustrates the format of task gates and 80386 interrupt gates and trap gates. (The task gate in an IDT is the same as the task gate already discussed inChapter 7.)

图9-3解释了任务门、中断门及陷阱门的格式。(IDT中的任务门与第7章中讨论过的任务门相同。)

【译】x86程序员手册32-9.4 中断描述符表-LMLPHP

05-22 06:07