History
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 (e.g. 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 data/stack, making both selectors technically "aliases" as well.) 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, allowing them to be removed from memory if the need arises. For example, code segments or unmodified data segments can be thrown away, and modified data segments can be swapped out to disk. However, because entire segments need to be operated on as a unit, it is necessary to limit their size in order to ensure that swapping can happen in a timely fashion. However, using smaller, more easily swappable segments means that segment registers must be reloaded more frequently which is itself a time-consuming operation.
Read more about this topic: Local Descriptor Table
Famous quotes containing the word history:
“... that there is no other way,
That the history of creation proceeds according to
Stringent laws, and that things
Do get done in this way, but never the things
We set out to accomplish and wanted so desperately
To see come into being.”
—John Ashbery (b. 1927)
“I believe that in the history of art and of thought there has always been at every living moment of culture a will to renewal. This is not the prerogative of the last decade only. All history is nothing but a succession of crisesMof rupture, repudiation and resistance.... When there is no crisis, there is stagnation, petrification and death. All thought, all art is aggressive.”
—Eugène Ionesco (b. 1912)
“Boys forget what their country means by just reading the land of the free in history books. Then they get to be men, they forget even more. Libertys too precious a thing to be buried in books.”
—Sidney Buchman (19021975)