Installation RTAI

Packages:

UBUNTU 9.04

Sources

LINUX (kernel.org)

cd /usr/src
sudo wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.9.tar.bz2
sudo tar xjvf linux-2.6.28.9.tar.bz2
sudo ln -s linux-2.6.28.9 linux

RTAI (https://www.rtai.org) (cvs-Version)

cd /usr/src
sudo cvs -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co magma
sudo ln -s magma rtai

RTAI (https://www.rtai.org) (tar.gz-Version)

You have to use a Version of 3.7 or newer, because older version are not compatible with gcc 4.3.3!
cd /usr/src
sudo wget --no-check-certificate https://www.rtai.org/RTAI/rtai-3.8.tar.bz2
sudo tar xjvf rtai-3.8.tar.bz2
sudo ln -s rtai-3.8 rtai

COMEDI (www.comedi.org)

cd /opt
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi login
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedilib
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi_calibrate
sudo cvs -d :pserver:anonymous@cvs.comedi.org:/cvs/comedi co comedi-nonfree-firmware

Scilab (www.scilab.org)

cd /opt
sudo wget http://www.scilab.org/download/4.1.2/scilab-4.1.2-src.tar.gz
sudo wget http://www.scilab.org/download/4.1.2/man-eng-scilab-4.1.2.zip

Scicoslab (www.scicoslab.org)

cd /opt
sudo wget http://cermics.enpc.fr/~jpc/scilab-gtk-tiddly/files/scicoslab-gtk_4.3-3_i386.jaunty.deb

QRTAILab (www.qrtailab.sf.net) (svn - version)

cd /opt
sudo svn co https://qrtailab.svn.sourceforge.net/svnroot/qrtailab/trunk qrtailab

QRTAILab (www.qrtailab.sf.net) (tar.gz - version)

cd /opt
sudo wget http://downloads.sourceforge.net/qrtailab/QRtaiLab-0.1.9.tar.gz
sudo tar xvzf QRtaiLab-0.1.9.tar.gz

Installation

Kernel

PATCH Linux Kernel

cd /usr/src/linux
sudo su
patch -p1 < /usr/src/rtai/base/arch/x86/patches/hal-linux-2.6.28.9-x86-2.2-07.patch

Configure Kernel

At first you should find out your architecture:
dpkg --print-architecture
for i386:
A sample config-file for i386 is available from here
cd /usr/src/linux
sudo wget http://hart.sourceforge.net/files/config-2.6.28-rtai_i386
sudo cp config-2.6.28-rtai_i386 .config
for amd64:
Sorry, there is no sample config file

Configure the kernel!

cd /usr/src/linux
sudo make menuconfig
run lspci on a separate console window, refer to it to select the appropriate option on the kernel configuration, mostly related to manufacturer (e.g.: SATA Controller from Intel or VIA)
Check and change if needed the following points:

Compile Kernel

cd /usr/src/linux
sudo make-kpkg clean
sudo make-kpkg --initrd kernel_image kernel_headers kernel_source

Install Kernel (i386)

cd /usr/src
sudo dpkg -i linux-headers-2.6.28.9-rtai_2.6.28.9-rtai-10.00.Custom_i386.deb
sudo dpkg -i linux-image-2.6.28.9-rtai_2.6.28.9-rtai-10.00.Custom_i386.deb

Install Kernel (amd64)

cd /usr/src
sudo dpkg -i linux-headers-2.6.28.9-rtai_2.6.28.9-rtai-10.00.Custom_amd64.deb
sudo dpkg -i linux-image-2.6.28.9-rtai_2.6.28.9-rtai-10.00.Custom_amd64.deb
Reboot in the new compiled RTAI-Kernel.
sudo reboot

RTAI #1

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

COMEDI

COMEDI

cd /opt/comedi
sudo sh autogen.sh
sudo ./configure --with-linuxdir=/usr/src/linux --with-rtaidir=/usr/realtime
sudo make
sudo make install
sudo make dev
Necassary for pcmcia-daq-cards:
sudo su
echo 'options comedi comedi_num_legacy_minors=4' > /etc/modprobe.d/comedi
exit

COMEDILIB

cd /opt/comedilib
sudo sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo mkdir /usr/local/include/linux

COMEDI-CALIBRATE

cd /opt/comedi_calibrate
sudo autoreconf -i -B m4
sudo ./configure
sudo make
sudo make install

RTAI #2

sudo cp /opt/comedi/include/linux/comedi.h /usr/local/include/
sudo cp /opt/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
sudo make menuconfig
Under “Add-Ons”, select “Real Time COMEDI support in user space”
sudo ./configure
sudo make
sudo make install
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. This is a example for the ni 6024e.
modprobe comedi
modprobe kcomedilib
modprobe comedi_fc
modprobe ni_mio_cs
insmod /usr/realtime/modules/rtai_comedi.ko
comedi_config -v /dev/comedi0 ni_mio_cs 0x0100
comedi_calibrate --calibrate
chmod a+rw /dev/comedi0
Copy the lines to /usr/local/bin/load_daq. Do a sudo chmod a+x /usr/local/bin/load_daq

Scicoslab/Scilab

Choose between Scicoslab and Scilab 4.1.2!

Scicoslab 4.3

cd /opt
sudo dpkg -i scicoslab-gtk_4.3-3_i386.jaunty.deb
cd /usr/src/rtai/rtai-lab/scicoslab/macros
sudo su
make install

SCILAB 4.1.2

cd /opt
sudo tar xvzf scilab-4.1.2-src.tar.gz
sudo unzip man-eng-scilab-4.1.2.zip
sudo mv man-eng-scilab-4.1.2 scilab-4.1.2/man/eng/
cd scilab-4.1.2
sudo ./configure --with-gfortran --with-tk --with-gtk2
sudo make all
sudo ln -s /opt/scilab-4.1.2/bin/scilab /usr/local/bin/scilab

QRTAILAB

If you use a tar.gz-version please replace qrtailab with qrtailab-x.x.x (x.x.x is the number of your installed version )
cd /opt/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
Gratulation you are finished!