Let's make the world a better place using digital technologies!

Installing Xenomai on Ubuntu with Linux Kernel 2.6.25

You should have ~2-3GB free space to make the kernel and must have root privileges.

  • sudo su
    apt-get install subversion
    mkdir /usr/src/xenomai
    cd /usr/src/xenomai
    svn co svn://svn.gna.org/svn/xenomai/trunk xenomai
  • Goto www.kernel.org and download the latest kernel. At the time of writing:
    wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-
    bzcat linux- | tar -xf -
    ln -s linux- linux
  • cd xenomai
    ./configure --help
    to see the options and parameters.
    scripts/prepare-kernel.sh --linux=/usr/src/xenomai/linux
  • Configure the Linux kernel
    cd ../linux
    Copy the old configuration file, you may need to change the name depending on your kernel version:
    cp /boot/config- .config
    make menuconfig

    I chose the following options. Dis means pressing “n”(for no), and En means pressing “y” (for yes). When you get into Real-time sub-system section, you should closely read the messages on top. It will indicate if some un-recommended/conflicting options are set.

    Dis: Kernel IRQ Balancing
    Dis: APM
    Dis: CPU Freq Scaling
    Dis: CPU Idle PM Support
    Dis: Legacy Power Management
    Dis: HPET Timer
    Dis: ACPI Processor
    Dis: all deprecated from ACPI
    Dis: WMI
    Dis: Power Management Timer Support
    Dis: ACPI Container Driver
    En: Enable Periodic Timing -> RT Subsystem
    En: Scalability -> 0(1) Scheduler
    En: Enable SMI Workaround
    En: Globally Disable SMI
    En: POSIX API all enable
    En: Select support for RTDM file descriptors
    En: Serial Driver -> Any access mode
    Dis: Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4
    Dis: check for P4 thermal throttling interrupt.
    Dis: Enable kernel irq balancing
    Dis: Power Management Timer Support
    Dis: APM (Advanced Power Management) BIOS suppor
    Dis: All Interfaces except Native API and POSIX

  • make-kpkg clean
  • Make the new kernel, can take ca. 1 hour:
    CONCURRENCY_LEVEL=2 (on dual core processors)
    make-kpkg --initrd --append-to-version=-rtosx --revision=0.1 kernel_image kernel_headers

    Note:Do not use xeno in --append-to-version option as linux disregards xeno in some of its operations which creates a chaotic situation when finding proper /lib/modules/kernel_version folder.
  • Add modules so that splash screen/console can load at boot
    echo vesafb | tee -a /etc/initramfs-tools/modules
    echo fbcon | tee -a /etc/initramfs-tools/modules
  • Install the newly built kernel and headers:
    dpkg -i linux-image-
    dpkg -i linux-headers-
  • Type:
    cat /etc/grub/menu.lst
    to confirm that the new kernel has been properly entered into the list. If not, you may need to add it manually.
  • Boot with the new kernel:
    shutdown -r now
  • Build and install xenomai user-space components:
    cd /usr/src/xenomai
    mkdir build_root && cd build_root
    ../xenomai/configure --enable-x86-sep --enable-smp
    make -j4
    make install
  • Test the new Xenomai RTOS:
    cd /usr/xenomai/bin

    At the end of some tests, you should see the user-space RT latencies. Press Ctrl-C to exit the test.



View more posts from this author

Leave a Reply

Your email address will not be published. Required fields are marked *