[ECOS] [redboot] Compiling & Linking Apps.

David Fernandez dfernandez@cct.co.uk
Mon Mar 20 13:34:00 GMT 2006


On Mon, 2006-03-20 at 06:10 -0700, Gary Thomas wrote:
> 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 :-)

Sorry for that, internet is a bit restricted in our company.

> 
> > 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.
> 

I see what you mean, at least for some of the examples in eCos. Lets say
that I'm trying to replace or add some binary parts in my application
without having to recompile and include a the common application code
and/or a c library in each binary.

I'm not sure at the moment if there could be a better approach to that
just modifying a bit the linker script to have several code sections
with the same virtual address and then extract these sections into
separate files using some (unknown to me at the moment) especial option
of some binutils tool, or just put a c library in the main application
with virtual vectors linking to it and having a especial load option in
the CLI that allows me to load and link a part of the application with
those virtual vectors that provide the c library functions...

I'm using redboot as the "main application" because it has most of the
functionality that i need.

If you know of something in the eCos build system or sources that could
make that easy I'll appreciate it.

Thank you anyway for your help... (I'll take a look at your web as soon
as I get a chance...Promised :~)


-- 
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