public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] ARM cpu modes
@ 2000-04-05  3:09 Colin_Helliwell
  2000-04-05  5:45 ` Hugo 'NOx' Tyson
  2000-04-05  5:58 ` Gary Thomas
  0 siblings, 2 replies; 4+ messages in thread
From: Colin_Helliwell @ 2000-04-05  3:09 UTC (permalink / raw)
  To: ecos-discuss

Jesper said in a message yesterday that "[ARM] Application threads run in
supervisor mode in eCos". I've heard/seen it said somewhere that the ARM's
privileged Supervisor mode was intended for OS-type operations, whilst the
non-privileged User mode was intended for application-level code. I was curious
about the rationale behind the choice made in eCos, and whether it is felt that
there are actually any pros and/or cons of running application threads in
supervisor mode.

Thanks.
Colin Helliwell



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] ARM cpu modes
  2000-04-05  3:09 [ECOS] ARM cpu modes Colin_Helliwell
@ 2000-04-05  5:45 ` Hugo 'NOx' Tyson
  2001-09-05  0:09   ` Hugo 'NOx' Tyson
  2000-04-05  5:58 ` Gary Thomas
  1 sibling, 1 reply; 4+ messages in thread
From: Hugo 'NOx' Tyson @ 2000-04-05  5:45 UTC (permalink / raw)
  To: ecos-discuss


Colin_Helliwell@Mitel.COM writes:
> Jesper said in a message yesterday that "[ARM] Application threads run in
> supervisor mode in eCos". I've heard/seen it said somewhere that the ARM's
> privileged Supervisor mode was intended for OS-type operations, whilst the
> non-privileged User mode was intended for application-level code. I was curious
> about the rationale behind the choice made in eCos, and whether it is felt that
> there are actually any pros and/or cons of running application threads in
> supervisor mode.

Those distinctions are only pointful if you do stuff like memory protection
(including of IO device) and therefore have a SWI interface to *all* system
services. 
"Big" OS's with processes (=> memory protection and VM) would do this.
"Small" OS's ie. eCos, with threads and one uniform memory space do not.

eCos apps are fully linked, there is no SWI interface, and for performance
reasons, we *want* appliction object files to contain "privilidged"
operations from eCos macros or inline functions.  Device driver code is not
"special" in any way.  For example, cache flushing or sync'ing is usually a
coprocessor operation, which you can only do in a non-User mode.  But it's
only a couple of instructions, so there's no need to put in a clunking
great function with mode changes surrounding it; just put it inline with
the app code.  So it all must run in Supervisor mode.

Actually, we have considered moving to System mode (User mode reg set with
SVC mode privilidges) but it's not available on all ARMs and there ain't
much to gain...

HTH,
	- Huge

-- 
The 20th Century brought unprecedented increases in worldwide numeracy and
literacy and incredible advances in technology, science and mathematics.
It was also the only century in the past or in any reasonable predictable
future apparently to contain only 99 years.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [ECOS] ARM cpu modes
  2000-04-05  3:09 [ECOS] ARM cpu modes Colin_Helliwell
  2000-04-05  5:45 ` Hugo 'NOx' Tyson
@ 2000-04-05  5:58 ` Gary Thomas
  1 sibling, 0 replies; 4+ messages in thread
From: Gary Thomas @ 2000-04-05  5:58 UTC (permalink / raw)
  To: Colin_Helliwell; +Cc: ecos-discuss

On 05-Apr-00 Colin_Helliwell@Mitel.COM wrote:
> Jesper said in a message yesterday that "[ARM] Application threads run in
> supervisor mode in eCos". I've heard/seen it said somewhere that the ARM's
> privileged Supervisor mode was intended for OS-type operations, whilst the
> non-privileged User mode was intended for application-level code. I was curious
> about the rationale behind the choice made in eCos, and whether it is felt that
> there are actually any pros and/or cons of running application threads in
> supervisor mode.
> 

eCos assumes full responsibility for the hardware.  An eCos application needs
to run with the same level of access and privledge as the kernel since we do
not employ any sort of level switch (i.e. eCos functions are accessed as
function calls, there is no "system call" mechanism being used).

On the ARM, this means that the kernel, and thus the application, run in
Supervisor Mode.

As for the motivation?  Speed and control.  By not using a level switch (aka
system call), applications get the most efficient access to kernel functions.
There is no need for copying parameters and data when making calls, no need
for excessive state savings, etc.  Overall, the application simply gets the
most efficient use of system resources.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] ARM cpu modes
  2000-04-05  5:45 ` Hugo 'NOx' Tyson
@ 2001-09-05  0:09   ` Hugo 'NOx' Tyson
  0 siblings, 0 replies; 4+ messages in thread
From: Hugo 'NOx' Tyson @ 2001-09-05  0:09 UTC (permalink / raw)
  To: ecos-discuss


Colin_Helliwell@Mitel.COM writes:
> Jesper said in a message yesterday that "[ARM] Application threads run in
> supervisor mode in eCos". I've heard/seen it said somewhere that the ARM's
> privileged Supervisor mode was intended for OS-type operations, whilst the
> non-privileged User mode was intended for application-level code. I was curious
> about the rationale behind the choice made in eCos, and whether it is felt that
> there are actually any pros and/or cons of running application threads in
> supervisor mode.

Those distinctions are only pointful if you do stuff like memory protection
(including of IO device) and therefore have a SWI interface to *all* system
services. 
"Big" OS's with processes (=> memory protection and VM) would do this.
"Small" OS's ie. eCos, with threads and one uniform memory space do not.

eCos apps are fully linked, there is no SWI interface, and for performance
reasons, we *want* appliction object files to contain "privilidged"
operations from eCos macros or inline functions.  Device driver code is not
"special" in any way.  For example, cache flushing or sync'ing is usually a
coprocessor operation, which you can only do in a non-User mode.  But it's
only a couple of instructions, so there's no need to put in a clunking
great function with mode changes surrounding it; just put it inline with
the app code.  So it all must run in Supervisor mode.

Actually, we have considered moving to System mode (User mode reg set with
SVC mode privilidges) but it's not available on all ARMs and there ain't
much to gain...

HTH,
	- Huge

-- 
The 20th Century brought unprecedented increases in worldwide numeracy and
literacy and incredible advances in technology, science and mathematics.
It was also the only century in the past or in any reasonable predictable
future apparently to contain only 99 years.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-05  0:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-05  3:09 [ECOS] ARM cpu modes Colin_Helliwell
2000-04-05  5:45 ` Hugo 'NOx' Tyson
2001-09-05  0:09   ` Hugo 'NOx' Tyson
2000-04-05  5:58 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).