Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: system and user modes (was Re: Example of C and inline ASM in a file?)

2006-04-16 by jayasooriah

Robert, given we are digressing, I hope you dont mind the my change of
the thread title.

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@...> wrote:
> >The second (probably more insidious) is that the distinction between
> >of user and system modes appear to have been lost in the process.
> 
> Is this distinction actually useful?  If user mode actually provided
memory 
> protection or I/O protection mechanisms I could see a use.  As it is
the 
> only real use I see for the mode distinctions is the register 
> saving/shadowing on interrupts.  The inability to manipulate the
interrupt 
> flags appears to just be an annoyance/relic held over from ARM's larger 
> general purpose computer roots.

One can ignore (and not enter) user mode to avoid the annoyance as you
put it.

If however one makes the distinction between user and kernel (or
system) modes there are benefits.  Off the top of my head:

1/  The designer is forced to make the distinction between
infrastructure (kernel) from application specific (user) components.

Infrastructure code is generic to multiple systems.  Application code
does the particular task the system is designed to do.

2/  Application code can be run at a lower privilege level so as to
avoid having to resort to extreme debugging measures when there is
interference.

A new programmer joining the team does not need to start with
expensive JTAG and/or other in-system emulation and debugging systems.

[By expensive, I mean to not only (just) price, but also time and effort.]

For example they could start developing an application on the target
using techniques as simple as printf() equivalents.

[Programmers who start with such methods exhibit more skills in
probing a system at the right places using techniques that do not
alter the system's operational behaviour.]

3/  The different privilege modes supports the decomposition of
embedded systems into a set independent and cooperating concurrent tasks.

This usually means there is a simple (almost always better) way to
describe system in terms of its constituents and how these
constituents interact.

I accept (although I do not know of one) that the distinction between
kernel and user mode may not be appropriate in every case.

However, in removing this distinction in the LPC family just makes it
less usable that it could otherwise be.  Bear in mind implementors
have the option of gating any operation with privilege mode bits
available in the ARM core.

Jaya

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.