virtual Memory
1 Virtual Memory
Outline Virtual space Address translation Accelerating translation with a tlB Multilevel page tables Different points of view Suggested reading: 10. 1-10.6 TLB: Translation lookaside buffers
2 Outline • Virtual Space • Address translation • Accelerating translation – with a TLB – Multilevel page tables • Different points of view • Suggested reading: 10.1~10.6 TLB: Translation lookaside buffers
10.1 Physical and Virtual Addressing
3 10.1 Physical and Virtual Addressing
Physical Addressing Attributes of the main memory Organized as an array of m contiguous byte-sized cells Each byte has a unique physical address(PA) started from O physical addressing A CPU use physical addresses to access memory Examples Early PCs, DSP, embedded microcontrollers, and Cray supercomputers Contiguous:临近的
4 Physical Addressing • Attributes of the main memory – Organized as an array of M contiguous byte-sized cells – Each byte has a unique physical address (PA) started from 0 • physical addressing – A CPU use physical addresses to access memory • Examples – Early PCs, DSP, embedded microcontrollers, and Cray supercomputers Contiguous: 临近的
Physical Addressing Main menor Physical address CPU (PA) 4 012345678 Data word Figure 10.1 P693
5 Physical Addressing Figure 10.1 P693
Virtual Addressing Virtual addressing the CpU accesses main memory by a virtual address (VA The virtual address is converted to the appropriate physical address
6 Virtual Addressing • Virtual addressing – the CPU accesses main memory by a virtual address (VA) • The virtual address is converted to the appropriate physical address
Virtual Addressing Address translation Converting a virtual address to a physical one requires close cooperation between the CPU hardware and the operating system the memory management unit (MMU) Dedicated hardware on the cpu chip to translate virtual addresses on the fly A look-up table Stored in main memory Contents are managed by the operating system
7 Virtual Addressing • Address translation – Converting a virtual address to a physical one – requires close cooperation between the CPU hardware and the operating system • the memory management unit (MMU) – Dedicated hardware on the CPU chip to translate virtual addresses on the fly • A look-up table – Stored in main memory – Contents are managed by the operating system
CPU chi Main memory Virtual Address i Physical Address transiation address CPU (VA) (PA) 01234 4100 5 圆国m 7 M-1 Data word Figure 10.2 P694
Figure 10.2 P694 8
10.2 Address space
9 10.2 Address Space
Address Space Address space An ordered set of nonnegative integer addresses Linear space The integers in the address space are consecutive N-bit address space
10 Address Space • Address Space – An ordered set of nonnegative integer addresses • Linear Space – The integers in the address space are consecutive • N-bit address space