EmbDev.net

Forum: ARM programming with GCC/GNU tools User Mode and System Mode


Author: Stephen Roe (stereo)
Posted on:

Rate this post
0 useful
not useful
Hi,

I'm relatively new to ARM devices and to date have only written
bare-metal programs using a generic strartup script.  I've started doing
more research on ARM devices and came accross the numerous modes (User,
System, FIQ, IRQ etc)  I've used the two interrupt modes before and upon
examining my startup script I can see that I've been running my programs
in System mode.

Unfortunetly I can't appear to find any useful information on the net to
what the differneces between User and System Mode are.  Most resources
simply state that User Mode is where the user programs should be run and
system mode is used by the OS.  Can anyone please enlighten me to the
differences of the two modes??

--
Thanks,

Stephen

Author: Spencer Oliver (ntfreak)
Posted on:

Rate this post
0 useful
not useful
> Unfortunetly I can't appear to find any useful information on the net to
> what the differneces between User and System Mode are.  Most resources
> simply state that User Mode is where the user programs should be run and
> system mode is used by the OS.  Can anyone please enlighten me to the
> differences of the two modes??
>

The short and sweet version is once you are in user mode you cannot
change to any other mode - or enable/disable interrupts at core level.
user mode is classed as non privileged.

To answer fully look at the arm arch ref manual - search google for
ddi0100e_arm_arm.pdf

Cheers
Spen

Author: Clifford Slocombe (clifford)
Posted on:

Rate this post
0 useful
not useful
The definitive place for such information is the ARM Architecture
Reference Manual (ARM-ARM):
http://www.altera.com/literature/third-party/ddi01... See
section 2.2 (page A2-3)

The "Insider's Guides" available at http://www.hitex.co.uk/download.html
are also a good introduction to such things - if you are not using
precisely one of the parts listed, that does not matter much for the ARM
specific stuff - just select an ARM7 or ARM9 as appropriate.

The primary feature of the ARM modes is that some registers are specific
to a particular mode while others are shared. Which ones are shared
differs depending on the mode. Most importantly each mode has its own
stack pointer register. System and User modes share the same register
set (including SP), but User mode has resource access restrictions. In
practice, the restrictions are dependent on the specific part the
ARM-ARM says of User Mode:

* User mode cannot switch to another mode other than by causing an
exception that results in a mode switch.

* Memory system and co-processors may restrict User mode access.

So unless you are using a part with an MMU for example, there is little
advantage in User Mode over System Mode. Unless you are running an RTOS
you probably need not worry too much about Supervisor Mode either, and
even then you might not.

Clifford.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.