Hi Vaibhav,
identity mappings no longer useful.According to this article
http://geezer.osdevbrasil.net/osd/mem/index.htm#identity?- "The page table
entries used to identity-map kernel memory can be deleted once paging and
virtual addresses are enabled." Can somebody please explain?
I don't have a good idea on this. But my guess is, these entries has
to there to enable MMU. Because after enabling it you are still in the
same address space. Basically kernel needs an x to x
translation(identity mapping) before kernel do the jump to the virtual
space (0xc000 0000), after that those entries are not needed any
more.
Will wait for our kernel experts comments.
Thanks
Vaibhav Jain
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
With Regards
Subin Gangadharan
I am not afraid and I am also not afraid of being afraid.
Hi Vaibhav,
On Wed, Apr 11, 2012 at 2:22 PM, Vaibhav Jain [off-list ref] wrote:
I am not clear about the use of identity mapped paging while paging is being
enabled by the operating system. Also I don't understand at what point are
the
identity mappings no longer useful.According to this article
http://geezer.osdevbrasil.net/osd/mem/index.htm#identity?- "The page table
entries used to identity-map kernel memory can be deleted once paging and
virtual addresses are enabled." Can somebody please explain?
The identity mapping are used when the MMU is first enabled. I'm most
familiar with the ARM, so the rest of my comments are ARM specific.
When the kernel first gets control, the MMU is off, so virtual
addresses == physical addresses.
The kernel sets up a small identity mapping (virtual == physical) as
well as a the kernel direct mapping. This happens in assembler code
before any C code in the kernel runs.
http://lxr.linux.no/linux+v3.4.3/arch/arm/kernel/head.S#L203
The identity mapping is needed for the code that turns on the MMU. The
identity mapping is only needed for a few instructions. If you look at
http://lxr.linux.no/linux+v3.4.3/arch/arm/kernel/head.S#L451
The identity mapping is really only needed while lines 454 thru 459
execute. The mov pc, r13 instruction changes the PC to be in the
0xCxxxxxxx range (assuming a normal 3G user/ 1G kernel split is being
used).
Later on, in paging_init (which is written in C), that identity
mapping is removed, and the MMU is setup properly for the rest of the
kernel.
--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com