First time here? Checkout the FAQ!
+4 votes

In a 32- bit machine we sub divide the virtual address into 4 segments as follows:
We use a 3-level page table, such that the first 8 bits are for the first level and so on. What is the size of the page tables for a process that has 256 K of memory starting at address 0? Assume each page table entry is 2 bytes.

asked in Operating System by Loyal (2.6k points)   | 239 views
@sushant,even if we are using few entires,space will be allocated for full page table,,so we have to cosider that
@dulqar..have u got it now??

see,page size is the size of each page in the main memory..not the size of  page table table entry comprises of frame number and other bits..

I was considering 28 = 512 :P

Damn blunder  :( :(

Thank you all :)
Now I understood it


same problem with changing 10 t0 8 in number of bits in the first level..

1 Answer

+6 votes
Best answer

Process size = 256 KB
last level tells that page size is 1KB, hence we need 256 pages to be brought into memory
6 bits(2nd level from RHS), can point 64 entries and each entry points to a page, means total 64KB data.
We need  $\frac{256KB}{64KB}$ = 4 entries in total from level 3 (from RHS)
and to point these 4 entries, we need 1 entry from outer most page table.

1x4x26x210 = 22x26x210 = 218=256 KB

Page tables requires from left to right:-
1 page table for outermost page table = 28x2B=29B
1 page table for the second level= 28x2B = 29B
4 page tables on 3rd level = 4x26x2B=29B

total page tables size required: 512B+512B+512B=3x29   = 1536B  should be answer

answered by Veteran (14.6k points)  
selected by
@Vijay_Thakur sir ,  I have doubt in this .  Page Size is 1 kB (10 bits )

1 page table for outermost page table = 1 kB
1 page table for the second level= 1 kB
4 page tables on 3rd level = 4 kB

Why aren't we considering this page table size for inner pages also ?
because they have not mentioned saying that one page table is fit into one page only, so we have calculated the actual sizes as we always do

This might help

Top Users Mar 2017
  1. rude

    5236 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1440 Points

  8. Bikram

    1428 Points

  9. Akriti sood

    1420 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,551 questions
26,896 answers
23,267 users