[Home]Installation On Mandrake 9.1

Last edit: Peter Favrholdt on April 22, 2006 11:06 (4168 days, 7 hours and 52 minutes ago) (diff)
Rtai.Dk | RecentChanges | Preferences | DIAPM RTAI

Installation of RTAI-24.1.11 on Mandrake 9.1

1 After installing Mandrake 9.1

You have to download a so-called vanilla kernel, from kernel.org. I have used linux-2.4.20. You can also use another kernel as long as there exists a patch for that kernel in the RTAI source-tree. Then download the RTAI-source (in my case 24.1.11).

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.

2 Unpacking the sources and patching the Linux kernel

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)

3 Compiling the kernel

I have used gcc-2.95.3 as compiler and everything works fine. I have heard that you should be able to use gcc-3.2, but i have not have success with this compiler (i belive that the reason for this was some bad configuration of the linux kernel, i had enabled the kernel-hacking option. I have not tried this compiler without the kernel-hacking option). I have tried to use gcc-2.96 from mandrake but i gave some compiler-errors when compiling rtai, so i built my own gcc from gcc.gnu.org)

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.

4 Compiling RTAI

When your 'own' kernel is loaded you are ready to build RTAI. Go to the RTAI-folder:
 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).

5 Testing the RTAI installation

An easy way to test if your RTAI system works is to load it into the kernel:
 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.

6 My RTAI system hangs

If your RTAI system hangs, it could be caused some 'unlucky' combination of the kernel configuration and RTAI configuration. Try change your configurations. If this does not help, try ask the RTAI-mailing-list which can be found from http://www.rtai.org
Edit text of this page | View other revisions | Download Rtai.dk
Search: