Difference between revisions of "Xenomai"

From ArmadeusWiki
Jump to: navigation, search
(moved to manual installation page)
(Xenomai is now integrated in our Buildroot)
Line 14: Line 14:
 
a fairly simple process.
 
a fairly simple process.
  
==Compilation==
+
==Explanation of the process used to install Xenomai==
  
===Xenomai kernel space support===
+
The main steps are:
 +
* selection of Xenomai package on the buildroot menuconfig.
 +
* Selection Kernel features.
 +
* Compilation of the new version.
 +
* Validation of Xenomai behaviour.
  
Xenomai is a co-kernel cooperating with Linux. This suite is made of two parts :
+
==Adding Xenomai==
* The Xenomai kernel: It is provided as a patch to the regular Linux kernel and can be compiled as a full part of the kernel or as a regular module.
+
* Xenomai user space data: This set of file contains:
+
** header files used to compile Xenomai applications
+
** Binary files to validate and measure the performace of Xenomai
+
  
This section describe how to compile the kernel space for Xenomai.
+
First of all, you need to select Xenomai package on buildroot menu:
 +
<pre class="host">
 +
$ make menuconfig
 +
</pre>
 +
In <b>''Package Selection for the target ---> ''</b> menu, you must enable <b>xenomai</b>
  
Here we will patch the Armadeus Linux kernel to add Xenomai features.
+
==Xenomai kernel space support==
This is automatically done via the Xenomai script ''prepare-kernel.sh''
+
 
+
$ cd $ARMADEUS_ROOT/xenomai/xenomai-2.4.3
+
$ ./scripts/prepare-kernel.sh --linux=$ARMADEUS_ROOT/buildroot/build_arm/linux-2.6.24.3/ --arch=arm
+
 
+
* ''--linux'' is used to specify which kernel we want to patch
+
* ''--arch'' is used to specify for which platform we want to patch (arm in our case)
+
  
 +
In a first time for having kernel patched with Xenomai and Adeos patch, you must type :<br>
 +
<pre class="host">
 +
$ make
 +
</pre>
 +
It's not necessary to wait for the complete compilation. After patch phase you could stopping the compilation with Ctrl-C command.<br>
 +
 
Let's configure the Xenomai kernel :
 
Let's configure the Xenomai kernel :
 
+
<pre class="host">
$ cd $ARMADEUS_ROOT
+
 
  $ make linux26-menuconfig
 
  $ make linux26-menuconfig
 +
</pre>
  
 
You should see the new entry :
 
You should see the new entry :
 +
<pre class="config">
 
  Real-time sub-system  --->
 
  Real-time sub-system  --->
 +
</pre>
  
 
Enter in it and check the following to compile Xenomai as a part of the Linux kernel :
 
Enter in it and check the following to compile Xenomai as a part of the Linux kernel :
 +
<pre class="config">
 
  [*] Xenomai
 
  [*] Xenomai
 
   <*> Nucleus  
 
   <*> Nucleus  
Line 62: Line 68:
 
       Interfaces  --->
 
       Interfaces  --->
 
       Drivers  --->
 
       Drivers  --->
 +
</pre>
  
Additionaly, to enable / disable the different available skins, go into "''Interfaces  --->''" :
+
Additionaly, to enable / disable the different available skins, go into <b>''Interfaces  --->''</b> :
 +
<pre class="config">
 
  <*> Native API  --->
 
  <*> Native API  --->
 
  <*> POSIX API  --->
 
  <*> POSIX API  --->
Line 72: Line 80:
 
  < > RTAI emulator  --->
 
  < > RTAI emulator  --->
 
  <*> Real-Time Driver Model  --->
 
  <*> Real-Time Driver Model  --->
 +
</pre>
  
Finally, compile Xenomai:
+
Finally, compile everything:
$ make
+
<pre class="host">
 
+
===Xenomai User Space support===
+
 
+
Because we need to cross compile Xenomai applications for ARM, we will use the
+
cross compilations tools provided by Armadeus/Buildroot.<br />
+
 
+
Let's update our PATH accordingly :
+
$ export PATH=$ARMADEUS_ROOT/buildroot/build_armv4t/staging_dir/bin:$PATH
+
 
+
We are now ready to start the user space compilation.
+
 
+
First, let's configure Xeno and create the makefiles :
+
$ cd $ARMADEUS_ROOT/xenomai/xenomai-2.4.3
+
$ ./configure --enable-arm-mach=imx --host=arm-linux --datarootdir=/xenodoc
+
 
+
* ''--enable-arm-mach'' : We want to build Xeno for the i.MX (ARM) architecture
+
* ''--host'' :  Prefix used for all compilation tools
+
* ''--datarootdir'' :
+
 
+
Finally, compile user space utilities.
+
 
  $ make
 
  $ make
 +
</pre>
  
 
==Deploy==
 
==Deploy==
 
First, install Xenomai data in $ARMADEUS_ROOT/xenomai/root-dirs/target
 
$ cd $ARMADEUS_ROOT/xenomai/xenomai-2.4.3
 
$ make DESTDIR=$ARMADEUS_ROOT/xenomai/root-dir install
 
 
 
This command will install all Xenomai data in $ARMADEUS_ROOT/xenomai/root-dir.
 
Have a look in this directory. Note that it contains two sub directories,
 
''xenodoc'' and ''usr''. ''xenodoc'' contains all documentation regarding
 
Xenomai. As said previously, we will not copy xenodoc on the board.
 
Instead, we will only transfert the required files to run Xeno applications
 
on the APF. These files are located under ''usr/xenomai''.
 
 
 
Before modifying the board's root filesystem, we will first make a backup of it.
 
$ cp -R $ARMADEUS_ROOT/buildroot/project_build_armv4t/apf9328/root $ARMADEUS_ROOT/buildroot/project_build_armv4t/apf9328/root.orig
 
 
We can now copy Xeno data to the board's root filesystem:
 
