[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: ARM926EJ-S : MMU problem ????
From:       steve.carter () livedevices ! com
Date:       2004-05-21 14:08:01
Message-ID: OF4023278A.6645128B-ON80256E9B.004A007A-80256E9B.004E11E1 () livedevices ! com
[Download RAW message or body]





linux-arm-kernel-bounces@lists.arm.linux.org.uk wrote on 21/05/2004
13:27:28:

> At a moment of my boot I want to switch off the MMU in order to run an
other
> code that was implemented with no knowledge of MMU.
>
> I wrote the following code :
>
> ... linux booting ...
>
>                mrc   p15, 0, r0, c1, c0   -> pc = 0xc0123828
>                bic      r0, r0, #1               -> pc = 0xc012382c
>                mcr   p15, 0, r0, c1, c0   -> pc = 0xc013830
>
> then i want that my pc = 0x123834, but it seems that when i switch off
the
> MMU, the processor follows executing the instruction at address
0xc0123834,
> that is an undefined instruction because the MMU was switched off and the

> processor don't recognize Virtual addresses.
>

the kernel gets over this when turning ON the MMU by mapping the code in
two places: once where virt==physical and one where it wants to end up
executing - because after turning on the MMU the next instruction's address
is interpreted differently, but is stil only ++ of the previous fetch.  To
apply that in reverse would involve discovering the physical address at
which the code was executing, creating the identity mapping for that (where
virt==phys), then jumping to THAT address.  Once there, there's no
difference between virt and phys you can turn on and off the MMU with
impunity.

The upshot of all that is that I'd go with the other respondent's advice
here and try and do your stuff before the MMU gets enabled in the first
place!


-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic