[En-Nut-Discussion] arm port (RFC: Changing ARM mode)
Adam Dybkowski
adybkows at wp.pl
Wed Jan 14 00:14:45 CET 2009
Alain M. wrote:
>>> I think this is not a real problem because SWI call works similar to
>>> interrupt - CPU suddenly jumps to address 0x08, switches to Supervisor
>>> and ARM mode (if it was in Thumb). The SWI handler could extract the
>>> return address and jump there in priviledged Supervisor mode (extra
>>> bonus: own system stack) or switch into System mode (the same as User
>>> mode but priviledged). EXIT_KERNEL_MODE will be much easier because we
>>> have only to switch to User mode (restore CPSR as it was before
>>> ENTRY_KERNEL_MODE), without using SWI to do it.
>> Agree ...
> It will probably work with ARM7, but it looks more like a hack...
> But it will not work anymore on Cortex...
Why? What is the clue difference between Cortex and ARM cores?
Besides that, I prefer to run privileged code inside Nut/OS kernel in
SWI handler, without jumping back to user-written code (what will
decrease overall security). But this solution would link kernel with all
its functionality, not necessarily used in an application, what might be
a problem in internal Flash memory environments.
--
Adam Dybkowski
adybkows at wp.pl
http://dybkowski.net/
More information about the En-Nut-Discussion
mailing list