$ cp -R $ARMADEUS_ROOT/xenomai/root-dir/usr/* $ARMADEUS_ROOT/buildroot/project_build_armv4t/apf9328/root/usr/
 
 
And generate the target filesystem
 
$ cd $ARMADEUS_ROOT
 
$ make
 
  
 
You can now [[Target_Software_Installation | transfer]] the rootfs and the kernel
 
You can now [[Target_Software_Installation | transfer]] the rootfs and the kernel
Line 130: Line 97:
  
 
You can double check Xeno is installed correctly :
 
You can double check Xeno is installed correctly :
 +
<pre class="apf">
 
  $ dmesg | grep Xenomai
 
  $ dmesg | grep Xenomai
 
   I-pipe: Domain Xenomai registered.
 
   I-pipe: Domain Xenomai registered.
Line 137: Line 105:
 
   Xenomai: starting POSIX services.
 
   Xenomai: starting POSIX services.
 
   Xenomai: starting RTDM services.
 
   Xenomai: starting RTDM services.
 +
</pre>
  
 +
Now we can run the performance test provided by Xenomai:
 +
<pre class="apf">
 +
$ xeno-test
 +
</pre>
  
We will now update our environment to add Xenomai features. On the APF, run the following commands:
+
==Deinstalling or disabling Xenomai==
$ export LD_LIBRARY_PATH=/usr/xenomai/lib:$LD_LIBRARY_PATH
+
There are two part needed for disabling Xenomai features
$ export PATH=/usr/xenomai/bin:$PATH
+
===Kernel===
 +
For disabling kernel part, two solutions are available
  
To make the changes permanent, add ''/usr/xenomai/lib'' to ''$ARMADEUS_ROOT/buildroot/project_build_armv4t/apf9328/root/etc/ld.so.conf''
+
The first solution is to unselect kernel's features :
 +
<pre class="host">
 +
$ make linux26-menuconfig
 +
</pre>
 +
In <b>''Real-time sub-system ---> ''</b> menu, you must disable <b>Xenomai</b><br>
 +
and in <b>''Kernel Features ---> ''</b> menu, disable <b>Interrupt pipeline</b>
  
Now we can run the performance test provided by Xenomai:
+
The second solution is to destroy the kernel tree :
  $ xeno-test
+
<pre class="host">
 +
  $ make linux26-dirclean
 +
</pre>
 +
 
 +
===Software===
 +
For disabling software part :
 +
<pre class="host">
 +
$ make menuconfig
 +
</pre>
 +
In <b>''Package Selection for the target ---> ''</b> menu, you must disable <b>Xenomai</b>
 +
and use the clean command
 +
<pre class="host">
 +
$ make xenomai-dirclean
 +
</pre>
  
 
==Links==
 
==Links==
 +
* [http://http://home.gna.org/adeos/ Adeos website]
 
* [http://www.xenomai.org Xenomai website]
 
* [http://www.xenomai.org Xenomai website]
 
* [[Adeos | Adeos installation]]
 
* [[Adeos | Adeos installation]]

Revision as of 16:54, 11 March 2009

Page under construction... Construction.png Informations on this page are not guaranteed !!

What is Xenomai ?

Xenomai is a real time co-kernel which cooperate with Linux via Adeos. With its help hard real time applications can be developped and run on the Armadeus boards.

Thanks to Adeos, Xenomai will receive the interrupts first and decide to handle them or not. If not, they will then be transfered to the regular Linux kernel. Also, Xenomai provides a framework to develop applications which can be easily moved between the Real Time Xenomai environment and the regular Linux system. Moreover, Xeno provides a set of APIs (called "skins") that emulate traditional RTOSes such as VxWorks and pSOS and implement other APIs such as POSIX. Thus, porting third party real time applications to Xenomai is a fairly simple process.

Explanation of the process used to install Xenomai

The main steps are:

  • selection of Xenomai package on the buildroot menuconfig.
  • Selection Kernel features.
  • Compilation of the new version.
  • Validation of Xenomai behaviour.

Adding Xenomai

First of all, you need to select Xenomai package on buildroot menu:

 $ make menuconfig

In Package Selection for the target ---> menu, you must enable xenomai

Xenomai kernel space support

In a first time for having kernel patched with Xenomai and Adeos patch, you must type :

 $ make

It's not necessary to wait for the complete compilation. After patch phase you could stopping the compilation with Ctrl-C command.

Let's configure the Xenomai kernel :

 $ make linux26-menuconfig

You should see the new entry :

 Real-time sub-system  --->

Enter in it and check the following to compile Xenomai as a part of the Linux kernel :

 [*] Xenomai
   <*> Nucleus 
   [*]   Pervasive real-time support in user-space
   [ ]     Interrupt shield support
   [*]     Priority coupling support
   [*]   Optimize as pipeline head
   (32)  Number of pipe devices
   (512) Number of registry slots
   (128) Size of the system heap (Kb)
   (32)  Size of the private stack pool (Kb)
   [*]   Statistics collection
   [ ]   Debug support
   [ ]   Shared interrupts
      Timing  --->
      Scalability  --->
      Machine  --->
      Interfaces  --->
      Drivers  --->

Additionaly, to enable / disable the different available skins, go into Interfaces ---> :

 <*> Native API  --->
 <*> POSIX API  --->
 < > pSOS+ emulator  --->
 < > uITRON API  --->
 < > VRTX emulator  --->
 < > VxWorks emulator  --->
 < > RTAI emulator  --->
 <*> Real-Time Driver Model  --->

Finally, compile everything:

 $ make

Deploy

You can now transfer the rootfs and the kernel on the APF.

Validate the installation

Boot the APF and logon as root.

You can double check Xeno is installed correctly :

 $ dmesg | grep Xenomai
  I-pipe: Domain Xenomai registered.
  Xenomai: hal/arm started.
  Xenomai: real-time nucleus v2.4.3 (Back to Shalla-Bal) loaded.
  Xenomai: starting native API services.
  Xenomai: starting POSIX services.
  Xenomai: starting RTDM services.

Now we can run the performance test provided by Xenomai:

 $ xeno-test

Deinstalling or disabling Xenomai

There are two part needed for disabling Xenomai features

Kernel

For disabling kernel part, two solutions are available

The first solution is to unselect kernel's features :

 $ make linux26-menuconfig

In Real-time sub-system ---> menu, you must disable Xenomai
and in Kernel Features ---> menu, disable Interrupt pipeline

The second solution is to destroy the kernel tree :

 $ make linux26-dirclean

Software

For disabling software part :

 $ make menuconfig

In Package Selection for the target ---> menu, you must disable Xenomai and use the clean command

 $ make xenomai-dirclean

Links