184 views

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.

@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

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

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