week10_wed - 3/12/2010 A3 Requirements Intro to A3: Virtual...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
3/12/2010 1 Intro to A3: Virtual Memory Topics: MIPS Address Space and TLB Design paging data structures code in kern/vm coremap data structure A3 Requirements Implement demand paging by writing the following functions: lpage_fault - handles a page fault. lpage_evict - evicts an lpage from physical memory. do_evict - called when a page is to be evicted from memory. page_replace - two versions: random page replacement algorithm some approximation of LRU replacement A3 Starter Code Much of the design of the VM system is provided • We’ll go over it today Main machine-independent files are kern/vm/* Machine dependent parts are kern/arch/mips/mips/{vm.c, coremap.c} First, the MIPS memory management unit Since hardware determines what software can/must provide! MIPS R2K Memory Structure Page size: 4 kB (4096 bytes) virtual address: 32 bits 20 bits for the virtual page number 12 bits for the offset - same as in lecture TLB: 64 entries, each entry is 64 bits why 64 bits? Must store virtual address for lookup, and copy of page table entry (phys page) Software-managed Read/write as two 32-bit words, entryhi and entrylo
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3/12/2010 2 TLB Entries See kern/arch/mips/include/tlb.h High-order word stores virtual page number for lookup (20 bits, mask 0xfffff000) High-order word also has 6 bits for pid in hardware, but we won’t use them in OS/161 Low order word has physical page number (20 bits), 4 status bits, 8 unused bits D == Dirty (really writable), V == Valid N == Non-cached, G==Global (ignore these) TLBHI_VPAGE TLBLO_PPAGE UNUSED NDVG TLB Interface 4 functions defined to allow OS software to access the TLB TLB_Random load an entry into a random slot in
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/22/2010 for the course CS CSCC69 taught by Professor Bianca during the Spring '10 term at University of Toronto- Toronto.

Page1 / 5

week10_wed - 3/12/2010 A3 Requirements Intro to A3: Virtual...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online