Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.

Similar presentations


Presentation on theme: "Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory."— Presentation transcript:

1 Virtual Memory

2 Hierarchy Cache Memory : Provide invisible speedup to main memory

3 Hierarchy Virtual Memory : Provide invisible extension to main memory

4 Virtual Memory How Why? – Allows multiple programs to coexist invisibly Each program thinks it has all memory

5 Virtual Memory Why? – Allow programs to use more main memory than is physically present

6 Terminology Virtual Address : address program uses Physical Address : real address in RAM virtual address is mapped to

7 Terminology Page : block of memory in virtual address space Page Frame : location in physical memory a page is placed

8 Terminology Page Fault : request for a page that is not in physical memory Paging : copying desired page from hard drive to RAM I need this address:

9 Terminology Page Fault : request for a page that is not in physical memory Paging : copying desired page from hard drive to RAM I need this address: Bring in from hard drive

10 Terminology Page Fault : request for a page that is not in physical memory Paging : copying desired page from hard drive to RAM I need this address: Bring in from hard drive Record where I put it 3

11 Paging Page Table : Records frame  frame block mapping – Valid bit : records if page present – Dirty bit : modified, needs to be stored

12 Addressing Virtual address space is 256 bytes – 8 bit address 8 pages, 32 bytes in each page 2 3 2 5 8 bits - Virtual PageOffset 3 bits5 bits

13 Addressing Physical memory is 128 bytes – 7 bit address 4 page frames, 32 bytes in each 2 2 2 5 7 bits - Physical Page Frame Offset 2 bits5 bits

14 Mapping Program asks for virtual address: 00001101 8 bits - Virtual PageOffset 000 Page 0 01101 Byte 13

15 Mapping Program asks for virtual address: 00001101 Page Table says that is page frame 2 : 10 8 bits - Virtual PageOffset 000 Page 0 01101 Byte 13 7 bits - Physical Page Frame Offset 10 Frame 2

16 Mapping Program asks for virtual address: 00001101 Page Table says that is page frame 2 : 10 Offset in frame same as offset in page: 01101 8 bits - Virtual PageOffset 000 Page 0 01101 Byte 13 7 bits - Physical Page Frame Offset 10 Frame 2 01101 Byte 13

17 Mapping Program asks for virtual address: 00001101 Gets value at: 1001101 8 bits - Virtual PageOffset 000 Page 0 01101 Byte 13 7 bits - Physical Page Frame Offset 10 Frame 2 01101 Byte 13

18 Another 16 bytes of virtual space, 8 of RAM Page size : 2 bytes

19 Another 16 bytes of virtual space, 8 of RAM 4 bit address3 bit address Page size : 2 bytes 1 bit offset What does 0111 map to?

20 Larger Scale Virtual addressed up to 8K Physical up to 4K Page size 1k

21 Larger Scale Virtual addressed up to 8K Physical up to 4K Page size 1k

22 Page Sizes Small page size = larger page table

23 Page Sizes Small page size = larger page table Large page size = more unused data in pages

24 Paging & Caching Page table held in main memory by OS

25 Paging & Caching Page table held in main memory by OS Every mapping goes to main memory… Cache is worthless!

26 TLB Transition look-aside buffer Cache for page table – Subset of page table – Fully associative – May be multiple levels

27 TLB Using TLB


Download ppt "Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory."

Similar presentations


Ads by Google