
2-16
PRELIMINARY
System Register Set
Advanci ng the S tandar ds
2.4.2
Descriptor Table
Registers and Descriptors
Descriptor Table Registers
The Global, Interrupt, and Local Descriptor
Table Registers (GDTR, IDTR and LDTR), shown
in Figure 2-7, are used to specify the location of
the data structures that control segmented
memory management. The GDTR, IDTR and
LDTR are loaded using the LGDT, LIDT and
LLDT instructions, respectively. The values of
these registers are stored using the correspond-
ing store instructions. The GDTR and IDTR
load instructions are privileged instructions
when operating in protected mode. The LDTR
can only be accessed in protected mode.
The Global Descriptor Table Register (GDTR)
holds a 32-bit linear base address and 16-bit
limit for the Global Descriptor Table (GDT).
The GDT is an array of up to 8192 8-byte
descriptors. When a segment register is loaded
from memory, the TI bit in the segment selector
chooses either the GDT or the Local Descriptor
Table (LDT) to locate a descriptor. If TI = 0, the
index portion of the selector is used to locate the
descriptor within the GDT table. The contents
of the GDTR are completely visible to the pro-
grammer by using a SGDT instruction. The first
descriptor in the GDT (location 0) is not used by
the CPU and is referred to as the “null descrip-
tor”. The GDTR is initialized using a LGDT
instruction.
The Interrupt Descriptor Table Register
(IDTR) holds a 32-bit linear base address and
16-bit limit for the Interrupt Descriptor Table
(IDT). The IDT is an array of 256 interrupt
descriptors, each of which is used to point to an
interrupt service routine. Every interrupt that
may occur in the system must have an associ-
ated entry in the IDT. The contents of the IDTR
are completely visible to the programmer by
using a SIDT instruction. The IDTR is initialized
using the LIDT instruction.
The Local Descriptor Table Register (LDTR)
holds a 16-bit selector for the Local Descriptor
Table (LDT). The LDT is an array of up to 8192
8-byte descriptors. When the LDTR is loaded,
the LDTR selector indexes an LDT descriptor
that resides in the Global Descriptor Table
(GDT). The base address and limit are loaded
automatically and cached from the LDT descrip-
tor within the GDT.
Figure 2-7.
Descriptor Table Registers
1708003
BASE ADDRESS
LIMIT
SELECTOR
47
16 15
0
LDTR
IDTR
GDTR
BASE ADDRESS
LIMIT