RTAI Installation Guide - Installation of RTAI-3.0r4 with Kernel 2.4.25:
UPDATE:
Meanwhile RTAI 3.1, RTAI 3.2 were released (RTAI 3.3 is coming soon) and kernel 2.4.32 is the most
recent 2.4 kernel. The installation process is unchanged and the instructions below apply to any recent RTAI and kernel versions.
Unpack the kernel source:
# cd /usr/src
# tar xvjf linux-2.4.25.tar.bz2
# ln -s linux-2.4.25 linux
Unpack RTAI to /usr/src/rtai-3.0r4 and
# ln -s rtai-3.0r4 rtai
Patch the kernel:
# cd /usr/src/linux
# patch -p1 < ../rtai/rtai-core/arch/i386/patches/hal12-2.4.25.patch
Copy the existing (debian) kernel config file to /usr/src/linux
# cp /boot/config-2.4.25-xxx /usr/src/linux/.config
Configure the kernel:
# make menuconfig
(you need to "make menuconfig" even if you accept the default config!)
Make sure that
- "Adeos" is selected
- "Loadable module support -> Set version information on all module symbols" is disabled
- If you use an existing kernel dot config file, see troubleshooting below.
Compile the kernel:
# make dep
# make bzImage
# make modules
# make modules_install
Install the kernel:
# cd /usr/src/linux
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.25-adeos
# cp System.map /boot/System.map-2.4.25-adeos
Make the initial RAM-disk (if you need one):
# mkinitrd -o /boot/initrd.img-2.4.25-adeos 2.4.25-adeos
( /boot/initrd.img-2.4.25-adeos = file to generate
2.4.25-adeos = directory to grab modules from (/lib/modules/x.x.x-x) )
Modify LILO or GRUB for the new kernel
After the kernel is compiled and installed successfully, compile RTAI:
# cd /usr/src/rtai
# make menuconfig
If you want to do some serial port I/O enable "Add-ons -> Serial line driver"
(if you're new to RTAI just accept the default config - after saving the
config wait until all configuration is done)
# make
# make install
If no errors occured, reboot now, select the new kernel from the GRUB menu.
To test RTAI:
# cd /usr/realtime/testsuite/kern/latency/
# ./run
Now you should see some min. max. latency output.
TROUBLESHOOTING:
☯ If you get this error when running /usr/realtime/testsuite/kern/latency/run:
Error opening /dev/rtf/0
-or- Error opening /dev/rtf/1
-or- Error opening /dev/rtf/2
-or- Error opening /dev/rtf/3
-or- Error opening /dev/rtf/4
-or- Error opening /dev/rtf/5
-or- Error opening /dev/rtf/6
-or- Error opening /dev/rtf/7
-or- Error opening /dev/rtf/8
-or- Error opening /dev/rtf/9
then have a look if /dev/rtf exists (probably not) and if there are any nodes in it.
If there are no nodes, create this shell script and run it:
#!/bin/bash
mkdir /dev/rtf
for n in `seq 0 9`
do
f=/dev/rtf/$n
mknod -m 666 $f c 150 $n
done
The nodes actually should have been created during "make install", but in case...
If /dev/rtf0 to /dev/rtf9 and /dev/rtai_shm are missing aswell
Error opening /dev/rtf0
-or- Error opening /dev/rtf1
-or- Error opening /dev/rtf2
-or- Error opening /dev/rtf3
-or- Error opening /dev/rtf4
-or- Error opening /dev/rtf5
-or- Error opening /dev/rtf6
-or- Error opening /dev/rtf7
-or- Error opening /dev/rtf8
-or- Error opening /dev/rtf9
-or- Error opening /dev/rtai_shm
run this script:
#!/bin/bash
mknod -m 666 /dev/rtai_shm c 10 254
for n in `seq 0 9`
do
f=/dev/rtf$n
mknod -m 666 $f c 150 $n
done
☮ "Unresolved Symbol error" in "make modules_install" at depmod:
if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.4.25-adeos; fi
depmod: *** Unresolved symbols in /lib/modules/2.4.25-adeos/kernel/drivers/ide/ide-core.o
depmod: init_cmd640_vlb
I solved this by compiling the ide support into the kernel and not as modules:
ATA/IDE/MFM/RLL support ---> [*] ATA/IDE/MFM/RLL support
IDE, ATA and ATAPI Block devices --->
<*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
<*> Include IDE/ATA-2 DISK support
☯ If you use an existing kernel dot config file, make sure you set the CPU >= 486:
configure: error: RTAI won't work on legacy i386 platforms (cmpxchg() is missing, need >= CONFIG_M486)
⌘ If you get this while configuring RTAI with "make menuconfig"
configure: error: Please unset CONFIG_MODVERSIONS for /usr/src/linux and rebuild your kernel
you didn't disable "Loadable module support -> Set version information on all module symbols".
If you get this error:
RTAI[hal]: ERROR, LOCAL APIC CONFIGURED BUT NOT AVAILABLE/ENABLED
pass "lapic" to the kernel in grub. e.g.:
title RTAI 3.2 kernel 2.6.10
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-adeos root=/dev/hda1 ro lapic
savedefault
boot
For further details see the Kernel Compilation HowTo!
Last-Modified: Sat, 04 Feb 2006 16:13:52 GMT