Pure Segmentation
Pure Segmentation
Several address spaces per process a compiler needs segments for -source text
-parse tree
-compiler executable code
In pure segmentation architecture,segments are allocate like variable partitions, although the memory management hardware is involved in decoding addresses.
Pure segmentation addresses replace the page identifier in the virtual address with a segment identifier, and find the proper segment (not page) to which to apply the offset.
Segment Table
Hardware of Segmentation
Advantages: o Growing and shrinking independently o Sharing between processes simpler o Linking is easier o Protection easier Disadvantages: o Crude partition (each segment can be very large or very small) o Pure segmentation --> external Fragmentation revisited
Segmentation Architecture
Logical address composed of the pair <segment-number, offset> Segment table maps to linear address space; each table entry has:
o base contains the starting linear address where the segment resides in memory o limit specifies the length of the segment
Segment-table base register (STBR) points to the segment tables location in memory Segment-table length register (STLR) indicates number of segments used by a program; segment number s is legal if s < STLR
Protection: each segment table entry contains: o validation bit = 0 illegal segment o read/write/execute privileges Protection bits associated with segments; code sharing occurs at segment level Since segments vary in length, memory allocation is a dynamic storage-allocation problem (external fragmentation problem)
Sharing of segments