GATE CSE
First time here? Checkout the FAQ!
x
+4 votes
184 views

In a 32- bit machine we sub divide the virtual address into 4 segments as follows:
image:Q20a.PNG
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 Active (1.9k points)   | 184 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 entry.page table entry comprises of frame number and other bits..

I was considering 28 = 512 :P

Damn blunder  :( :(

Thank you all :)
Now I understood it

@Dulqar

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

http://www.cs.utexas.edu/users/lorenzo/corsi/cs372/06F/hw/3sol.html

1 Answer

+5 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 (11.7k 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 Jan 2017
  1. Debashish Deka

    9872 Points

  2. sudsho

    5596 Points

  3. Habibkhan

    5498 Points

  4. Bikram

    5350 Points

  5. Vijay Thakur

    4508 Points

  6. Arjun

    4458 Points

  7. Sushant Gokhale

    4410 Points

  8. saurabh rai

    4236 Points

  9. santhoshdevulapally

    3906 Points

  10. Kapil

    3892 Points

Monthly Topper: Rs. 500 gift card

19,481 questions
24,261 answers
54,211 comments
20,406 users