Background

AddressSpace
A base and a limit register define a logical address space
Hardware
Hardware address protection with base and limit registers

Address Binding

* A program resides on a disk as a binary executable file.
    * To run, the program must be brought into memory.
    * The address of the process does not start ad address 00000000.
* Addresses in the source are generally symbolic.
* A compiler typically *binds symbolic* addresses to *relocatable* addresses.
* A linker or loader in turn binds the *relocatable* addresses to *absolute* addresses.
Multistep
Multistep processing of a user program

Logical vs Physical Address Space

MMU
Memory management unit (MMU)
relocation register
Dynamic relocation using a relocation register

Dynamic Loading

Dynamic Linking and Shared Libraries

Contiguous Memory Allocation

Memory Protection

HWSupport
Hardware support for relocation and limit registers

Memory Allocation

Partition
Variable partition

Fragmentation

Paging

address
Paging hardware
Paging hardware
Paging hardware
Paging model of logical and physical memory
address
Example
Paging example for a 32-byte memory with a 4-byte pages
Example
Free frames (a) before allocation and (b) after allocation

PTBR (page-table base register)

Translation Look-aside Buffer (TLB)

TLB
Paging hardware with TLB

Memory Protection with Paging

bits
Valid bit (v) or invalid bit (i) in a page table

Shared Pages

Sharing
Sharing of standard C library in a paging environment

Structure of the Page Table

Hierarchical Paging

Hierarchical
A two-level page-table architecture
Hierarchical
Address translation for a two-level 32-bit paging architecture

Hashed Page Tables

Hashed
Hashed page table

Inverted Page Tables

Inverted
Inverted page table

Swapping

Standard Swapping

Swap
Standard swapping of two processes using a disk as a backing store

Swapping with Paging

Swap
Swapping with paging