Local Descriptor Table

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, etc.

The LDT is the sibling of the Global Descriptor Table and similarly defines up to 8191 memory segments accessible to programs.

Past glory

On x86 processors not having paging features, like the Intel 80286, the LDT is essential to implementing separate address spaces for multiple processes. There will be generally one LDT per user process, describing privately held memory, while shared memory and kernel memory will be described by the GDT. The operating system will switch the current LDT when scheduling a new process, using the LLDT machine instruction. On the contrary, the GDT is generally not switched (although this may happen if virtual machine monitors like VMware are running on the computer).

The lack of symmetry between both tables is underlined by the fact that the current LDT can be automatically switched on certain events, notably if TSS-based multitasking is used, while this is not possible for the GDT. The LDT also cannot store certain privileged types of memory segments (eg. TSSes). Finally, the LDT is actually defined by a descriptor inside the GDT, while the GDT is directly defined by a linear address.

Creating shared memory through the GDT has some drawbacks. Notably such memory is visible to every process and with equal rights. In order to restrict visibility and to differentiate the protection of shared memory, for example to only allow read-only access for some processes, one can use separate LDT entries, pointed at the same physical memory areas and only created in the LDTs of processes which have requested access to a given shared memory area.

LDT (and GDT) entries which point to identical memory areas are called "aliases". Aliases are also typically created in order to get write access to code segments: an executable selector cannot be used for writing. (Protected mode programs constructed in the so-called "tiny" memory model where everything is located in the same memory segment must use separate selectors for code and for data/stack and both selectors are technically "aliases" too.) In the case of the GDT, aliases are also created in order to get access to system segments like the TSSes.

Segments have a "Present" flag in their descriptors, so they can be removed from memory if need arises. For example, code segments or unmodified data segments can be thrown away, and modified data segments can be swapped out to disk. This allows to implement virtual memory. However, because entire segments have to be removed, it is better to limit their size. On the other side, using smaller, more easily swappable segments means that segment registers have to be reloaded more frequently, while this is a relatively time-consuming operation.

Fading out

Starting with the Intel 80386 microprocessor, separation between processes can be also achieved by giving them separate physical memory pages at the same virtual addresses. It is also more efficient to implement virtual memory using page-based swapping rather than full segment swapping (such swapping is performed below the segmentation layer, so segments can remain "Present" all the time). Therefore, modern 32-bit x86 operating systems use the LDT very little if they do not run 16-bit code.

On the contrary, running 16-bit code in a 32-bit environment and sharing memory (this happens e.g. when running OS/2 1.x programs on OS/2 2.0 and later) generally means that the LDT has to be fully filled, typically with 64 KiB segments, in such a way that every "flat" address has also a selector in the LDT. This technique is sometimes called "LDT tiling". The limited size of the LDT means the virtual flat address space has to be limited to 512 megabytes (8191 times 64 KiB) - this is what happens on OS/2, although this limitation was fixed in version 4.5. It is also necessary to make sure that objects allocated in the 32-bit environment do not cross 64 KiB boundaries; this generates some address space waste.

If 32-bit code does not have to pass arbitrary memory objects to 16-bit code, e.g. presumably in the OS/2 1.x emulation present in Windows NT or in the Windows 3.1 emulation layer, it is not necessary to artificially limit the size of the 32-bit address space.

64-bit

Because 64-bit code always runs in flat mode with paging and PAE enabled, the concept of the local descriptor table is no more valid.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • 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 …   Wikipedia

  • 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

  • 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

  • Color Layout Descriptor — (CLD) is designed to capture the spatial distribution of color in an image. The feature extraction process consists of two parts; grid based representative color selection and Discrete Cosine Transform with quantization. Color is the most basic… …   Wikipedia

  • LDT — Local Descriptor Table (Computing » General) *** Lightning Data Transport (Computing » Networking) * Left Defensive Tackle (Community » Sports) * Lower Division Transfer (Business » General) * Light Displacement Ton (Governmental »… …   Abbreviations dictionary

  • Abreviations en informatique S — Abréviations en informatique S SAM : chez Microsoft, cette abréviation peut avoir plusieurs significations : SAMple : extensions de fichier pour les fichiers d exemple : hosts.sam, lmhosts.sam… Security Account Manager… …   Wikipédia en Français

  • Abréviations En Informatique S — SAM : chez Microsoft, cette abréviation peut avoir plusieurs significations : SAMple : extensions de fichier pour les fichiers d exemple : hosts.sam, lmhosts.sam… Security Account Manager Software Asset Manager (logiciel d… …   Wikipédia en Français

  • Abréviations en informatique S — SAM : chez Microsoft, cette abréviation peut avoir plusieurs significations : SAMple : extensions de fichier pour les fichiers d exemple : hosts.sam, lmhosts.sam… Security Account Manager Software Asset Manager (logiciel d… …   Wikipédia en Français

  • Abréviations en informatique s — SAM : chez Microsoft, cette abréviation peut avoir plusieurs significations : SAMple : extensions de fichier pour les fichiers d exemple : hosts.sam, lmhosts.sam… Security Account Manager Software Asset Manager (logiciel d… …   Wikipédia en Français

Share the article and excerpts

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