Host Setup
From HotDec
Realtime Library (RTAI-linux) setup
There are 2 packages needed to setup RTAI:
1. The vanilla source code for the linux kernel currently being used on the SBC (currently linux-2.6.15.3). The best place to get the linux source is probably [www.kernel.org]. The source code for the linux kernel usually comes archived and compressed with bzip2 (linux-2.6.15.3.tar.bz2) or compress gzip (linux-2.6.15.3.tar.gz). Usually the bzip2 compressed file is smaller.
2. The rtai source (currently we are using version rtai-3.3)
This documnent assumes that you are going to put the kernel sources in the /usr/local/src directory, it can be done from just about anywhere.
Unpack (and uncompress) the linux and rtai sources:
cd /usr/local/src tar xvjf linux-2.6.15.3.tar.bz2 tar xvjf rtai-3.3.tar.bz2
Patch the linux sources with the rtai patch the matches the linux kernel version and target architecture that is being patched.
cd /linux-2.6.15.3 patch -p1 < ../rtai-3.3/base/arch/i386/patches/hal-linux-2.6.15-i386-1.2-00.patch
Patching the code should print a listing of the files that it patched but it should not produce any errors. After patching is done the linux souce directory should probably be renamed so it is obvious that it has been patched.
cd .. mv linux-2.6.15.3 linux-2.6.15.3-rtai
Now you should configure the linux compilation options. You will probabbly want use the config from the SBC (see SBC Kernel Setup for more information) If you actually wanted to run a rtai-linux kernel on your machine, you would probably compile the kernel after configuring it, but if compiling the rtai libraries is the only goal, this should not be nessasary.
Now to setup rtai. It is best to use a seperate build directory for rtai, the build directory can be put anywhere, I put the build directory inside the rtai source folder.
cd /usr/local/src/rtai-3.3 mkdir build cd build make -f /usr/local/src/rtai-3.3/makefile menuconfig
There are some options that need to be set:
- General->Linux source tree = /usr/local/src/linux-2.6.15.3-rtai
- General->Enable source compatibility mode = yes
- Machine->Number of CPU's = 1
- Base system->Other features->C99 standard support = yes
After making the changes and exiting, make will run the configure script. The only problems I have had, are do a improperly setup linux source tree, if there is an error, verify that:
- The path to the linux source tree is correct
- The linux source tree was patched
- The .config file for the linux source tree is present
