Combined Paging and Segmentation

By: Jesse Miller

Both paging and segmentation have their strengths. Paging, which is transparent to the programmer, eliminates external fragmentation and thus provides efficient use of main memory. Pieces that are moved in and out of main memory are of fixed equal size, it is possible to develop sophisticated memory-management algorithms that exploit the behavior of programs.

Segmentation is visible to the programmer and has the ability to handle growing data structures, modularity, and support for sharing and protection. To combine the advantages of both, some systems are equipped with processor hardware and operating system software to provide both.

In a combined paging/segmentation system a user address space is broken up into a number of segments at the discretion of the programmer. Each segment is in turn broken up into a number of fixed-size pages which are equal in length to a main memory frame. If a segment is less than a page in length, the segment occupies just one page. From the programmer`s point of view, a logical address still consists of a segment number and a segment offset. From the system`s point of view, the segment offset is viewed as a page number and page offset for a page within the specified segment.

Associated with each process are segment tables and number of page tables, one per process segment. When a particular process is running, a register holds the starting address of the segment table for that process. Presented with a virtual address, the processor uses the segment number portion to index into the process segment table to find the page table for that segment. Then, the page number portion of the virtual address is used to index the page table and look up the corresponding frame number. This combined with the offset portion of the virtual address to produce the desired real address.

The segment table entry contains the length of the segment. It also contains a base field, which now refers to a page table. The present and modified bits are not needed because these matters are handled at the page level. Other control bits may be used for purposes of sharing and protection. The page table entry is essentially the same as that used in a pure paging system. Each page number is mapped onto a corresponding frame number if the page is present in main memory.

Computers
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 
 • 

» More on Computers
 



Share this article :
Click to see more related articles