0% found this document useful (0 votes)
584 views4 pages

Installing Xenomai On UBUNTU 12.04

This guide summarizes the steps to install Xenomai on Ubuntu 12.04 for real-time applications. It involves downloading and building Xenomai from source, compiling a new Linux kernel with Xenomai patches, and configuring the system to boot with the new real-time kernel. Key steps include installing dependencies, applying Xenomai patches, configuring the kernel for real-time, compiling and installing the new kernel packages, and updating boot settings. Basic testing can then be done using example programs from the Xenomai source.

Uploaded by

chdev007
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
584 views4 pages

Installing Xenomai On UBUNTU 12.04

This guide summarizes the steps to install Xenomai on Ubuntu 12.04 for real-time applications. It involves downloading and building Xenomai from source, compiling a new Linux kernel with Xenomai patches, and configuring the system to boot with the new real-time kernel. Key steps include installing dependencies, applying Xenomai patches, configuring the kernel for real-time, compiling and installing the new kernel packages, and updating boot settings. Basic testing can then be done using example programs from the Xenomai source.

Uploaded by

chdev007
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Installing Xenomai on Ubuntu 12.

04
To start, let me make clear that this guide is an adaptation of This guide by Jorge Azevedo and this guide by JHU-L !"# $erhaps you%re like me and during the course of your $h#&# 'ork it%s decided that you need to run a realtime (! for some high-speed and fi)ed-latency tasks# $erhaps you%re even more like me and 'hile you%re technically proficient, your e)perience 'ith *ni) kernel 'ork is none)istent+ This is a brief guide to get you up and running starting from a vanilla Ubuntu ,-#./ install to a custom kernel 'ith 0enomai and A1AL(23 &A4 drivers# The guide referenced above 'orks perfectly for Ubuntu ,.#./ and )enomai -#5#5#-, but if you%re 6ust no' setting up a realtime (! on a ne'ly purchased machine, you%re likely to find that some of your hard'are isn%t 'ell supported by that version of Ubuntu# 7t 'ould of course be possible to update drivers 6ust as you 'ould have to do 'ith 8indo's but ultimately it seemed easier, since this 'as a vanilla install, to simply bump up to ,-#./# 9eep in mind that 7 have been 'arned by other graduate students that the Unity interface possibly adds more latency than the previous 2nome versions but so far that hasn%t been apparent to me# (ne final note: 7 am not ;ualified at the moment to offer any particular insights as to 'hy one might choose 0enomai over "TA7, but 7 'ill say 0enomai seems dedicated to providing a more e)tensible support base for different interfaces bet'een the regular and realtime kernels# 0enomai <, 'hen it ever comes, seems to be re'riting that paradigm completely and possibly getting rid of the dualkernel mode of operation# Those 'ho 'ant a more ready-to-run e)periment lab setup for realtime operation might consider "T07# Ubuntu ,-#./ ships 'ith a fe' different kernels and the default active kernel is <#-#.--=# 0enomai stable -#>#-#, ships 'ith patches for kernels <#-#-,, <#/#>, <#5#?, and an adeos patch for <#.#<># 1ote that there is no kernel -#>#) support in this version of 0enomai# @y understanding of adeos is limited, but the gist is that it is a hard'are interface layer that sits underneath the larger Linu) kernel, using the same interrupt pipeline structure that 0enomai uses for real-time operation# !tarting at kernel <#-#. there are changes to the kernel and interrupt pipelines that mean 0enomai no longer needs to patch the adeos layer Aor no longer needs adeos at allBC# That aside, 'e%re going to be using kernel <#5#? and the appropriate 0enomai patch in this guide# 7 had no success patching the <#-#.--= kernel, your e)perience might be better# Getting Xenomai A1ote: !ome of this section is blatantly copied from the guide 7 linked above+C Dirst 'e%re going to get some packages necessary to do some of the necessary compiling tasks to make a ne' kernel# 7t is possible that this list is not as e)haustive as it could be, if at any point during this process a task errors out because it cannot find a particular program more than likely you 6ust need to apt-get it#
td@lab_td:/$ sudo apt-get install devscripts debhelper dh-kpatches autotools-dev autoconf automake libtool

1o' 'e%re going to do'nload 0enomai into our do'nloads folder, unzip it, and then go into the directory
td@lab_td:/$ cd ~/Downloads td@lab_td:~/Downloads$ mkdir xenomai td@lab_td:~/Downloads$ cd xenomai td@lab_td:~/Downloads/xenomai$ wget - http://download!gna!org/xenomai/stable/xenomai-"!#!"!$!tar!b%" & tar -'xf td@lab_td:~/Downloads/xenomai$ cd xenomai-"!#!"!$

