Standalone and non-standalone applications in embedded systems

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Standalone and non-standalone applications in embedded systems.
What is the basic difference between them?

--
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it


An operating system. The stand-alone version does not
have one.

--

Tauno Voipio
tauno voipio (at) iki fi

Re: Standalone and non-standalone applications in embedded systems
in comp.arch.embedded:

Quoted text here. Click to load it

I think you are referring to what the C and C++ languages refer to
free-standing and hosted environments, respectively.

A hosted environment has an operating system, or at least a run time
that looks like one.  Code running on such a system has access to the
entire standard language library.  At least in theory, although in
embedded systems even hosted environments are often subsets of the
full language/library.

A free-standing environment, on the other hand, is a very common small
embedded system environment, a little start-up code and then the
application with no OS in between.

--
Jack Klein
Home: http://JK-Technology.Com
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it

Does code access to the library as to shared/DLL library?
Does code need hosted environment if it (the code) doesn't use
shared/DLL library (i.e., library functions are linked with the
executable file while linkage stage)?

Quoted text here. Click to load it
[snip]

How does code/application run _without OS_ in free-standing
environment?
In other words:
* who invokes the application?
* how does system without OS "understand" what it has to do with the
code/executable?

Thanks.
Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn


Re: Standalone and non-standalone applications in embedded systems

Quoted text here. Click to load it

The simplest :
You have the reset vector pointing to the code.
The code has to boot the system

The next step :
The machine has some firmware that boots itself, then control is
passed to something, in this case the application.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net

Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it

In an embedded system the application code IS the firmware

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
On 1 Nov 2005 23:26:05 -0800, "Alex Vinokur"

Quoted text here. Click to load it

You are talking about mechanisms, and the C language talks about
availability.

In a hosted environment, such as Windows or Linux, your implementation
must be able to compile and build this program:

#include <stdio.h>

int main(void)
{
   printf("Hello, World!\n");
   return 0;
}

A fully conforming hosted implementation must provide all 15, 18, or
24 (depending on the version of the C standard, 1989/1990, 1995, or
1999 that it conforms to), and all of the functions, types, and macros
that the standard defines to be introduced by those headers.

A fully conforming free-standing implementation only has to provide
the headers <float.h>, <limits.h>, <stdarg.h>, <stddef.h>, plus
<iso646.h> if it conforms to C95 and <stdbool.h> and <stdint.h> if it
conforms to C99.  These files define a few types, like size_t, and
macros, but do not prototype one single library function.

So a free-standing implementation need not be able to cope with the
program above.  It is not required to provide <stdio.h> or the
printf() function.  But it must understand all the keywords and data
types, such as 'int', 'double', 'struct', and so on, and all the
operators such as '+', sizeof, and the rest.

Also it very rare in free-standing embedded systems for main() (or
whatever else the start up function is called, because it does not
have to be main() in free-standing environments) to ever return.
Usually it runs forever, or until some turns it off.

Quoted text here. Click to load it

Every processor from the smallest 8-bitter to a 64 bit X86 has some
mechanism to start executing code when it comes out of reset.  So in
just about every situation, there is some sort of non-volatile storage
such as ROM or flash memory there.  In a PC, it is the BIOS.  In an
embedded system, it is some sort of start up code, usually a
combination of hardware specific initialization and start up code
provided by the compiler vendor.

So typically the start up code in a free-standing embedded system
initializes the hardware, then jumps to the compiler start up code,
which initializes the C run time environment and then calls main(), or
whatever else the first application function is called.  And typically
this function never returns.

--
Jack Klein
Home: http://JK-Technology.Com
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems


Jack, thanks a lot for your very useful and helpful _conceptual_
explanation.

[snip]

Quoted text here. Click to load it

First. It seems that now I understood Dan Pop's answer  on my question
(about the abort() function) at
http://groups.google.com/group/comp.lang.c/msg/ef6d22ce2cda2bd0 .
abort() is in <stdlib.h> (that doesn't belong to "must"-list of
headers), so RTOS vendor may define its own behaviour for abort().

Second. What is relationship between RTOS and host, between RTOS and
target?
RTOS is required on host to develop an embedded system.
What about RTOS on target?

[snip]
Quoted text here. Click to load it
[snip]


I didn't find brief and informative explanations like above in
comp.arch.embedded Newsgroup FAQs at
http://www.faqs.org/faqs/by-newsgroup/comp/comp.arch.embedded.html .

Perhaps, it is worth creating such FAQ related to conceptual aspects of
embedded systems.

I found two good sources related to embedded systems:
* "Programming Embedded Systems with C and C++" by Michael Barr
http://www.oreilly.com/catalog/embsys /
* "Real-Time and Embedded Guide by Herman Bruyninckx" at
http://people.mech.kuleuven.be/~bruyninc/rthowto/rtHOWTO.pdf

But brief and informative _conceptual_ FAQs for comp.arch.embedded
could be useful.


--
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it

Alex,

If this is not home work... what are you trying to do? And why do you
want to know about embedded systems and RTOS?

You need the RTOS on the target (obviously) but not on the host.  IE
most of use develop on Windows or Unix but use a wide variety of RTOS
that are not Windows or Unix.

Only once have I developed on the same OS as was going to be used on the
target.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
[snip]
Quoted text here. Click to load it
[snip]

It is not homework. I started to work with embedded systems and RTOS
and would like to know not only technical, but conceptual things
related to issue.

Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn


Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it

Fair enough.

The only thing all embedded systems have in common is that they are
different :-)  4-128 bits, Harvard and Von Nueman architectures, with
and without an OS (that may or may not be an RTOS). It may have only ROM
and a few registers, or megabytes of RAM, no hard disks or arrays of
them.

There are many concepts depending on the direction you come from . Many
use an In Circuit Emulator whilst others swear by a logic analyser.

Some use God's own Language whilst others know it is the language of the
Devil and use the Real God's Own Language....  BTW one of the languages
is C but I am not telling which side of the argument it is on :-)

An author and trainer of very great experience I know asked me (and a
large group of others) what their definition of a process, a thread and
a task  was.  He had as many different answers as people.

It can be the same with asking "what is an embedded systems and how do
they work?"

It depends where the person comes from and their experience. I know some
people in embedded systems who have never used an RTOS OR an MCU....
They do everything in ASICS and FPGA.

Incidentally the embedded world is probably a LOT larger than the PC or
mainframe programming world.

Good luck.


--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
We've slightly trimmed the long signature. Click to see the full one.
Re: Standalone and non-standalone applications in embedded systems
Quoted text here. Click to load it

The initialisation code is usually written in assembler. This runs from
the hardware reset vector.  It sets up the memory, the processor and
stack (if there is one) and them jumps (one way, no return) to "main"
(or what ever it is called).

This is why  void main(void) is ONLY valid in self-hosted embedded type
systems. There is no return.

In embedded systems usually ALL the code is in ROM/EPROM/Flash etc. and
there is a separate area of RAM for the variables.

Embedded code can be written with no libraries etc. Also DLL's are
windows devices.  



--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills  Staffs  England     /\/\/\/\/
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline