7-20 Vol. 3
TASK MANAGEMENT
and the page tables point to different pages of physical memory, then the tasks do
not share physical addresses.
With either method of mapping task linear address spaces, the TSSs for all tasks
must lie in a shared area of the physical space, which is accessible to all tasks. This
mapping is required so that the mapping of TSS addresses does not change while the
processor is reading and updating the TSSs during a task switch. The linear address
space mapped by the GDT also should be mapped to a shared area of the physical
space; otherwise, the purpose of the GDT is defeated.
Figure 7-9 shows how the
linear address spaces of two tasks can overlap in the physical space by sharing page
tables.
7.5.2 Task Logical Address Space
To allow the sharing of data among tasks, use the following techniques to create
shared logical-to-physical address-space mappings for data segments:
• Through the segment descriptors in the GDT — All tasks must have access
to the segment descriptors in the GDT. If some segment descriptors in the GDT
point to segments in the linear-address space that are mapped into an area of the
physical-address space common to all tasks, then all tasks can share the data
and code in those segments.
• Through a shared LDT — Two or more tasks can use the same LDT if the LDT
fields in their TSSs point to the same LDT. If some segment descriptors in a
Figure 7-9. Overlapping Linear-to-Physical Mappings
Task A
TSS
PDE
Page Directories
PDE
PTE
PTE
PTE
PTE
PTE
Page Tables
Page Frames
Task A
Task A
Shared
Shared
Task B
Task B
Shared PT
PTE
PTE
PDE
PDE
PDBR
PDBR
Task A TSS
Task B TSS