Xenomai 2.3.0 on Ubuntu 6.10
March 3rd, 2007I have been developing with Xenomai on a real-time embedded project and just got around to getting my desktop system rigged up with Adeos and Xenomai. I had been primarily doing driver development on the embedded platform, so I didn’t need Xenomai on my PC. However, I am now working on more of the application layer and would really like to build first on the PC and then port to the embedded platform.
The first step is getting a Ubuntu kernel built with Xenomai/Adeos. I had some trouble getting the patched Ubuntu sources to take the Adeos patch without freezing during the boot process, so I went with vanilla 2.6.19 sources from Kernel.org and rolled them into a Debian package.
Step 1. Get pre-requisite packages
apt-get install build-essential
apt-get install kernel-package
apt-get install gcc
apt-get install libncurses5
apt-get install libncurses5-dev
(additional packages may be needed, but most will be available on a developer’s workstation)
Step 2. Download Sources
Download Xenomai 2.3.0, the Linux Kernel 2.6.19.7. Also grab the up-to-date Adeos patch for 2.6.19 from the Adeos site.
Step 3. Extract Files
Create a directory (as root) /usr/src/xenomai-kernel and extract the kernel and xenomai sources into this directory.
Step 4. Apply the Adeos Patch
cd /usr/src/xenomai-kernel/linux-2.6.19.7
patch -p1 < ../adeos-ipipe-2.6.19-i386-1.7-03.patch
Step 5. Add Xenomai to the Kernel
cd /usr/src/xenomai-kernel/xenomai-2.3.0
scripts/prepare-kernel.sh --linux=../linux-2.6.19.7 --arch=i386
Step 6. Configure Kernel
There are a number of configuration gotchas that are not all documented very well. What documentation does exist can be found in the Xenomai FAQ.
I found the following issues particular troublesome:
- Disable Frequency Scaling
- Disable HPET (there are two settings for this on different screens - grep the .config file for HPET if in doubt)
- Select a processor that is Pentium Classic or greater to get TSC support (user-land programs will complain loudly if not present). In particular, 586/K5/5×86/6×86/6×86MX is a less than ideal processor choice since it does not provide TSC.
The config that I used can be downloaded here. Copy it into the Linux source directory as “.config” and then run make menuconfig to customize.
Step 7. Build Debian Kernel Packages
From the Linux kernel directory run:
make-kpkg --initrd kernel_image kernel_headers
The two debs (one for the headers and one for the image) will be deposited in the parent directory.
Step 8. Install Packages
dpkg -i linux-image-2.6.19.7-adeos-xenomai2.3.0_2.6.19.7-adeos-xenomai2.3.0-10.00.Custom_i386.deb
dpkg -i linux-headers-2.6.19.7-adeos-xenomai2.3.0_2.6.19.7-adeos-xenomai2.3.0-10.00.Custom_i386.deb
I then edited /boot/grub/menu.lst to remove the quiet and splashscreen para