Intel ARCHITECTURE IA-32 User Manual Page 93

  • Download
  • Add to my manuals
  • Print
  • Page
    / 636
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 92
Vol. 3A 3-13
PROTECTED-MODE MEMORY MANAGEMENT
segment limit has the reverse function; the offset can range from the segment
limit to FFFFFFFFH or FFFFH, depending on the setting of the B flag. Offsets
less than the segment limit generate general-protection exceptions. Decreasing
the value in the segment limit field for an expand-down segment allocates new
memory at the bottom of the segment's address space, rather than at the top.
IA-32 architecture stacks always grow downwards, making this mechanism
convenient for expandable stacks.
Base address fields
Defines the location of byte 0 of the segment within the 4-GByte linear address
space. The processor puts together the three base address fields to form a single
32-bit value. Segment base addresses should be aligned to 16-byte boundaries.
Although 16-byte alignment is not required, this alignment allows programs to
maximize performance by aligning code and data on 16-byte boundaries.
Type field Indicates the segment or gate type and specifies the kinds of access that can be
made to the segment and the direction of growth. The interpretation of this field
depends on whether the descriptor type flag specifies an application (code or
data) descriptor or a system descriptor. The encoding of the type field is
different for code, data, and system descriptors (see Figure 4-1). See Section
3.4.5.1, “Code- and Data-Segment Descriptor Types”, for a description of how
this field is used to specify code and data-segment types.
S (descriptor type) flag
Specifies whether the segment descriptor is for a system segment (S flag is
clear) or a code or data segment (S flag is set).
DPL (descriptor privilege level) field
Specifies the privilege level of the segment. The privilege level can range from
0 to 3, with 0 being the most privileged level. The DPL is used to control access
to the segment. See Section 4.5, “Privilege Levels”, for a description of the
relationship of the DPL to the CPL of the executing code segment and the RPL
of a segment selector.
P (segment-present) flag
Indicates whether the segment is present in memory (set) or not present (clear).
If this flag is clear, the processor generates a segment-not-present exception
(#NP) when a segment selector that points to the segment descriptor is loaded
into a segment register. Memory management software can use this flag to
control which segments are actually loaded into physical memory at a given
time. It offers a control in addition to paging for managing virtual memory.
Figure 3-9 shows the format of a segment descriptor when the segment-present
flag is clear. When this flag is clear, the operating system or executive is free
to use the locations marked “Available” to store its own data, such as informa-
tion regarding the whereabouts of the missing segment.
D/B (default operation size/default stack pointer size and/or upper bound) flag
Performs different functions depending on whether the segment descriptor is
an executable code segment, an expand-down data segment, or a stack
Page view 92
1 2 ... 88 89 90 91 92 93 94 95 96 97 98 ... 635 636

Comments to this Manuals

No comments