Hardware Reference
In-Depth Information
FIGURE B.26 The IA-32 segment descriptors are distinguished by bits in the attributes
field . Base, limit, present, readable , and writable are all self-explanatory. D gives the default
addressing size of the instructions: 16 bits or 32 bits. G gives the granularity of the segment
limit: 0 means in bytes and 1 means in 4 KB pages. G is set to 1 when paging is turned on to
set the size of the page tables. DPL means descriptor privilege level —this is checked against
the code privilege level to see if the access will be allowed. Conforming says the code takes
on the privilege level of the code being called rather than the privilege level of the caller; it is
used for library routines. The expand-down field flips the check to let the base field be the
high-water mark and the limit field be the low-water mark. As you might expect, this is used for
stack segments that grow down. Word count controls the number of words copied from the
current stack to the new stack on a call gate. The other two fields of the call gate descriptor,
destination selector and destination offset , select the descriptor of the destination of the call
and the offset into it, respectively. There are many more than these three segment descriptors
in the IA-32 protection model.
IA-32 provides an optional paging system in addition to this segmented addressing. The up-
per portion of the 32-bit address selects the segment descriptor, and the middle portion is an
index into the page table selected by the descriptor. We describe below the protection system
that does not rely on paging.
Adding Sharing and Protection
To provide for protected sharing, half of the address space is shared by all processes and half
is unique to each process, called global address space and local address space , respectively. Each
half is given a descriptor table with the appropriate name. A descriptor pointing to a shared
segment is placed in the global descriptor table, while a descriptor for a private segment is
placed in the local descriptor table.
 
Search WWH ::




Custom Search