[En-Nut-Discussion] arm port (RFC: Changing ARM mode)

Rocendo Bracamontes del toro rocendob at gmail.com
Tue Jan 13 17:10:09 CET 2009


On Tue, Jan 13, 2009 at 8:41 AM, Harald Kipp <harald.kipp at egnite.de> wrote:

> 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.
>

 we could plan to do so for a release after 4.8 ?


>
>
> > 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.
>
>    I think your idea of running all kernel in system or supervisor mode is
great, that allows to keep better track of all code needed to be run in
specific modes.  Otherwise we could end up having some OS calls running in
different modes, that definitively would make project management more
difficult.  Any way, I vote to run all kernel in system or supervisor mode.


>
> >  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?


  Currently working with Thiago, porting the AVR32.  On this architecture we
have similar needs as the ARM.  I do not think the 8-Bit AVR would require
this level of management, since it does not support multiple execution
modes.


>
>
> Harald
>
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>



More information about the En-Nut-Discussion mailing list