This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Linux Synthetic target problems


Okay, thanks again to Andrew and Bart, I was able to successfully build and run the example programs in/with the Linux Synthetic target! In order to assist others, here are the steps from start to finish:

	1. CVS checkout to /opt/ecos/ecos-cvs

	2. We need a working ecosconfig (command-line tool), so we do the following:
		a. âmkdir ~/ecosconfig-buildâ and âcd ~/ecosconfig-buildâ
		b. â/opt/ecos/ecos-cvs/host/configure âwith-tcl-version=8.4 âprefix=/usr/localâ. Change the Tcl version to that you have installed, and prefix to where you want the resultant bins, includes and libs to end up in.
		c. âmakeâ and âsudo make installâ. (you should end up with ecosconfig in /usr/local/bin and some includes and libs in /usr/local/include and /usr/local/libs, repsectively

	3. Add âexport ECOS_REPOSITORY=/opt/ecos/ecos-cvs/packagesâ to ~/.bashrc. This is used by the ecosconfig tool, so we do not have to include the â-srcdir option all the time.
	
	4. To build the synthetic target (library):
		a. âmkdir ~/synth-buildâ and âcd ~/synth-buildâ
		b. âecosconfig  new linuxâ. This creates a new ecos.ecc
		c. Edit ecos.ecc: 
			i. Uncomment the âuser_valueâ line in the CYGBLD_GLOBAL_CFLAGS section
			ii. Remove the ââfinit-priorityâ option
			iii. add the â-fno-stack-protectorâ option
		d. âecosconfig treeâ
		e. âmakeâ
	
	5. To build the examples:
		a. âmkdir ~/examples-buildâ and âcd ~/examples-buildâ
		b. âcp /opt/ecos/ecos-cvs/examples/* .â
		c. âmake INSTALL_DIR=~/synth-build/installâ
		
If this is all successful, you can then execute â./helloâ, â./twothreadsâor â./simple-alarmâ to test.

I hope this helps others out there. Note I am running on andLinux Beta 1 (basically Ubuntu 7.10) and using GCC 4.1.3, binutils 2.18 and Tcl/Tk 8.4.


As an aside, it took me a while to 'grok' the way in which eCos is designed to be used. I think there is a need for a nice simple flow diagram of the process to help beginners. Something like:

eCos Source -> ecosconfig|configtool -> target.ecc -> ecosconfig|configtool -> target build tree -> make -> target library/includes

then

Application code -> make + directory of target library/includes -> Application binary

Important to note the following:
	- The original eCos source - whether from CVS or any snapshot - is basically read-only at all times when building targets and applications
	- Multiple targets can be 'extracted' and built from this one source
	- An application can easily be re-targeted simply by pointing to different target 'install' locations.

When I first looked at eCos, I was not thrilled by the naming scheme, and it was unclear to me how the system worked. The more I work it though, the more impressed I am in the modularity and customization ability of the system. Now, to build some applications...

Thank you,
Tyler

> -----Original Message-----
> From: Andrew Lunn [mailto:andrew@lunn.ch]
> Sent: Thursday, September 04, 2008 10:11 AM
> To: Tyler Wilson
> Cc: Bart Veer; ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] Linux Synthetic target problems
> 
> On Thu, Sep 04, 2008 at 07:02:31AM -0700, Tyler Wilson wrote:
> > Thank you both for the tips. I am trying to add the additional GCC
> flag,
> > but - being new to eCos (and not an expert in Linux either) - I do
> not
> > know the optimal way to integrate it.
> >
> > My understanding from working with eCos on the Windows side was that
> I
> > modify the install/include/pkgconf/ecos.mak file; specifically, the
> > ECOS_GLOBAL_CFLAGS. Then I do a 'make' at the root of the synthetic
> > build tree. But when I build, I do not see the compiler option listed
> in
> > the compiler output - it appears to be cut off after the
> > -fno-exceptions. Perhaps just the output is being truncated?
> >
> > Am I doing this right?
> 
> No. Modify CYGBLD_GLOBAL_CFLAGS in your configuration and then
> 
> ecosconfig tree
> make clean
> make
> 
>         Andrew

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]