Virtual address is = 32 bit - 10 + 10 + 12 bits
10 bits -> Page directory entry offfset
10 bits -> Page table entry offset
12 bits- > Offset of data within page
---------------
I read somewhere that PAGE_SHIFT macro gives the page number of the page. Now if we consider this 32 bit address, and shift of 12 bits to the left how is that justified. I feel confused.
Thank you,
Mrunal
On Mon, Apr 21, 2008 at 8:44 AM, Nikhil Talpallikar <nikhil.talpallikar@xxxxxxxxx> wrote:
Argh! my mistake. did the math in a hurry.On Mon, Apr 21, 2008 at 9:06 PM, Luciano Rocha <luciano@xxxxxxxxxxx> wrote:
On Mon, Apr 21, 2008 at 08:42:55PM +0530, Nikhil Talpallikar wrote:Hm? 1 << 12 == 2^12 == 4096.
> Hi,
>
> Then should not the PAGE_SHIFT be 13 for the page size to be 4k on a x86
> arch.?
--
Luciano Rocha <luciano@xxxxxxxxxxx>
Eurotux Informática, S.A. <http://www.eurotux.com/>