Intel 80287, 80286 manual Expand-Down Data Segments, Expand-Down Segment

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 190
Image 190

ADVANCED TOPICS

Inter-segment Returns that refer to conforming code segments use the RPL field of the code selector of the return address to determine the new CPL. The RPL becomes the new CPL if the conforming code segment DPL::5RPL.

If a conforming segment is readable, it can be read from any privilege level without restriction. This is the only exception to the protection rules. This allows constants to be stored with conforming code. For example, a read-only look-up table can be embedded in a conforming code segment that can be used to convert system-wide logical ID's into character strings that represent those logical entities.

11.2.2 Expand-Down Data Segments

\

If bit 2 in the a~cess byte of a data segment is 1, the segment is an expand-down segment: All the offsets that reference such a segment must be strictly greater than the segment limit, as opposed to normal data segments (bit 2=0) where all offsets must be less than or equal to the segment limit. Figure 11-1 shows an expand-down segment.

The size of the expand down segment can be changed by changing either the base or the limit. An expand down segment with Limit=O will have a size of 216 -1bytes. With a limit value of FFFFH, the expand down segment will have a size of 0 bytes. In an expand down segment, the base + offset value should always be greater than the base + limit value. Therefore, a full size segment (2i6 bytes) can only be obtained by using an expand up segment.

The operating system should check the Expand-Down bit when a protection fault indicates that the limit of a data segment has been reached. If the Expand-Down bit is not set, the operating system should increase the segment limit; if it is set, the limit should be lowered. This supplies more room in either case (assuming the segment is not write-protected, i.e., that bit 1 is not 0). In some cases, if the operating system can ascertain that there is not enough room to expand the data segment to meet the need that caused the fault, it can move the data segment to a region of memory where there is enough

room. See figure 11-2.

.

BASE + FFFEH -~===d

BASE + OFFSET

1

EXPAND DOWN

> BASE + LIMIT

SEGMENT

BASE + LIMIT -~f'~=:=tJ

G30108

Figure 11-1. Expand-Down Segment

11-2

Page 190
Image 190
Intel 80287, 80286 manual Expand-Down Data Segments, Expand-Down Segment