Note: See also the instructions for RTAI under OpenWrt.

The Bifferboard Slackware rootfs now supports compiling and running RTAI applications.

Kernel Modules

To use RTAI you will need to load some kernel modules. These are not found under /lib/modules but in a separate area under /usr/realtime:

# /sbin/insmod /usr/realtime/modules/rtai_hal.ko

# /sbin/insmod /usr/realtime/modules/rtai_lxrt.ko

# /sbin/insmod /usr/realtime/modules/rtai_fifos.ko

If there are any errors loading these, then it's probably because you are not running the right kernel. Make sure you flash the kernel from the rootfs tarball (/boot/bzImage) to your board before you start.

LED Blink Example

I've devised a trivial realtime application that blinks the red LED off and on at a fixed rate. Of course you could do this using a shell script and visibly the effect would be much the same, however because the task is realtime, other tasks, like ethernet and disk access cannot interrupt it, so once you decrease the period to a very small interval it will still give consistent timing, within the limits of the interrupt latency for this platform. No matter how much you load the system, this task should continue to execute at fixed rate.

In order to compile, you will need to add "/usr/realtime/lib" to /etc/ld.so.conf, and run 'ldconfig', to allow gcc to find the realtime libraries.

POV Experiment

Coming soon!

Building RTAI from source

Hopefully the binary RTAI libraries and kernel modules provided will be OK as they are, but I've attached the sources I've used to create the Slackware tarball. You will need to disable any RTAI features using TSC (Time Stamp Counter) instruction, and I've reduced slightly the RTAI heap allocation to reflect the small memory on the Bifferboard. Otherwise it's a fairly standard install.