120 likes | 297 Views
Week 7. February 17, 2004 Adrienne Noble. Important Dates. Due Monday, Feb 23 Homework 7 Due Wednesday, Feb 25 Project 3 Due Friday, Feb 27 Homework 8. Questions?. Lecture Project 3 Homework 7 and 8. Midquarter Evaluation Results. More concrete examples and problems
E N D
Week 7 February 17, 2004 Adrienne Noble
Important Dates • Due Monday, Feb 23 • Homework 7 • Due Wednesday, Feb 25 • Project 3 • Due Friday, Feb 27 • Homework 8
Questions? • Lecture • Project 3 • Homework 7 and 8
Midquarter Evaluation Results • More concrete examples and problems • Q/A on projects is very helpful • Mixed feelings about reviewing lecture material • some love it, some think it’s a waste of time
Address translation and page faults virtual address virtual page # offset physical memory page frame 0 page table page frame 1 physical address page frame 2 page frame # page frame # offset page frame 3 … page frame Y
Address Space stack (dynamic allocated mem) 2048 bytes (211) heap (dynamic allocated mem) static data (data segment) 8192 bytes (213) code (text segment)
One Level Page Translation • Specs: • 16 bit address space • 64 byte pages • 2 bytes per page table entry (PTE) • How many bits are needed for the offset? • How many bits are needed for the virtual page number? • How many PTEs will be in the page table? • How much space will the page table take?
One Level Page Translation • Specs: • 16 bit address space • 64 byte pages • 2 bytes per page table entry (PTE) • How many bits are needed for the offset? • 6 bits (page size = 64 = 26) • How many bits are needed for the virtual page number? • 10 bits (address space / page size = 216 / 26 = 210) • How many PTEs will be in the page table? • 210 = 1024 PTEs • How much space will the page table take? • 1024 * 2 = 2048 bytes
Two Level Page Translation • Specs: • 16 bit address space • 64 byte pages • 2 bytes per page table entry (PTE) • How many bits are needed for the offset? • How many bits are needed for the virtual page number? • How many PTEs will be in the base page table? • How much space will the base page table take? • How much space will the entire set of page tables take?
Two Level Page Translation • Specs: • 16 bit address space • 64 byte pages • 2 bytes per page table entry (PTE) • How many bits are needed for the offset? • 6 bits (page size = 64 = 26) • How many bits are needed for the virtual page number? • 5 bits (page size / PTE size = 64/2 = 32 entries per page = 25) • How many pages will be in the base page table? • 25 = 32 PTEs • How much space will the base page table take? • 25 * 2 = 64 bytes • How much space will the entire set of page tables take? • 1 table for stack (2048 / 64 byte pages = 32 pages) • 4 tables for code, heap, data (8192 / 64 = 128) • 1 base table • Total = number of tables * table size = (1+4+1) * 64 = 384 bytes
Homework Review • Why are page table entries all powers of 2? • Say we have a 16 bit virtual address • 10 bits for virtual page number and 6 bits for offset • 1101010011010111 virtual address virtual page # offset
Page Replacement Algorithms • Balady’s Algorithm • FIFO • LRU • LRU approximation (clock) • Hypothetical Working Set Algorithm • Page Fault Frequency