Jason
Jason

Reputation: 452

multilevel page table

have 2 questions :

  1. A computer with 32-bit address uses 2-level page table (9 bit top level and 11 bit second level). How many much is the size of the page, amount of page in address space, and the minimum size of page table that should reside in the memory ??

  2. A 32-bit virtual address space computer has 4 KB pages. texts and data get into the lowest page (0-4095). Stack is at the highest page. How many entries needed if the computer still use traditional page table and 2-level page table (10 bit each for PT1 and PT2)?

THX for the answers guys....

Upvotes: 0

Views: 1863

Answers (1)

Benny
Benny

Reputation: 4321

  1. 9 bit + 11 bit = 20 bit. Given this, it lets 12 bit for offset, which is basically a 4kb page. The top-level page-directory stores 256 page-table entries, and the second-level page-table stores 2048 page entries.

  2. From a user point of view, you need 2 or three pages (stack, code+data, or stack, code, data if you have differents pages for code dans data, i.e. the data page has a no-execute attribute). From a memory manager point of view you need one more page to store the page-directory structure, and one or two more pages to store the corresponding page-tables strucuture. First entry of the page-directory points to the page-table page holding the entries for code and data pages. The last entry of the page-directory points to the page-table holding the entry for the stack page.

Hope this help.

Upvotes: 1

Related Questions