The ne)t step is to actually build a debian package to EinstallF the )enomai patches# 1ote this step doesn%t really apply the patches in any manner but it &(G! set up some necessary directories, functionality, and puts library files 'here they need to be# &ebian package generation apparently re;uires some personal information to compile packages, but you could fill it in 'ith 'hatever you 'ant since 'e 'on%t be sharing this package#
td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ D()(*+,-./0our@email/ D()12--3+*(./4our 3ame/ debchange -v "!#!"!$ 5elease "!#!"!$ td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ debuild -uc -us td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ sudo dpkg -i !!/6!deb

The last line there actually installs the #deb packages created by the building process, but it 'ill install ALL of the debian packages in the directory# This is 'hy 'e made the E)enomaiF directory earlierH since the deb packages 'e 6ust built are put in the parent directory of the build location 'ithout this E)enomaiF directory buffer 'e 'ould inadvertently install any and all do'nloaded #deb packages# The easiest 'ay to verify that this 'as successful 'as to verify 'hich kernel patches 'ere installed is to actually check that they e)ist
td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ ls -$ /usr/src/kernelpatches/diffs/xenomai

This should give a list of patch files, verify that one is for kernel <#5#?+ Building a New Kernel Dirst 'e get some ne' packages# 1ote that the guide above also has you get 'hatever dependencies there are to build a kernel, but to do so you need to already have a kernel image#
td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ sudo apt-get install libncurses7dev kernel-package

1e)t 'e are going to get the kernel source# 3ou can put this any'here you 'ant, either in IusrIsrc or even in your &o'nloads folderH 7 put mine in do'nloads#
td@lab_td:~/Downloads/xenomai/xenomai-"!#!"!$$ cd ~/Downloads td@lab_td:~/Downloads/$ wget http://www!kernel!org/pub/linux/kernel/v8!x/linux8!7!9!tar!b%" td@lab_td:~/Downloads/$ tar -'xf linux-8!7!9!tar!b%" td@lab_td:~/Downloads/$ cd linux-8!7!9

This is 'here 'e diverge from the guide 7%ve been referencing# At that point installing the #deb packages placed some kernel patching scripts in
/usr/src/kernel-patches/i8:#/appl0/xenomai

ho'ever that no longer is the case# 1o' you must run a kernel prepare script that comes 'ith 0enomai#
td@lab_td:~/Downloads/linux-8!7!9$ ~/Downloads/xenomai/xenomai"!#!"!$/scripts/prepare-kernel!sh --arch.x:# ; --adeos.~/Downloads/xenomai/xenomai-"!#!"!$/ksrc/arch/x:#/patches/ipipe-core8!7!9-x:#-8!patch ; --linux.~/Downloads/linux-8!7!9

Gven though 'e%re not using an adeos patch, 'e still need to use the Jadeos option to define 8H7 H kernel patch to use+ As Adeos patches become less common, this option might become deprecated so if this guide becomes outdated please check the current 0enomai distribution notes# 8e%re almost there+ The ne)t step is to set all the kernel configuration options necessary for the system to do 'hat 'e 'ant# 8e could copy our current configuration file but menuconfig seems to

auto-population the kernel options 'ell enough to boot the computer 'ithout any issues#
td@lab_td:~/Downloads/linux-8!7!9$ make menuconfig

This 'ill present a graphical interface to change configuration options# There are 6ust a fe' items to focus on to ensure that the real-time system functions properly# There are a fe' specific things to verify and turn onIoff in this configuration# 7n this interface, selects an item and goes back , item#

Dour specific places 'e%d like to look#

8e need to change some A $7 settings#

The device drivers menu, 'e need to select Estaging driversF to find 'here to disable comedi#

&isable comedi drivers as these 'ill interfere 'ith analogy#

,# 7f there is no "eal-time subsystem listing, then the patches 'ere not applied properly# 2o into this and make sure that 0enomai is enabled, but it%s not necessary to tinker 'ith any of the numbers# If you want to use the N !"G# dri$er subsystem for % & 'ards( At the bottom of the "ealtime subsystem page, look for E&riversF, then EA1AL(23 &riversF# Gnable the A1AL(23 interface and then the appropriate driver for your &A4 card# @ore than likely you%ll have a 1ational 7nstruments card, so use the 17 $ 7@7( driver# -# Under $rocessor type and features, set your $rocessor family# !ome guides say to disable Efstack-protector buffer overflo' detectionF but so far my kernel is 'orking 'ith it enabled# $robably safer to disable it, but 7 forgot to# <# Under $o'er @anagement 'e need to change a fe' things+ 7 completely removed sleep and hibernate support 6ust as a precaution# 3ou can either outright disable A $7, or take the route 7 did and individually disable A $7 management of the $rocessor# Also disable $U Dre;uency !caling as 'e need the clock to be constant for real-time operation# /# If you are using N !"G# we must also disable 'omedi as it will steal the % & de$i'e. 2o: &evice &rivers JK !taging &rivers JK &isable E&ata Ac;uisition !upport AcomediCF# !ee attached images since the menu options can be a little difficult to find# (nce all this is done, e)it out of menuconfig and save your kernel #config file# 8e%re ready to go+ 8e%re no' going to compile the kernel#
td@lab_td:~/Downloads/linux-8!7!9$ < 3<255(3<4_-(=(-.9 fakeroot make-kpkg --b%image --initrd --append-to-version.-xenomai-"!#!"!$ kernel-image kernelheaders modules td@lab_td:~/Downloads/linux-8!7!9$ cd !! td@lab_td:~/Downloads/linux-8!7!9$ sudo dpkg -i linux-image-6!deb td@lab_td:~/Downloads/linux-8!7!9$ sudo dpkg -i linux-headers-6!deb

The first command may take some time to run, as it is doing a full kernel compile+ As before, make sure that you verify 'hen you run the linu)-image-*#deb and linu)-headers-*#deb installations that you are running the files appropriate for the )enomai kernel you 6ust created# onsider tabcompleting rather than using the 'ildcard to e)plicitly run the correct files+ 3ou%ve no' compiled and installed the kernel# 1o' 'e 6ust need to make sure that it gets booted appropriately ne)t time 'e restart#
sudo update-initramfs -c -k 8!7!9-xenomai-"!#!"!$ >> sudo update-grub

1e)t time you reboot you should be good to+ To test the functionality, use the trivial latency test program provided 'ith )enomai#
td@lab_td:/$ cd /usr/share/libxenomai-dev/examples/native/ td@lab_td:/usr/share/libxenomai-dev/examples/native/$ sudo make td@lab_td:/usr/share/libxenomai-dev/examples/native/$ sudo !/trivial-periodic

The results should be very close to ,...ms bet'een each instance# 7f they are very far off or the program fails to run at all then 0enomai is not properly configured+ Last Gdited: <I,5I-.,<

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy