RTAI and RTnet from Debian built-in packages

Automated installation on Debian

For installation from sources, go here.

RTAI modules create devices rtai_sham et rtf*. You need to add them to udev:
touch /etc/udev/rules.d/92-rtai.rules
Editer ensuite ce fichier comme suit :
ACTION!="add|change", GOTO="rtai_end"
KERNEL=="rtf*", MODE="0666"
KERNEL=="rtai*", MODE="0666"
Memlock Size
Amount of locked memory in address space is 32Kb under Debian. You need to increase it for real-time use. Edit /etc/security/limits.conf and add this line at the end:
* hard memlock 8192
Add user to src group
Add your user account to src group in order to have access to directory /usr/src
adduser your_user_name src
Close your session and then reconnect for changes applying.

Get sources packages
Use normal user account (non root account) for these steps.
mkdir rtai
cd rtai
Get and install built-in packages (Linux- with RTAI-3.7.1)
wget http://trainsim.ebvmultimedia.net/dl/librtai-dev_3.7.1-2_i386.deb
wget http://trainsim.ebvmultimedia.net/dl/librtai1_3.7.1-2_i386.deb
wget http://trainsim.ebvmultimedia.net/dl/linux-headers-
wget http://trainsim.ebvmultimedia.net/dl/linux-image-
wget http://trainsim.ebvmultimedia.net/dl/linux-source-
wget http://trainsim.ebvmultimedia.net/dl/rtai-doc_3.7.1-2_all.deb
wget \
wget http://trainsim.ebvmultimedia.net/dl/rtai-source_3.7.1-2_i386.deb
wget http://trainsim.ebvmultimedia.net/dl/rtai_3.7.1-2_i386.deb
dpkg -i librtai1_3.7.1-2_i386.deb
dpkg -i librtai-dev_3.7.1-2_i386.deb
dpkg -i linux-headers-
dpkg -i linux-image-
dpkg -i linux-source-
dpkg -i rtai_3.7.1-2_i386.deb
dpkg -i rtai-source_3.7.1-2_i386.deb
dpkg -i rtai-modules-
cd /usr/src/
ln -s linux-headers- linux

NOTE: If you have a multiprocessor computer (SMP system), dedicate last core/CPU to real-time tasks could increse performances. Edit /boot/grub/menu.lst and add parameter isolcpus at the end of RTAI kernel line. Paramter value is the number of last processor (counter start from 0) : 1 for dual-core, 3 for quad-core
kernel /vmlinuz- root=/dev/sda5 ro isolcpus=1
Reboot your computer.
Boot with RTAI kernel.

Regenerate Linux kernel dependancies
cd /usr/src/linux
cp Module.symvers Module.symvers.old
cat /usr/realtime/modules/Module.symvers >> Module.symvers
ln -s /usr/realtime/modules/ /lib/modules/
depmod -a
RTAI Tests
cd /usr/realtime/testsuite/user/latency; time ./run
cd /usr/realtime/testsuite/user/preempt/; time ./run
cd /usr/realtime/testsuite/user/switches/; ./run
cd /usr/realtime/testsuite/kern/latency/; time ./run
cd /usr/realtime/testsuite/kern/preempt/; time ./run
cd /usr/realtime/testsuite/kern/switches/; ./run



Perform RTAI installation first.
cd /usr/src
wget http://trainsim.ebvmultimedia.net/dl/rtnet-0.9.11.tar.bz2
tar xvjf rtnet-0.9.11.tar.bz2
cd rtnet
make menuconfig
Choose RTAI in configuration.
make install
run mknod /dev/rtnet c 10 240
/sbin/rtnet start