8 - Disjoint Memory Management

Important reference for Page Tables

Summary

Type Page Logical Address Request
Paging page size $\times$ page number $+$ offset <page id, offset>
Segmentation <segment id, offset> <segment id, offset>
Segmentation with paging <segment id, page size $\times$ page number + offset> <segment id, page number, offset>

Paging

Physical Frames: Regions of fixed size in physical memory

Logical Pages: Logical memory is split into regions of same size

Pages loaded into any available memory frame. Implications:

Page Table: Lookup table that contains the mapping of logical pages to frames.

Logical Address Translation

Given page table $P$, page size $n$​ and the instruction load x from logical address, how to convert to physical memory address?

  1. Get logical page number $p = \lfloor x/n\rfloor$
  2. Get frame number $m = P(p)$
  3. Get physical memory address $a = mn + (x \mod n)$

Crucial assumption: page size = frame size [Design]

Criteria

Implementation

Cache the physical memory addresses translated to pages.

Protection

Page sharing

Copy-on-write

Segmentation

Text, Data, Heap, Stack become individual segments.

Logical Address Translation

Access with <segment id, offset>.

Segment Base (Starting address) Limit (Max offset)
0 (Text)
1 (Data)
2 (Heap)
3 (Stack)

Logical Address Translation

Hardware Support

Hardware operations

Note: The segment table above is in physical memory, not cached. The addressing error is the issued interrupt signal, i.e. invalid physical address of any sort is never returned.

Pros:

Cons:

Segmentation with Paging

Each segment has its own page table as an entry in the segment table.

Now each request is <segment id, page number, page offset>.

Segment table consists of <segment id, page table address>.

Each page table then contains the <page number, frame number>.

Segment memory regions

Memory Management Unit

Memory Management Unit

The memory management unit (to be better understood in Chapter 10) is providing the hardware support for checking the address requests.