Xenomai is a real-time development framework cooperating with the Linux kernel, in order to provide a pervasive, interface-agnostic, hard real-time support to user-space applications, seamlessly integrated into the GNU/Linux environment.http://en.wikipedia.org/wiki/Xenomai
if you just want to try xenomai here is my latest image : xenomai.img
SHA-1 |
bb71b783d3d20edd58287eb1b0bf49bd5d9007de |
Default login |
Username: jed Password: jed |
Download the source tree and patches
On your Linux PC move to your home directory and download Chris Boot’s rpi-3.2.21 branch (https://github.com/bootc/linux/tree/rpi-3.2.21). and then get the patch provide by ian-cim rpi-linux-3.2.21-xenomai-2.6.1.patch
I advice you to used this cross-Compile tools : https://github.com/raspberrypi/tools
Configure your environnement
export linux_tree =/home/$USER/raspberry/linux
export xenomai_root =/home/$USER/raspberry/xenomai-2.6.1
export ARCH=ARM
export CROSS_COMPILE=arm-bcm2708-linux-gnueabi
Applying the patches for the Raspberry PI
Xenomai Patch
$xenomai_root/scripts/prepare-kernel.sh –arch=arm –adeos=$xenomai_root/ksrc/arch/arm/patches/ipipe-core-3.2.21-arm-1.patch –linux=$linux_tree
Raspberry PI Patch
cd $linux_tree
patch -p1 < rpi-linux-3.2.21-xenomai-2.6.1.patch
Configuring your Kernel
You can use my configuration kernel .config or custom it ( make menuconfig)
Make the kernel
You can now compile the actual kernel
make
The resulting kernel file is « linux/arch/arm/boot/Image »
Copy your Kernel
cp linux/arch/arm/boot/Image /media/<boot-partition-of-SD-card>/kernel.img
First Kernel starting
Linux version 3.2.21-ipipe (jed@jed-laptop) (gcc version 4.7.1 20120402 (prerelease) (crosstool-NG 1.15.2) ) #2 Thu Jul 26 09:59:17 CEST 2012
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: BCM2708
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 57344
free_area_init_node: node 0, pgdat c0406d64, node_mem_map c0486000
Normal zone: 448 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 56896 pages, LIFO batch:15
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 56896
Kernel command line: dma.dmachans=0x3c bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0x2 bcm2708.serial=0x21cf4cef smsc95xx.macaddr=B8:27:EB:CF:4C:EF dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
….
Compile Xenomai
$ cd $xenomai_root
$ ./configure –host=arm-bcm2708-linux-gnueabi
$ make DESTDIR=/destination/of/xenomai/ install
finally copy the files of Xenomai in the sdcard.
Configure your environnement
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/xenomai/lib
Test Xenomai
root@raspberrypi:~$ /usr/xenomai/bin/latency -p 100 -T 60
== Sampling period: 100 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up…
RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99)
RTH|—-lat min|—-lat avg|—-lat max|-overrun|—msw|—lat best|–lat worst
RTD| -6.000| -4.000| 8.000| 0| 0| -6.000| 8.000
RTD| -7.000| -4.000| 11.000| 0| 0| -7.000| 11.000
RTD| -7.000| -4.000| 11.000| 0| 0| -7.000| 11.000
RTD| -7.000| -4.000| 7.000| 0| 0| -7.000| 11.000
RTD| -6.000| -4.000| 8.000| 0| 0| -7.000| 11.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 11.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 11.000
RTD| -6.000| -3.000| 14.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 12.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 7.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 8.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 12.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 12.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 13.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 9.000| 0| 0| -7.000| 14.000
RTT| 00:00:22 (periodic user-mode task, 100 us period, priority 99)
RTH|—-lat min|—-lat avg|—-lat max|-overrun|—msw|—lat best|–lat worst
RTD| -6.000| -4.000| 14.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 6.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 7.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 9.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 8.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 14.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTT| 00:00:43 (periodic user-mode task, 100 us period, priority 99)
RTH|—-lat min|—-lat avg|—-lat max|-overrun|—msw|—lat best|–lat worst
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 7.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 9.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 9.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 8.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 7.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 9.000| 0| 0| -7.000| 14.000
RTD| -7.000| -4.000| 11.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 10.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 8.000| 0| 0| -7.000| 14.000
RTD| -6.000| -4.000| 13.000| 0| 0| -7.000| 14.000
—|———–|———–|———–|——–|——|————————-
RTS| -7.000| -3.000| 14.000| 0| 0| 00:01:00/00:01:00