exercise In a swapping system, memory consists of the following hole sizes in memory order 10K B, 4kB, 20KB, 18Kb, 7KB, 9KB 12KB and 1 5KB, Which hold is taken for successive segment requests of 口12KB a 10KB 0 9KB For first fit? best fit? Worst fit? and next fit?
exercise ◼ In a swapping system, memory consists of the following hole sizes in memory order: 10KB,4KB,20KB,18KB,7KB,9KB, 12KB and 15KB. Which hold is taken for successive segment requests of ❑ 12KB ❑ 10KB ❑ 9KB For first fit? Best fit? Worst fit? And next fit?
Virtual memory Manage bloatware a Where programs are too big to fit into memory a Being split by programs is a bad idea(overlays) a Virtual memory Every program has its own address space The address space is divided into chunks called pages Each page is a contiguous area and mapped to physical address But, not all pages are needed to in physical memory OS maps page addresses and physical addresses on the fly When a needed page not in memory, oS needs to get it in Every page needs relocation
Virtual Memory ◼ Manage bloatware ❑ Where programs are too big to fit into memory ❑ Being split by programs is a bad idea (overlays) ❑ Virtual memory ◼ Every program has its own address space ◼ The address space is divided into chunks called pages ◼ Each page is a contiguous area and mapped to physical address ◼ But, not all pages are needed to in physical memory ◼ OS maps page addresses and physical addresses on the fly ◼ When a needed page not in memory, OS needs to get it in ◼ Every page needs relocation
Virtual Memory -Paging(1) The CPu sends virtual CPU addresses to the mmu package CPU Memory management Memory controller un The MMU sends physical addresses to the memory Figure 3-8. The position and function of the MMU-shown as being a part of the CPU chip(it commonly is nowadays Logically it could be a separate chip, was in years gone by Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Figure 3-8. The position and function of the MMU – shown as being a part of the CPU chip (it commonly is nowadays). Logically it could be a separate chip, was in years gone by. Virtual Memory – Paging (1) Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Paging(2) dares space 60K-64KX 56K-60K[X) Virtual page 52K-56KX 48K-52K 44K-48K 40K-44K X7X5 36K-40K 32K-36KX address 28K-32K 24K-28K XX 28K-32K 24K-28K 20K-24K3 20K-24K 16K-20K4 16K-20K 0 12K-16K 8K-12K6 8K-12K 4K-8K|1 4K-8K 0K-4K2 0K-4K Page frar Figure 3-9. Relation between virtual addresses and physical memory addresses given by page table Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Figure 3-9. Relation between virtual addresses and physical memory addresses given by page table. Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639 Paging (2)
Paging MMU( memory management unit) o CPU: MOV REG. 0 o MMU: MOV REG. 8192 o CPU: MOV REG 8192 o MMU: MOV REG 24567 0 CPU: MOV REG 20500 o MMU: MOV REG 12308 o CPU: MOV REG 32780 o MMU: page fault
Paging ◼ MMU( memory management unit) ❑ CPU: MOV REG, 0 ❑ MMU: MOV REG, 8192 ❑ CPU: MOV REG 8192 ❑ MMU: MOV REG 24567 ❑ CPU:MOV REG 20500 ❑ MMU:MOV REG 12308 ❑ CPU: MOV REG 32780 ❑ MMU: page fault