Download presentation
Presentation is loading. Please wait.
1
11/14/05 ELEC6200-001 1 Virtual Memory -Neha Jain -Neha Jain
2
211/14/05ELEC6200-001 Topics Covered Introduction Virtual Memory Address Translation Thrashing and Protection References
3
311/14/05ELEC6200-001 Introduction Memory Hierarchy Functional units Registers Internal cache External Cache Main Memory Secondary Memory (Disk) Memory Content: Cache Main Mem Secondary Mem CPU Memory Parameters: Access Time: increase with distance from CPU Cost/Bit: decrease with distance from CPU Capacity: increase with distance from CPU Cache : use SRAM (faster and costly) Main Memory : use DRAM (slower and cheap)
4
411/14/05ELEC6200-001 Principle of Locality Temporal Locality : Item tend to be referenced again soon Spatial Locality : Nearby items tend to be referenced again soon Cache Memory Cache Memory -Takes advantage of principle of locality
5
511/14/05ELEC6200-001 Virtual Memory A technique that uses main memory as a “cache” for secondary storage Basic Terminology Page : Fixed number of bytes recognized by operating system Page : Fixed number of bytes recognized by operating system Page Fault : Occurs when accessed page is not in main memory Page Fault : Occurs when accessed page is not in main memory Physical Address : Address in main memory Physical Address : Address in main memory Virtual Address: Addresses that application programmers deal with and are translated by MMU to physical address Virtual Address: Addresses that application programmers deal with and are translated by MMU to physical address
6
611/14/05ELEC6200-001 Processor Cache MMU: Memory management unit Physical address Main memory Data Virtual Address Physical address Virtual Page NumberPage Offset 31 30 29 28 27 ……………....13 12 11………….…….…2 1 0 Physical page numberPage Offset 29 28 27 ……………………...13 12 11………….…….…2 1 0 Translation Virtual Address Physical Address
7
711/14/05ELEC6200-001 Segmented Memory S1 S2 S3 S4 S1 S3 free Memory Management Unit (MMU) Segment Table x x free Physical Memory
8
811/14/05ELEC6200-001 Mapping Segmented Address + Segment #Displacement Virtual Address V prot limit base Segment Table Physical Memory datum Physical address Protection Compare segment Limit to displacement Segment# : specifies which segment to use( base address and length) Displacement : offset from base address for actual memory access
9
911/14/05ELEC6200-001 Page table for address translation Virtual page number Disk storage 1 1 1 1 0 1 1 1 1 1 0 0 Valid
10
1011/14/05ELEC6200-001 Page Tables The page table,PC and registers specifies the state or process of a program Swap Space : Space on hard disk for all the pages of a process
11
1111/14/05ELEC6200-001 Making Address Translation Fast By Translation-lookaside Buffer
12
1211/14/05ELEC6200-001 TLBs and Caches
13
1311/14/05ELEC6200-001 Who handles page faults? Operating System (in system software) - Look up page table - Look up page table - Choose a physical page to replace - Choose a physical page to replace - Bring referenced page from disk into - Bring referenced page from disk into chosen physical page chosen physical page
14
1411/14/05ELEC6200-001 Thrashing is a disaster and it occurs when program does not follow locality principle and continuously swaps pages from main memory to disk Protection Protection -One of the way is by having different physical addresses for a same virtual address
15
1511/14/05ELEC6200-001 References http://www.eng.auburn.edu/users/nelsovp/ courses/elec5200_6200/ http://www.eng.auburn.edu/users/nelsovp/ courses/elec5200_6200/ http://www.eng.auburn.edu/users/agrawvd /E5200/course.html http://www.eng.auburn.edu/users/agrawvd /E5200/course.html http://webster.cs.ucr.edu/AoA/Windows/H TML/MemoryArchitecturea3.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.