Sample menu:


11 Juni 2014:
hart_0.4.6 released!

sourceforge project site »

CSS ist valide!

Valid XHTML 1.0 Strict Logo

RTAI navigation

Installation RTAI


UBUNTU 14.04 - 32 bit

Install the following packages to proceed:

Installation of all components

Installation 3.8.13 RTAI kernel

Taken from and
sudo su
cd /usr/src/
cvs co vulcano
ln -s vulcano rtai
git clone git://
cd linux-stable
git branch linux-3.8-rtai origin/linux-3.8.y
git checkout linux-3.8-rtai
git apply ../vulcano/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch
git commit -a -m 'applied the rtai patch hal-linux-3.8.13-x86-4.patch'
Download the newest debian package linux-image-3.8.0-42-generic_3.8.0-42.62~precise1_i386.deb (linux-lts-raring - 3.8.0-42.62~precise1) from and save it to /usr/src
sudo su
cd /usr/src
dpkg-deb -x linux-image-3.8.0-35-generic_3.8.0-42.62~precise1_i386.deb linux-image
cp linux-image/boot/config-* linux-stable/.config
cd linux-stable
make menuconfig
Important: It is needed to deselect "Module versioning support" under "Enable loadable module support".
In the next step, a linux-image and a linux-headers debian packages containing the rtai kernel will be generated:
make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-rtai
Now install linux-image package and the linux-header package with dpkg
cd /usr/src
sudo dpkg -i linux-image-3.8.13-rtai_3.8.13-rtai-{x}_i386.deb
sudo dpkg -i linux-headers-3.8.13-rtai_3.8.13-rtai-{x}_i386.deb
The number {x} depends on how many linux-image-3.8.13-rtai and linux-headers-3.8.13-rtai deb packages are in /usr/src.
Reboot in the new installed RTAI-kernel.
By using this command it is possible to check, if the right kernel was loaded after a reboot:
uname -r
The output of uname -r should now contain rtai.

RTAI ( first step without Comedi Addon

cd /usr/src/rtai
sudo make menuconfig
Ensure directories are correct:
sudo make
sudo make install
sudo sed -i 's/\(PATH=\"\)/\1\/usr\/realtime\/bin:/' /etc/environment
now run export PATH=/usr/realtime/bin:$PATH for each open shell or do logout and login


sudo su
cd /usr/local/src/

git clone git://
git clone git://


sudo su
cd /usr/local/src/comedilib
makev make install
mkdir /usr/local/include/linux


sudo su
cd /usr/local/src/comedi
./configure --with-linuxdir=/usr/src/linux-headers-3.8.13-rtai --with-rtaidir=/usr/realtime
make install
make dev

RTAI with Comedi Addon

sudo cp /usr/local/src/comedi/include/linux/comedi.h /usr/local/include/
sudo cp /usr/local/src/comedi/include/linux/comedilib.h /usr/local/include/
sudo ln -s /usr/local/include/comedi.h /usr/local/include/linux/comedi.h
sudo ln -s /usr/local/include/comedilib.h /usr/local/include/linux/comedilib.h

cd /usr/src/rtai
Under “Add-Ons”, select “Real Time COMEDI support in user space”
sudo make menuconfig
/usr/src/rtai/addons/comedi/Makefile Must be edited as followed:
EXTRA_CFLAGS += -I$(rtai_srctree)/base/include \
-I$(rtai_srcdir) \
-I/usr/include \
-I/usr/local/src/comedi/include \
-I$(src)/../../base/include \
-I$(src)/../.. \
$(rtai_extradef) \

obj-m += rtai_comedi.o

rtai_comedi-objs := $(rtai_objs)
make install

Starting RTAI

Now we need to load the rtai modules.
/sbin/insmod /usr/realtime/modules/rtai_smi.ko
/sbin/insmod /usr/realtime/modules/rtai_hal.ko
/sbin/insmod /usr/realtime/modules/rtai_lxrt.ko
/sbin/insmod /usr/realtime/modules/rtai_fifos.ko
/sbin/insmod /usr/realtime/modules/rtai_sem.ko
/sbin/insmod /usr/realtime/modules/rtai_mbx.ko
/sbin/insmod /usr/realtime/modules/rtai_msg.ko
/sbin/insmod /usr/realtime/modules/rtai_netrpc.ko
/sbin/insmod /usr/realtime/modules/rtai_shm.ko
Copy the lines to /usr/local/bin/start_rtai
Do a sudo chmod a+x /usr/local/bin/start_rtai Now we need to load the comedi modules.
cd /usr/local/src/comedi
make dev
cd ~
insmod /lib/modules/3.8.13-rtai/comedi/comedi.ko
insmod /lib/modules/3.8.13-rtai/comedi/kcomedilib/kcomedilib.ko
insmod /usr/realtime/modules/rtai_comedi.ko
insmod /lib/modules/3.8.13-rtai/comedi/drivers/comedi_fc.ko
comedi_config /dev/comedi0 your_comedi_card
chmod o+rw /dev/comedi*
chmod go+rw /dev/input/event*
Replace your_comedi_card with the name of your comedi card (e.g.: s626, jr3_pci, ....)
Copy the lines to /usr/local/bin/load_daq
Do a sudo chmod a+x /usr/local/bin/load_daq

SCILAB 5.5.0

sudo apt-get install scilab


(svn -version)

cd /usr/local/src
sudo svn checkout qrtailab
cd qrtailab
Edit qrtailab.config and replace '/usr/include/qwt/' with '/usr/include/qwt-qt4/' and '-lqwt' with '-lqwt-qt4'
sudo qmake-qt4
sudo make
sudo make install

HART Toolbox (

Chose a directory (/home/username/software, ...)

(svn -version)

svn checkout hart-code
Go in your hart-directory.
Edit Makefile and set 'SCILAB = ...' to the binary file of scilab 5.5.0
Warning: sudo make will not install RTAI module! Either be a normal user and install HART or change to root (using sudo su) and then do make.
cd /...../scilab-xxx/contrib
sudo ln -s {link to hart-toolbox} .

It is important to add -o to your rtai executable in order get a good realtime! The default setting uses the periodic mode. The hard timer will run in oneshot mode when using the "-o" options, which works better for same systems and slow sampling rates (<10kHz).

Gratulation you are finished!