Search code examples
memory-managementoperating-systemvirtual

Page table sizes


virtual address space 1GB
page size is 2KB. 
page table entry 2 bytes

using the above information how would I get the maximum size of of a single page table

This may have been asked before but the answers are vague or overly complex and offer no formula to follow. so I'm asking it in a way that will hopefully provide usable information.

I need to Know this for developing my file storage MM system. No code is need I just need to know the steps involved. These numbers are made up.


Solution

    • Number of addressable pages = 1 GB / (2 KB/page) = 2^19 pages
    • 2^19 pages × (2 bytes/page) = 1 megabyte.

    page table entry requires 4 bytes

    That contradicts the initial text block. You should probably program using abstract data structures, and let the total allocation sizes vary within the OS architecture.