Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Memory Management Virtual Memory Chapter 4. 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take.

Similar presentations


Presentation on theme: "1 Memory Management Virtual Memory Chapter 4. 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take."— Presentation transcript:

1 1 Memory Management Virtual Memory Chapter 4

2 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take up space in main memory –The OS keeps those parts of the process currently in use in main memory, and the rest on disk –The portions necessary for processing are swapped in at the appropriate time.

3 3 Paging Because processes are of varying sizes, it is advantageous to break all processes into fixed size partitions called pages. The pages are then swapped in and out of main memory, depending on the strategy employed. Why would fixed size partitions be better than variable size?

4 4 Address mapping (from before) 14000 + CPUmemory logical address 346 physical address 14346 MMU relocatio n register We will complicate this portion

5 5 Paging The position and function of the MMU

6 6 Key concepts & terms Virtual address Physical address Virtual page Page frame Page table

7 7 Virtual and physical addresses

8 8 Page Table Internal operation of MMU with 16 4 KB pages

9 9 Addresses & memory references Addresses generated by the CPU are divided into two parts, a page number (p), and a page offset (d). The page number is an index into the page table. The page table can be implemented with associative registers. –The page table contains the base address of each page in physical memory, i.e., the frame address (f). The base address is combined with the page offset to define the physical address that is sent to the memory unit

10 10 pd df f CPU physical memory Page table

11 11 0 1 2 3 4 5 6 7 8 page 0 page 1 page 2 page 3 page 4 1 4 3 7 5 0 1 2 3 4 page 0 page 1 page 2 page 3 page 4

12 12 Structure of a page table entry

13 13 Issues with page tables They can be very large It takes more time to access a memory location –Virtual page first has to be mapped to its corresponding physical frame The spectrum of solutions –High speed registers to implement the table –Put entire page table in main memory

14 14 Assignment We have just covered material in Section 4.3 (partial) –pp. 202-207; 209-210 In-class exercise –See hand-out HW –pp. 263-264: 4, 6, 7, 8 –Section 4.3 Review what we did in Sec. 4.3 Read p. 211-middle p. 212 –Section 4.4 – read entire section


Download ppt "1 Memory Management Virtual Memory Chapter 4. 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take."

Similar presentations


Ads by Google