Kenge : Eclipse-Howto
Eclipse on Iguana HowTo
Introduction
The Eclipse IDE equipped with
the C/C++ plugin CDT, is an
increasing popular development environment for embedded systems. This
document shows step-by-step how to configure Eclipse and CDT in order to
import the Iguana source tree as an Eclipse project, and then build and
run one of the Iguana examples from within Eclipse.
Most of the issues that need to be addressed stem from the fact that
Eclipse assume an hortodox Unix application development environment,
while Iguana, being aimed at highly configurable microkernel-based
systems, does some things differently.
In general, Eclipse assumes that CVS is the standard version control
system; CDT bases on Make, and expects the user level include files to
be in standard directories. Iguana instead uses GNU Arch as version
control system, SCons as build system, and the layout of its sources and
the position of the includes files are different from the typical Linux
system.
One consequence is, for example, that GNU Arch naming conventions
clash with Eclipse's workspace metadata files, and the tool
baz refuses to operate in the directory of an Eclipse
Project. Fortunately the tools on both sides are highly configurable,
and all the defaults values can be easily adapted to suit Iguana and
Kenge conventions. Assumptions
In this HowTo I will assume that:
- the proper development tools for Iguana/Kenge are installed as described here.
- you installed Eclipse 3.1.0 and CDT 2.1.1 (but other versions should work, too).
- ... and you already familiarized with all of them, separately.
Do not underestimate the last point. Eclipse, Iguana OS and the Kenge
system (GNU Arch, SCons etc.) are not trivial: trying to learn
any two of them at the same time can be a challenge.
I also assume that you are trying this on a GNU/Linux system, or
something similar. Any BSD Unix should work, but we heard that Mac OS X
may have issues with Python; hybrid environments like CygWin on Windows
may have issues, too, especially with GNU Arch file naming
conventions.
Step-by-Step How-To
- Move into the Eclipse workspace directory, typically with:
$ cd /home/<your_login>/workspace
- Check-out Kenge/Iguana from GNU Arch repository. Either get latest public release with:
$ baz get disy@cse.unsw.edu.au--2004/iguana-project--releases iguana-project
or get the -HEAD revision with:$ baz get disy@cse.unsw.edu.au--2004/kenge--mainline iguana-project
As usual, the -HEAD revision will contain the latest features and bug fixes, but may even not compile. - Populate the whole Iguana project tree:
$ cd iguana-project $ ./tla_config.sh iguana update [ lots of output ]
The instructions above differ from the official ones you can find here for two details:- the tool used to extract the initial Iguana archive is 'baz', new and recommended, and not 'tla', old and now deprecated.
- the baz/tla command to download the rest of Iguana is 'update', and not 'replay' (for the differences see the tools documentation).
- Create a new Eclipse Project.
File=>New=>Project... C++ => Standard Make C++ ProjectInsertIguana_Eclipseas the project name (or any other name that fancies you). Leave the default for Project contents.Do not click[Finish]. Click insteadNextto define some settings.In Tab[Projects], do nothing.In Tab[Make Builder], uncheck[Use default],This temporary hack will hardcode a proper set of parameters forsconsto build and possibly execute a standard Iguana demo:- as
[Build command]insertscons. - as
[Incremental Build]insertarch=arm config=iguana example=iguana - as
[Rebuild (Full Build)]insertarch=arm config=iguana example=iguana simulate - as
[Clean]insert-c
Note that theRebuildwill also run the code on the simulator.In Tab[Error Parsers], do nothing.In Tab[Binary Parsers], do nothing.In Tab[Discovery Options], uncheck[Automatic discovery of path and symbols]to disable it.In Tab[C/C++ Indexer], uncheck[Enable C/C++ Indexing]to disable it.Click[Finish]. - as
- Show C/C++ Projects with
Window => ShowView => C/C++ Projects - Select the project
Iguana_Eclipse, press the right mouse button, and selectImport...File System.. - Select the directory in the filesystem from which to import the full Iguana tree. If you followed this HowTo to the letter, it will be in the directory
~/workplace/iguana-project. - Pick all files. GNU Arch subdirectoryies like
{arch}and.arch-idswill be necessary for the revision control systems. - Click
[Finish]. The import of the Iguana tree into an Eclipse Project will now begin. - Once the import is finished the directory
iguana-projectcan be removed. Then move to the now populated Eclipse Project directorycd ../Iguana_Eclipse. - While Eclipse now can use this tree, some Eclipse metadata are not accepted by baz:
$ cd ~/workspace/Iguana_Eclipse $ baz lint These files violate naming conventions: .cdtproject .project
- Tweak
Iguana_Eclipse/{arch}/=tagging-methodto ignore the metadata files.project|.cdtprojectused by Eclipse/CDT.Add to the REGEX definition ofprecioustwo entries at the end, so that 'baz/tla' are not confused by Eclipse project metadata files that violate their naming conventions.# for Eclipse # precious ^(\+.*|\.gdbinit|\.#ckpts-lock|build|build\..*|=install\.*|CVS|CVS\.adm|RC S|RCSLOG|SCCS|TAGS|\.svn|\.sconsign.*|\.conf|\.project|\.cdtproject)$
- Configure the Eclipse ProjectWith the right button of the mouse select access the menu of the
Iguana_Eclipseproject from the View on the left.SelectPropertiesSelectInclude paths and symbolsSelectAdd Preprocessor Symboland- add the symbol
__ARM__ = TRUE. This is necessary across Pistachio source code found inpistachiodirectory and all Kenge libraries. - Click
Add Include path from workspaceand add the path toworkspace/iguana/libs.
Make sure thatIndexeris disabled, otherwise it will try to index{arch}subdirectories forever.Close thePropertieswindow -
- Show the
Targetview with Window=>Show View=>Make TargetOpen the context menu with the right mouse button, and selectAdd Make Target.If desidered, give a shorter name for the target, and close the window. - Build an image with Iguana and the exampleIn the
Make Targetsview select the just created Make Target, and with the right mouse button selectBuild Make Targetfrom the context menu. In the Console View should appear:scons arch=arm config=iguana example=demotr simulate scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... skyeye_sim(["simulate"], ["build/bootimg.dite"]) Simulating build/bootimg.dite
The output of the simulation will not appear on the Eclipse console. You should run the simulator from a standard shell, passing the boot image location["build/bootimg.dite"]as parameter.
Screenshots
Here is a huge screenshot of
Eclipse and the CDT plugin in action on the Iguana source code.
The Eclipse environment opened on some Iguana source files is in the
top half. In the bottom half a console is logged into the local build
server, Vampire. In Shell 2 the command
baz changes just
reported the changes made to the source opened in the Eclipse editor
with respect the version in the repository. Shell 1 (not visible) runs
the build image in the SkyEye ARM simulator on a local machine. 
