[ECOS] [redboot] Compiling & Linking Apps.

Gary Thomas gary@mlbassoc.com
Mon Mar 20 13:11:00 GMT 2006


On Mon, 2006-03-20 at 13:01 +0000, David Fernandez wrote:
> On Mon, 2006-03-20 at 05:38 -0700, Gary Thomas wrote:
> > On Mon, 2006-03-20 at 12:02 +0000, David Fernandez wrote:
> > > 	Hi there,
> > > 
> > > 	I'm trying to compile applications to run in the redboot environment;
> > > but I couldn't find any good way in the eCos distribution.
> > > 
> > > 	Following the eCos documentation in chapter 13 it seems that the
> > > Makefile there tries to link the entire redboot again with for example,
> > > hello.c (and there is a problem with -finit-priority that the redboot
> > > makefiles leave in ECOS_GLOBAL_CFLAGS in
> > > <INSTALL_DIR>/include/pkgconf/ecos.mak).
> > > 
> > > 	Should I write my own linker script & makefile, or is there anything in
> > > eCos sources to achieve that?
> > > 
> > > 	I've been looking to be able to use the C library in the applications
> > > too... but, as redboot does not provide a dynamic linker I was wondering
> > > if could it be relatively straightforward to modify language/c/... to
> > > get virtual vectors for all or some of the libc functions and modify the
> > > exec command to relocate elf objects.
> > 
> > You're looking at this the wrong way - RedBoot provides a bootstrap
> > environment, suitable for downloading (and otherwise managing) *user*
> > applications.  It is a special eCos program, using it's own template,
> > etc.
> > 
> > User applications on the other hand, are built separately.  This
> > often includes the basic C libraries, etc, based on the template
> > chosen.  Once this application is built, it can be downloaded and
> > run _using_ RedBoot.
> > 
> > Look at some simple examples:
> >   http://www.mlbassoc.com/examples
> > 
> 
> Ok, I'll ask it this other way: Does eCos sources include just a C
> library with stdio working through the redboot HAL, and with heap
> support?, How do I get it built?, Can I link an application easily with
> that library into an elf file that I can load and execute from redboot?
> 

Did you even read the page(s) I pointed at?  The answer to this question
is there :-)

> My intention is to modify redboot to get something more enhanced but
> without having multithreaded kernel.

What other functionality do you want in RedBoot?  If you're thinking you
need to make such changes just to have that functionality in user 
applications, that's not the way eCos programs are built.  For the most
part, eCos applications are self contained - all libraries, etc, are
linked directly into the application itself.  It's only for a small
set of functions (e.g. diagnostic serial I/O) that RedBoot is used
via the virtual vector interface and even that can be easily disabled.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list