Skip to content

Segmented Paging Memory Management

Segment-page storage management combines the advantages of segment storage management and paging storage management, adapting to different needs while overcoming some limitations of a single management method.

Concepts and advantages

  • Segment storage management: Supports user programming needs and divides the program into multiple logical segments, each of which has independent meaning, such as main program, subroutine, data, etc. However, segment storage management requires each segment to occupy a continuous area of ​​main memory, which may cause memory fragmentation problems in practice.
  • Paging storage management: Divides the memory into pages of the same size, solving the memory fragmentation problem, but it ignores the logical structure of the program.
  • Segment-page storage management: Combines the advantages of both. It allows users to organize programs in segments, but each segment is divided into multiple pages, so that the segments do not have to be continuous in physical memory. This can not only maintain the logical clarity of segment storage, but also enjoy the convenience of paging management in memory allocation.

  • The logical address format of segment-page storage management is as follows:

Logical address format

In segment-page storage management, the logical address is divided into three parts:

  • Segment number (S): specifies the segment corresponding to the logical address.

  • Page number (P): specifies the page within the segment.

  • In-page address (W): specifies the specific address in the page.

Segment table and page table

  • The main memory image table of each job includes a segment table and multiple page tables.

  • The segment table contains the starting address and length of the page table of each segment.

  • Each page table contains the correspondence between the logical page number of each page in the segment and the main memory physical block number.

Address conversion process

  • Segment table query: First, access the segment table according to the segment number in the logical address to find the page table starting address of the segment.
  • Page table query: Then query the corresponding page table according to the page number in the logical address to obtain the physical block number of the page.
  • Physical address calculation: Finally, combine the in-page address to get the final physical address.

Number of main memory accesses

In segment-page storage management, three main memory accesses are required:

  • The first access to the segment table to obtain the starting address of the page table;
  • The second access to the page table to obtain the physical block number of the page;
  • The third time, the physical address is calculated through the in-page address and the information is accessed.

Address out-of-bounds detection

  • If the segment number exceeds the maximum value of the segment table, or the page number exceeds the page table range of the corresponding segment, the system will generate an address out-of-bounds program interrupt.