Operating systems

Introduction to paging

Prashanth L.A.


Lecture 18

So far


What’s wrong with segmentation?




Advantages of Paging



(Virtual Page 0 → Physical Frame 3), (VP 1 → PF 7), (VP 2 → PF 5), and (VP 3 → PF 2)

Address translation

movl <virtual address>, %eax

Address space \(= 64\) bytes, so \(6\) bits needed

Page size \(= 16\) bytes, so first two bits give VPN

VPN \(\rightarrow\) virtual page number, Offset: offset within the page

Address translation (contd)

movl 21, %eax

Size does matter

  • 32-bit address space, 4KB pages \(\Rightarrow\) 20-bit VPN and 12-bit offset

  • 20-bit VPN \(\Rightarrow 2^{20}\) translations

  • 4 bytes/page table entry (PTE) \(\Rightarrow 4MB\) of memory needed for each page table!

  • \(100\) processes would need 400MB of memory just for all those address translations!