- Get sources
- Linux kernel: wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.5.7.tar.bz2
- Xenomai: wget https://xenomai.org/downloads/xenomai/stable/xenomai-2.6.2.1.tar.bz2
- Unzip these sources (notice that these sources are in the same directory)
- tar jxvf linux-3.5.7.tar.bz2
- tar jxvf xenomai-2.6.2.1.tar.bz2
- Patch Linux kernel with Xenomai
- cd linux-3.5.7
- ../xenomai-2.6.2.1/scripts/prepare-kernel.sh
- choose CPU architecture [x86: i686]
- choose patch kernel: [../xenomai-2.6.2.1/ksrc/arch/x86/patches/ipipe-core-3.5.7-x86-3.patch]
- Notice: Xenomai has to include patch for the expected kernel version.
- Configure the kernel
- make xconfig -> GUI
- Required Options
- Real-time sub-system
- Xenomai : Enable
- Necleus: Enable
- Power management and ACPI options
- Run-time PM core functionality : Disable
- ACPI (Advanced Configuration and Power Interface) Support
- CPU Frequency scaling: Disable
- CPU Idle: Disable
- Processor type and features
- Processor famlily
- Core 2/newer Xeon: Check your system with
cat /proc/cpuinfo | grep family if return 6 set as Generic
- Optional options
- General setup
- Local Version: append to kernel resase: -xenomai-2.6.2.1
- Timer subsystem:
- High Resolution Timer Support: ON
- Processor type and features
- Processor famlily
- SMT (Hyperthreading) scheduler support (Disable)
- Preemption Model
- Voluntary Kernel Preemption (Desktop)
- Check some flags with search (Ctrl+F)
- CONFIG_XENO_SKIN_NATIVE: ON
- CONFIG _XENO_OPT_PERVASIVE: ON
- CONFIG_STACKPROTECTOR: OFF (NONE)
- Build the kernel
- sudo make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers -j $(nproc)
- Install Xenomai
- cd .. && ls to make sure some header and image debian (.deb) files exist.
- dpkg -i linux-headers-3.5.7-xenomai-2.6.2.1_3.5.7-xenomai-2.6.2.1-10.00.Custom_i386.deb
- dpkg -i linux-image-3.5.7-xenomai-2.6.2.1_3.5.7-xenomai-2.6.2.1-10.00.Custom_i386.deb
- Update grub
- sudo update-grub
- check kernel image at /boot directory
- Boot xenomai
- At Boot menu: Ubuntu * Advanced options for Ubuntu (Enter on it)
- Choose xenomai kernel
- Test Xenomai Run-time environment
- Check message that contains information about xenomai and
- Run test: sudo xeno latency (install apt-get install xenomai-runtime)
- Install Xenomai library
- Configure library:
- sudo ./scripts/bootstrap , if there is an error install some dependencies
- sudo apt-get install autoconf
- sudo apt-get install libtool
- ./configure
- Install library: sudo make install
- Test library with examples
- cd examples/native
- make
- ./trivial-periodic
- Some results
- Time since last turn: 999.998422 ms
- Time since last turn: 999.999733 ms
- Time since last turn: 1000.000439 ms
- Time since last turn: 999.999425 ms
- Time since last turn: 1000.001085 ms
- Time since last turn: 999.998952 ms
- Time since last turn: 999.999987 ms
- Time since last turn: 999.999915 ms
0 Comments