Realtime Linux Projects
There are a number of projects underway to augment the linux operating system with a Realtime subsystem. All of the projects below claim to have some support for the ARM:
- RTAI is the 'Real Time Application Interface' started by Paolo Mantegazza at Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano (DIAPM).
- Xenomai was started by Philippe Gerum. At one time it was part of RTAI (the RTAI/fusion branch) but has since split away again. Xenomai provides a core RT API on top of which various 'skins' can be written to provide APIs similar to those used by other RTOSs.
RTLinux is available as a commercial product (RTLinuxPro) available for both Linux 2.4 and 2.6 kernels, or as a GPL'd version available for 2.4 kernels only. Todo: mention patent issue.
Cambridge University Department of Engineering looked at the possibility of using RTAI on a Balloon 2 board back in October 2005. Eventually, of the six tests in the RTAI test suite, two worked. Of the four that did not work, all three of the 'user space' tests failed with 'illegal instruction' errors - probably due to the RTAI/Adeos syscall interface not working, and the final test involved using floating point code in the kernel.
The work was done using RTAI version 3.2. This version appeared at about the when the RTAI code base was modified to use the Adeos nanokernel instead of the 'RTHAL' for interrupt interception, RTAI was about to split with Xenomai, and RTAI was dropping support for the StrongARM.
The work involved solving two separate problems.
- Applying the Adeos kernel patch the the Balloon's customised Linux kernel
- Putting StrongARM support back into RTAI 3.2
Since the work was done the Linux Kernel has been through several updates, the Adeos nanokernel has been updated (and there is now a cut-down version: ipipe aimed at providing just enough support for a RTOS and nothing more) and Xenomai is now a separate project again. The patches to the kernel and to RTAI are available below in case anybody finds them useful.
Adeos kernel patch: linux-184.108.40.206-tcl1-adeos.patch
- This patch adds the Adeos nanokernel to the linux kernel. It should patch cleanly against linux-220.127.116.11-tcl1. It was based on the pxa255_2.6.7-bk6-karo.patch available in the RTAI sources. It may prove useful to anybody who wants to port the latest version of Adeos to the latest version of the Balloon Linux kernel (or any other StrongARM/PXA Linux kernel).
RTAI patch - Todo
- This patch puts back support for the StrongARM processor (which was removed between RTAI 3.1 and 3.2) and attempts to fix a number of bugs that resulted user space code attempting to link to kernel functions (as a result of inline function definitions borrowed from the linux kernel headers expanding to actual function calls on the ARM but which would merely be one or two inline assembler instructions on an i386). RTAI is quite challenging to cross compile. It uses both autoconf and Kconfig and really needs to be compiled with exactly the same cross compiler as the kernel. It also needs to know the location of you linux kernel sources.
Watch this space...