I would like to know how to calculate the size of the page table (in bytes) if there is one entry per page, each entry requires 4 bytes and my page size is 64KB.
A:
Since you didn't clearly specify what you mean with KB you could mean either a kilobyte (kB), that is 1000 bytes, and kibibyte (KiB). that is 1024 bytes.
Pagetable size in bytes can be calculated through multiplication.
Spoike
2009-09-04 06:51:28
Well, if KAR is talking about pages and page tables, then it seems obvious to me that they mean 1024.
Simon Knights
2009-09-04 08:01:54
If I ever actually meet anyone on the street that uses "KiB", I will beat them to death with a piece of wet celery (to make my pleasure more long-lived). A kilobyte is 1024 here.
paxdiablo
2009-09-23 06:00:14
A:
Number-of-pages * page-table-entry-size should give the answer. The page table just contains addresses of pages; page size is irrelevant.
So if you have 1000 pages then the page table size is 4*1000, if you have 1000000 pages then its 4*1000000.
Simon Knights
2009-09-04 08:03:25
@KAR: By the definition you have given in your original question, each page table entry is 4 bytes, and there is one entry for each page. Therefore, if you have 1000 pages, then the page table has 1000 entries and each one is 4 bytes. That makes 4000 bytes.That's a very small memory. Now work it out for your current system.
Simon Knights
2009-09-04 09:36:08
A:
I think it is not so simple, doesn't have each page table entry something like valid, reference, or dirty bits, if all 3 are included the table for 1000 pages would have to have size like 1000x(4x8+3) in bits. Let me know if I am correct because this is my homework also ;-).
zzdobrusky
2009-12-01 05:09:42