VM - A System Using Physical Addressing Main memory Virtual...

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

View Full Document Right Arrow Icon
Page ‹#› Virtual Memory Topics Address spaces Motivations for virtual memory Address translation Accelerating translation with TLBs – 2 – 15-213, F ʼ 06 A System Using Physical Addressing Used by many digital signal processors and embedded Used by many digital signal processors and embedded microcontrollers in devices like phones and PDAs PDAs . 0: 1: M -1: Main memory Physical address (PA) CPU 2: 3: 4: 5: 6: 7: 4 Data word 8: ... – 3 – 15-213, F ʼ 06 A System Using Virtual Addressing One of the great ideas in computer science. Used by all One of the great ideas in computer science. Used by all modern desktop and laptop microprocessors. MMU Physical address (PA) 0: 1: M-1: Main memory Virtual address (VA) CPU 2: 3: 4: 5: 6: 7: 4100 Data word 4 CPU chip Address translation – 4 – 15-213, F ʼ 06 Address Spaces A linear address space is an ordered set of contiguous is an ordered set of contiguous nonnegative integer addresses: {0, 1, 2, 3, … } } A virtual address space is a set of N = 2 n virtual addresses : {0, 1, 2, {0, 1, 2, …, N-1} , N-1} A physical address space is a set of M = 2 m (for convenience) (for convenience) physical addresses : {0, 1, 2, {0, 1, 2, …, M-1} , M-1} In a system based on virtual addressing, each byte of main memory has a virtual address and and a physical address. a physical address. – 5 – 15-213, F ʼ 06 Why Virtual Memory? (1) VM uses main memory efFciently Main memory is a cache for the contents of a virtual address space stored on disk. Keep only active areas of virtual address space in memory Transfer data back and forth as needed. (2) VM simpliFes memory management Each process gets the same linear address space. (3) VM protects address spaces One process can ʼ t interfere with another. Because they operate in different address spaces. User process cannot access privileged information Different sections of address spaces have different permissions. – 6 – 15-213, F ʼ 06 Multi-Processing - no VM Program A begins Program B begins Program B begins Prog A Prog B What happens if A wants more memory?
Background image of page 1

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

View Full DocumentRight Arrow Icon
Page ‹#› – 7 – 15-213, F ʼ 06 Multi-Processing - no VM Program A begins Program A begins Program B begins Program B begins Program A ends Program A ends Program C ready Program C ready Prog B Prog C – 8 – 15-213, F ʼ 06 Virtual Memory Use hard drive to store running programs and use DRAM on demand DRAM on demand Allocate memory in pages Provide protection by page – 9 – 15-213, F ʼ 06 (1) VM as a Tool for Caching Virtual memory Virtual memory is an array of N contiguous bytes stored on disk. stored on disk. The contents of the array on disk are cached in The contents of the array on disk are cached in physical memory (DRAM cache) physical memory (DRAM cache) PP 2 m-p -1 Physical memory Empty Empty Uncached VP 0 VP 1 VP 2 n-p -1 Virtual memory Unal ocated Cached Uncached Unal ocated Cached Uncached PP 0 PP 1 Empty Cached 0 N-1 M-1 0 Virtual pages (VP's) stored on disk Physical pages (PP's) cached in DRAM – 10 – 15-213, F ʼ 06 Multi-Processing - VM Program A begins Program B begins Prog A Prog B 0 0
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 12/27/2011 for the course CMPSC 154 taught by Professor Franklin during the Fall '09 term at UCSB.

Page1 / 8

VM - A System Using Physical Addressing Main memory 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