Compiling and Running Xenomai on a TQM5200 Board

Author

Context

Although our ELDK contains a
Xenomai-enabled kernel and a Xenomai RPM, it is of interest to show
how to compile and run Xenomai from freshly built sources.

We will use the ELDK 4.2 as the toolchain and we will install our new copy
of Xenomai into its NFS root filesystem to immediately test it out. So a
working installation of it is required in /opt/eldk-4.2

As usual for multiuser system, we'll be doing all the compiling below
the homedirectory, but any place should do really:

$ cd ~
$ mkdir xenomai-on-tqm5200
$ cd xenomai-on-tqm5200

Getting the sources

Get Xenomai

We'll use a fresh Subversion checkout for this application note, so
let's get it.

$ git clone git://git.xenomai.org/xenomai-2.5.git
$ cd xenomai-2.5

Let's see what the latest tag is:

$ git tag -l | tail -3
v2.5.5
v2.5.5.1
v2.5.5.2

Ok, so we'll use v2.5.5.2 by checking it out into a local branch named
just the same:

$ git checkout -b v2.5.5.2 v2.5.5.2

Get Linux kernel

To find out what kernel version is supported with xenomai, we'll take
a look at the directory containing the kernel patches:

As we know that tqm5200 is also supported in mainline, we'll go for
the 2.6.35.7 version. Although we use the DENX repository, we'll be
using an upstream tag, so essentially this will be a mainline linux
kernel. But first we need to clone the git repo itself:

$ git clone git://git.denx.de/linux-2.6-denx linux-2.6-xenomai

Bulding the Linux kernel and Xenomai

Prepare Linux kernel

Now we switch to the wanted tag:

$ cd linux-2.6-xenomai
$ git checkout -b v2.6.35.7 v2.6.35.7

Now setup the environment variables neccessary to use the ELDK
toolchain:

Install Xenomai

If you cannot write to the ELDK NFS root directory, you'll need to prepend
sudo -E to the following command line. If your sudo is configured to
reset PATH to conservative settings you can explicitely pass PATH by prepending
sudo -E PATH=$PATH

$ make DESTDIR=/opt/eldk-4.2/ppc_6xx install

Running it

Having prepared the Xenomai enabled kernel and the Xenomai userspace
inside the ELDK NFS, we can boot the new kernel and run a simple
Xenomai application, namely the version of
cyclictest
which comes with Xenomai.

Please note that details of booting are beyond the scope of this
application note and can be found in the general
DULG documentation.