From Xenomai
Jump to: navigation, search

Xenomai Example Repository

A set of small examples for programs and driver writers is maintained in the source code repository. To obtain it, check out directly from GIT:

git clone git://git.xenomai.org/xenomai-head.git xenomai-head

Then cd xenomai-head/examples to the examples folder and invoke

make XENO=<xenomai-installation-path> KSRC=<xenomai-kernel-source>

If you are cross-compiling, invoke

DESTDIR=<staging-directory-path> make XENO=<xenomai-installation-path> ARCH=<kernel-architecture> KSRC=<xenomai-kernel-source>


  • <staging-directory-path> is the path that was passed in the DESTDIR variable when running Xenomai user-space build system "make install";
  • <xenomai-installation-path> is the sub-directory of <staging-directory-path> which was passed as a parameter to the --prefix option of the Xenomai user-space build system configure script. You can omit the XENO variable is the xeno-config script is in the current search path.

This will build all examples in the subfolders. Alternatively, you can change to a specific subdir and start make directly there. KSRC specifies the Xenomai-enhanced Linux kernel you want to build the kernel space examples against. If you do not specify a path, the currently running kernel is used.

Each subdir in the repository that contains code also comes with a generic Makefile to build applications or drivers. It can be used as a starting point for own developments. All that has to be adopted in the common case is the Makefile head, specifically the APPLICATIONS and MODULES variables.

So, concretely, if you ran

configure --prefix=/usr/xenomai
make DESTDIR=/home/gilles/target-staging install

In order to compile the examples, you should run

DESTDIR=/home/gilles/target-staging make XENO=/home/gilles/target-staging/usr/xenomai ARCH=<kernel-architecture> KSRC=<xenomai-kernel-source>

Example Contributions

If you feel some topic is not yet covered by existing demos or if you want to contribute a helpful example code, please post your runnable source code to the mailing list. Alternatively, examples can be uploaded to this wiki, e.g. to a new article, and linked with this page.

Personal tools
Hardware Support