Presentation is loading. Please wait.

Presentation is loading. Please wait.

Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich.

Similar presentations


Presentation on theme: "Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich."— Presentation transcript:

1 Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich

2 Segmentation A program can be divided into segments Segments are of variable size Segments reflect the logical (modular) structure of a program Text segment, data segment, stack segment… Similar to dynamic partitioning except segments of the same process can be scattered subject to external fragmentation

3 Address translation Maximum segment size is always a power of 2 Process’ segment table maps segment numbers into their base addresses in the memory With the maximum segment size of 2 r, a logical address of l+r bits is interpreted as a pair (l,r): –l = segment number, r = offset within the segment l is used as an index into the segment table

4 Hardware support Base + d ProgramSegmentationMain Memory Virtual Address Register Segment Table Segment d S# Length Base Seg Table Ptr Seg #Offset = d Segment Table + +

5 Segmentation Properties Advantages: –Association of protection with the segments –Sharing of code or data Problems: –Dynamic memory allocation with external fragmentation

6 Segmentation with paging Segmentation –simplifies protection and sharing, enforce modularity, but prone to external fragmentation Paging –transparent, eliminates ext. fragmentation, allows for sophisticated memory management Segmentation and paging can be combined

7 Address translation Main Memory Page Frame Offset Paging Page Table P# + Frame #Offset Seg Table Ptr + S # SegmentationProgram Segment Table Seg #Page #Offset

8 Remarks The price of paging/segmentation is a sophisticated hardware But the advantages exceed by far Paging decouples address translation and memory allocation –Not all the logical addresses are necessary mapped into physical memory at every given moment - virtual memory Paging and segmentation are often combined to benefit from both worlds


Download ppt "Memory Management Operating Systems - Spring 2003 Gregory (Grisha) Chokler Ittai Abraham Zinovi Rabinovich."

Similar presentations


Ads by Google