[En-Nut-Discussion] arm port (RFC: Changing ARM mode)
Harald Kipp
harald.kipp at egnite.de
Tue Jan 13 16:41:21 CET 2009
Rocendo Bracamontes del Toro wrote:
> .- "user mode stack" was not initialized on the cstartup, therefore any
> attempt to change to user mode failed and produced undefined behavior.
> This was very simple to fix, just modify the stack initialization.
Yes, that happened to me while I tried to implement Duane's stack
backtrace. What confused me most was, that system mode uses the user
register bank, which I wasn't aware of and which resulted in a number of
weird emails I sent to Duane.
> .- When entering an ISR, the processor switches to IRQ mode, and there
> also a IRQ_ENTRY, IRQ_EXIT, these macros do not change the processor
> mode. In my case I wanted to process the ISR in "user" mode, so I
> enhanced the macros to change to "user" mode, also the potentially
> support nested interrupts as long as the ISR is carefully written to be
> re-entrant.
Duane's LostARM project also contains support for nested interrupts and
he kindly offered to contribute it to Nut/OS under BSDL. The point is,
that I'm quite busy and don't want to delay release 4.8 for too long
time. There are quite many problems with 4.6.
> wold be great if we could run the kernel in supervisor mode and
> everything else on user/system mode. To achieve that we will need to
> differentiate the calls to the OS that yield CPU to others threads.
This is a new variant? My understanding was, to run most code in user
and the kernel in system mode. Though, my understanding is not backed up
by too much experience or knowledge.
> Let me know how could I help.
What I do not know is, if we would be able to use SWI to switch to a
privileged mode and still maintain the modularity of the kernel, where
only those parts are linked to the final binary, which are directly or
indirectly referenced by the application code.
Furthermore, will there be any influence on other platforms like the AVR?
Harald
More information about the En-Nut-Discussion
mailing list