Global Descriptor Table

Global Descriptor Table

The Global Descriptor Table or "GDT" is a data structure used by Intel x86-family processors starting with the 80286 in order to define the characteristics of the various memory areas used during program execution, for example the base address, the size and access privileges like executability and writability. These memory areas are called "segments" in Intel terminology.

The "GDT" can hold things other than segment descriptors as well. Every 8-byte entry in the "GDT" is a descriptor, but these can be Task State Segment (or TSS) descriptors, Local Descriptor Table (LDT) descriptors, or Call Gate descriptors. The last one, Call Gates, are particularly important for transferring control between x86 privilege levels although this mechanism is not used on most modern operating systems.

There is also an LDT or "Local Descriptor Table". The LDT is supposed to contain memory segments which are private to a specific program, while the GDT is supposed to contain global segments. The x86 processors contain facilities for automatically switching the current LDT on specific machine events, but no facilities for automatically switching the GDT.

Every memory access which a program can perform always goes through a segment. On 386 and later, because of 32-bit segment offsets and limits, it is however often possible to make segments cover the entire addressable memory, giving the illusion that there are no segments.

In order to reference a segment a program must use its index inside the GDT or the LDT. Such an index is called a "segment selector" or "selector" in short. The selector must generally be loaded into a "segment register" to be used. Apart from the machine instructions which allow one to set/get the position of the GDT (and of the Interrupt Descriptor Table) in memory, every machine instruction referencing memory has an implicit Segment Register, occasionally two. Most of the time this Segment Register can be overridden by adding a Segment Prefix before the instruction.

Loading a selector into a segment register automatically reads the GDT or the LDT and storesthe properties of the segment inside the processor itself. Subsequent modifications to the GDTor LDT will not be effective unless the segment register is reloaded.

GDT in 64-bit

The GDT in 64-bit is still valid. The size of the register has been extended from 48 to 80 bits, and 64-bit selectors are always "flat" unlimited (thus, from 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF)..

See also

* Local Descriptor Table

External links

* [http://download.intel.com/design/PentiumII/manuals/24319202.pdf Intel Architecture Software Developer's Manual Volume 3: System Programming]
* [http://www.osdever.net/bkerndev/Docs/gdt.htm GDT Tutorial]

Footnotes

The entire content of this article (accurate as of 04/10/2007) can be verified using section 2-14 to 2-16 of the "IA-32 Intel(R) Architecture Software Developer's Manual, Volume 3A: System Programming Guide Part 1". This is available from the Intel(R) website as a PDF. It can also be ordered (accurate at the time of writing) for free from the Intel(R) website, either on CD or in a series of books. See citation links at base of main article.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Global Descriptor Table — La Table globale de descripteurs ( GDT : Global Descriptor Table en anglais ) est une structure de données utilisée par les processeurs de la famille x86 (le premier à l avoir utilisée est le Intel 80286) pour référencer les descripteurs de… …   Wikipédia en Français

  • Global Descriptor Table — Die Global Descriptor Table ist eine Tabelle, die von Intels Protected Mode verwendet wird, um den Speicher, Multitasking, und verschiedene Gates zu verwalten. In ihr haben maximal 8192 Deskriptoren zu je acht Bytes Platz. In der GDT können… …   Deutsch Wikipedia

  • Local Descriptor Table — The Local Descriptor Table (LDT) is a memory table used in the x86 architecture in protected mode and containing memory segment descriptors: start in linear memory, size, executability, writability, access privilege, actual presence in memory,… …   Wikipedia

  • Table globale de descripteurs — Global Descriptor Table La Table globale de descripteurs ( GDT : Global Descriptor Table en anglais ) est une structure de données utilisée par les processeurs de la famille x86 (le premier à l avoir utilisée est le Intel 80286) pour… …   Wikipédia en Français

  • Segment descriptor — In memory addressing for Intel x86 computer architectures, segment descriptors are a part of the segmentation unit, used for translating a logical address to linear address. Segment descriptors describe the memory segment referred in the logical… …   Wikipedia

  • File Allocation Table — For other uses, see Fat (disambiguation). FAT Developer Microsoft Full Name File Allocation Table FAT12 (12‑bit version) FAT16/FAT16B (16‑bit versions) FAT32 (32‑bit version with 28 bits used) Introduced …   Wikipedia

  • GDTR — Global Descriptor Table Register (Computing » General) …   Abbreviations dictionary

  • GDT — • Global Descriptor Table • Grand Turk, British West Indies internationale Flughafen Kennung …   Acronyms

  • GDTRC — Global Descriptor Table Register Cache …   Acronyms

  • GDTRC — Global Descriptor Table Register Cache …   Acronyms von A bis Z

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”