Describe how paging supports non-contiguous allocation.
Divide physical memory into frames. Divide logical memory into pages. Use a page table to map between pages and frames.
Define a frame.
It is a fixed-size block of physical memory.
Describe how to allocate N pages of memory.
Find N free frames. Create entries in page table to map each page to a frame.
Describe the format of the logical address in paging.
Page number used to index into a page table containing the base address of the page. Page offset combined with the base address gives the physical memory address.
What does the page table store?
Page table entries which map between logical and physical addresses.
State the amount of fragmentation when using paging.
No external fragmentation. On average 0.5N frame of internal fragmentation per process.
State and describe the registers required for paging.
Page-table base register points to the page table. Page-table length register indicates the size of the page table.
State the performance impact of paging.
Each data/instruction access requires two memory accesses, so is slower.
What is the translation lookaside buffer?
It is a hardware cache for page table lookups.
Describe the operation of the translation lookaside buffer.
If the translation is in the TLB, use it. Otherwise it is a TLB miss, so look the address up in the page table. When the TLB is full, remove entries by least recently used.
Define hit ratio.
The proportion of time a page table entry is found in TLB.
What information do protection bits store in page table entries?
Whether page is only accessible in kernel mode. Whether read/write/execute to page is permitted. Valid/invalid.
State the 3 uses of sharing pages.
Sharing copy of read-only code between processes, Multiple threads sharing the same process space, IPC with shared memory.
Describe a two-level, forward mapped page table.
The logical address is divided into p1, p2 and the offset. Two page tables L1 and L2. Page table base register points to L1, L1[p1] gives the address of the relevant page in L2. (pageInL2[p2] + offset) gives the physical address.