Segmentation Observation: Programmers don’t think in pages! CSCE 410/611 Segmentation Observation: Programmers don’t think in pages! Segmentation Pro-and-Cons of segmentation; external fragmentation Solution: Segmented Paging Segmentation
Segmentation: Problem with Paging CSCE 410/611 Segmentation: Problem with Paging Observation: Users think of memory in terms of segments (data, code, stack, objects, ...) Paging MMU logical memory physical memory Segmentation
Segmentation: Problem with Paging CSCE 410/611 Segmentation: Problem with Paging Observation: Users think of memory in terms of segments (data, code, stack, objects, ...) Segmenting MMU A < + A B < + C B C < + logical memory physical memory Segmentation
Segmentation in Hardware CSCE 410/611 Segmentation in Hardware segment number Segmenting Memory Management Unit CPU <? + s logical addr d offset b s d limit base logical memory segment table physical memory Segmentation
Segmentation: Pros and Cons CSCE 410/611 Segmentation: Pros and Cons Pros: Data in a segment typically semantically related Protection can be associated with segments read/write protection range checks for arrays Data and code sharing Process 1 s d <? + limit base Process 2 base limit + d <? s physical memory Segmentation
Segmentation: Pros and Cons CSCE 410/611 Segmentation: Pros and Cons Pros: Data in a segment typically semantically related Protection can be associated with segments read/write protection range checks for arrays Data and code sharing Cons: External Fragmentation! Process 1 s d <? + limit base new segment Process 2 base limit + d <? s physical memory Segmentation
Segmented Paging CPU s p d f d s p logical memory physical memory CSCE 410/611 Segmented Paging Segmented-Paging Memory Management Unit segment number page nr offset CPU s logical addr p d f d <? s s p limit base frame logical memory segment table segment page table physical memory Segmentation
Segmentation: Summary CSCE 410/611 Segmentation: Summary Programmers like to think in terms of memory segments Segmentation allows for efficient allocation and management of semantically-related data segments Segmentation re-introduces external Fragmentation Segmented Paging eliminates fragmentation Segmentation