Segmentation
Users prefer to
view memory as a collection of variable size segments, with no necessary
ordering among segments.
Memory segmentation supports
this view by providing addresses with a segment number (mapped to a segment
base address) and an offset from the beginning of that segment. Each segment
has a name and a length. The addresses specify both the segment name and the
offset within the segment. For simplicity of implementation, segments are
numbered and are referred to by a segment number, rather than name. Thus,
logical address consists of a two tuple: <Segment-number,
offset>.
Segmentation
Hardware
A segment
table maps segment-offset addresses to physical addresses, and
simultaneously checks for invalid addresses. Each entry in segment table has a
segment base and a segment limit. The segment base contains the starting
physical address and the segment limit specifies the length of the segment.
A logical
address consists of two parts: a segment number‘s’ and an offset into that segment‘d’.
The segment number is used as an index to the segment table. The offset‘d’ must
be between 0 and segment limit, if it is not a trap to OS is sent. When an
offset is legal, it is added to the segment base to produce the address in
physical memory of the desired byte.
No comments:
Post a Comment