0
votes

I have been given the format for page table entries:

  • Bit 23: Valid Bit
  • Bit 22: Modify Bit
  • Bits 22-18: LRU Bits
  • Bits 17-0: Frame Number

Im told that the system uses 32-bit virtual addresses and pages that are 8192 bytes in size.

  • What would be the total size in bytes of the page map table?
  • If an inverted page map table is used what would be its total size in bytes if the LRU field within each PTE is reduced to 3 bits?

I have been helped with this problem, and calculated that the maximum physical memory of the system is 2GB. I'm not sure if I need to take the 32 bit virtual address data given into consideration when calculating the total size of the page map table.

1
I think the formula for calculating the page table size is (virtual address space/pagesize) * page table entry size. Given that, I would say that ((2^32)/8192)*page table entry size will give me the page map table size. Can anyone comment? I'm not sure what the page table entry size is.Johnny Rocket

1 Answers

1
votes

Looks like there isn't enough information to answer this question.

See, the page table size is equal to the number of entries in it times the size of each entry.

First, I don't know if the page table entries are 24-bit-long or 32-bit-long or bigger. That's not explicitly specified.

Second, if there's only one page table involved in translation of virtual addresses into physical addresses, a page table has to cover the entire 32 bits of the virtual address. Since a single PTE only handles 13 (because the page size is 2^13=8192 bytes), you'd need 2^(32-13)=2^19 entries in this case.

Now, if there's a hierarchy of page tables involved in the translation, in other words, the entries of the first page table (often called page directory) point to a second-level page table and those either point to the code/data pages or to a third-level page table and so on, you get the idea... in this case the answer is going to be different. But it's not specified whether there's just one page table or a chain of multiple page tables.

In my opinion, a page table of 2^19 entries is unlikely. A page table is usually the size of a single page (sometimes smaller). So, if, for example, PTEs are 32-bit, you have 8192/4=2048 PTEs in a PT and that covers only 11 (2^11=2048) out of the remaining 32-13=19 bits of the virtual address. The other 19-11=8 bits of the virtual address must be taken care of by another page table, page directory, having only 2^8=256 entries, provided the entries are the same in the page table and page directory.

Given the provided information, there's no definitive answer here, only guesses.