Installation On Mandrake 9.1
Everything written in bold should be typed in a shell. Your need to be logged in as root/superuser when installing RTAI. In a shell just type :
su and then type the password for the root/superuser.
Unpack the source to an appropriate folder (i.e. /usr/src/).
tar -zxf rtai-24.1.11.tgz /usr/src/ (this puts the rtai-source into /usr/src/rtai-24.1.11).
I have made a link called rtai that points to my rtai-source (this makes it a bit easier if you want to use several rtai-versions). This is done by
ln -s /usr/src/rtai-24.1.11 /usr/src/rtai
The same thing is done for the Linux kernel:
tar -zxf linux-2.4.20.tar.gz /usr/src/ (this puts the linux kernel-source into /usr/src/linux-2.4.20)
I have made a link called linux that points to my linux kernel-source (this makes it a bit easier if you want to use several kernel-versions).
This is done by:
ln -s /usr/src/linux-2.4.20 /usr/src/linux
Now you are ready to patch the linux kernel with RTAI. Go the to linux folder:
cd /usr/src/linux
Patch the kernel (make sure that the patch you are using corresponds the version of the linux kernel)
patch -p1 <../rtai/patches/patch-2.4.20-rthal5g
You can also choose to use the patch called patch-2.4.20-adeos-r6. Then you will be using adeos, which seems to be the future of RTAI (which can have some bugs)
When your kernel is patched you are ready to compile your 'own' kernel. Before you are able to compile it, you need to configure it. Make sure not to use any power management as it seems to 'disturb' RTAI. I have also discovered (the hard way) that you should not enable the Kernel-hacking option (offering some debug features for kernel modules etc.)
There are several ways to configure your kernel, both in text mode and i graphical mode. I prefer to use graphical mode (menuconfig). In the /usr/src/linux folder do :
make menuconfig
You can get some information on every option in the kernel by pressing the ?-key.
My .config-file is here: /config
To find the dependencies for your configured kernel:
make dep
Now you can start the build of the kernel:
make bzImage
Then make the modules for the kernel:
make modules
And install these modules:
make modules_install
Now you are ready to make your kernel visible for the bootmanager (lilo). The easiest way to do this is:
make install
This copies/moves the /usr/src/linux/arch/i386/boot/bzImage to /boot/'kernel-name' where 'kernel-name' in my case is 2420-rthal5. Run lilo to make sure that there is no problems for the bootmanager:
lilo
Now you are ready to reboot the computer and start your self-compiled kernel.
cd /usr/src/rtai
Change to root/superuser: su
The RTAI needs to be configured (like you did to the linux kernel). This is done by:
make menuconfig
Make sure not to configure your RTAI to SMP if your kernel is UP (and vice versa).
To find the dependencies for RTAI :
make dep
Build RTAI:
make
Now you need to configure what kind of scheduler (UP, SMP, NEWLXRT) you want to RTAI to use:
./setsched up for using the UP-scheduler.
To install RTAI : make install
To create the rt-fifos:
make dev
Now you should have a functional RTAI system (if none of the above went wrong).
cd /usr/src/rtai/modules and insmod rtai.o
If the system does not hang here, your RTAI should be installed properly. To test your RTAI system furthermore you can run the examples found in /usr/src/rtai/examples.
Every example has a README-file describing the actual purpose of the example.