Re: [i386] Questions regarding provisional page tables initialization

From: Andi Kleen
Date: Mon Jul 02 2007 - 05:47:58 EST


"Ahmed S. Darwish" <darwish.07@xxxxxxxxx> writes:
>
> There're some stuff that confused me for a full day about the code (head.S)
> that accomplishes the above words:
>
> movl $(pg0 - __PAGE_OFFSET), %edi
> movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
> movl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
> 10:
> leal $0x007(%edi),%ecx /* Create PDE entry */
>
> What does the address of 7 bytes displacement after %edi - the physical address
> of pg0 - represent ?.

The trick is not to know everything, but to know where to look ...

Page table entries use the first 12 bits for various flags. Take a look
at the Intel or AMD x86 documentation from their websites.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/