------------------------------------------------------ Session 31 - April 23, 2003 ------------------------------------------------------ AGENDA: 0 Admin 1 Ch. 4.3: Virtual memory ------------------------------------------------------ 0 - ADMIN ------------------------------------------------------ Test Friday - I will try to get a study guide up P6/7 - will be due 1 week later. You will need to start working on it soon. ------------------------------------------------------ 1 - CH 4.3 VIRTUAL MEMORY ------------------------------------------------------ Speak roughly to your little VAX, and boot it when it crashes; It knows that one cannot relax Because the paging thrashes! Wow! Wow! Wow! I speak severely to my VAX, and boot it when it crashes; In spite of all my favorite hacks My jobs it always thrashes! Wow! Wow! Wow! (Anonymous) What if have one single program that too large for memory? * overlays * virtual memory - virtual addresses - virtual address space - memory management unit (MMU) Fig 4-7 p. 320 * pages - virtual address space units * page frames - physical memory units corresponding to pages Fig 4-8 p. 321 * page fault * page table Fig 4-9 p. 323 - high-order bits specify virtual page number, low-order bits specify offset w/in page. - page table can get big Assume 4K pages. What size is the page table to manage a 32-bit address space? Assume 1 bit as present/absent indicator. 4K = 12bits => 32-12 = 20 => 2^20 pages Now do this for each process. Must be memory-efficient and very fast! * could have special fast hardware registers - very big, expensive, and have to mess with when switch processes * Could page table can be held in main memory. Just change one register to point to new page table. Problem is that need one or more memory references for each instruction because have to also read page table. Multilevel page tables * Fig. 4-10 p. 325 * Because don't need all memory usually, just map the parts that need. * Other bits to track page behavior - caching disabled, referenced, modified, protection * Performance issues COS 421 - Lecture Notes #31 SPRING 2003 COS421-lect-2003-04-23.doc Page 2 Printed 23.04.03