Lec 21 Memory Management Part 3
Lec 21 Memory Management Part 3
SYSTEM: CSET209
Multilevel paging
Segmentation
CONTENT
Segmented paging
S
MULTILEVEL PAGING
Multilevel paging is a paging scheme where there exists a hierarchy of page tables.
The need for multilevel paging arises when-
The size of page table is greater than the frame size.
As a result, the page table can not be stored in a single frame in main memory.
S
MULTILEVEL PAGING:
S
The page table having size greater than the frame size is divided into several parts.
The size of each part is same as frame size except possibly the last part.
The pages of page table are then stored in different frames of the main memory.
To keep track of the frames storing the pages of the divided page table, another page table is
maintained.
As a result, the hierarchy of page tables get generated.
Multilevel paging is done till the level is reached where the entire page table can be stored in a
single frame.
S
SEGMENTATION
SEGMENTATION: EXAMPLE
S
SEGMENT TABLE
Segment table is a table that stores the information about each segment of the process.
It has two columns.
First column stores the size or length of the segment.
Second column stores the base address or starting address of the segment in the main memory.
Segment table is stored as a separate segment in the main memory.
Segment table base register (STBR) stores the base address of the segment table.
S
SEGMENT TABLE
S
SEGMENT TABLE
S
Step-01:
Step-02: For the generated segment number, corresponding entry is located in the segment table.
Then, segment offset is compared with the limit (size) of the segment.
Now, two cases are possible-
Advantages-
Disadvantages-
0 700 1219
1 14 2300
2 100 90
3 580 1327
Which of the following logical address will produce trap
4 96 1952
addressing error?
A. 0, 430
B. 1, 11
C. 2, 100
D. 3, 425
E. 4, 95
EXAMPLE
0 700 1219
1 14 2300
2 100 90
3 580 1327
Which of the following logical address will produce trap
4 96 1952
addressing error?
A. 0, 430
B. 1, 11
C. 2, 100
D. 3, 425
E. 4, 95
Segmented paging is a scheme that implements the combination of segmentation and paging.
• Process is first divided into segments and then each segment is divided into pages.
• These pages are then stored in the frames of main memory.
• A page table exists for each segment that keeps track of the frames storing the pages of that segment.
• Each page table occupies one frame in the main memory.
• Number of entries in the page table of a segment = Number of pages that segment is divided.
• A segment table exists that keeps track of the frames storing the page tables of segments.
• Number of entries in the segment table of a process = Number of segments that process is divided.
• The base address of the segment table is stored in the segment table base register.
S
Advantages-
Disadvantages-