Step by step instructions for patching and installing a Realtime kernel. These instructions work verbatim on fedora core 3, but should work on almost any Linux distribution without too much effort. Based mostly on the Kernel-Build-HOWTO found at http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html and on tldp.org if you're lucky. Also see "installing RTAI 3.0" at http://www.fdn.fr/~brouchou/rtai/rtai-doc-prj/installation-guide.html This document assumes a fast internet connection and some basic knowledge of Linux.. If you don't already have a system up and running that you need to install emc on, you should go with the BDI distro instead, even if you already know how to do all of this in your sleep. Get the Kernel and RTAI SourcesYou need to get the "vanilla" kernel source code: version 2.6.10 is the latest version that RTAI has patches for. (well, not any more it ain't - oh well)
and its signature:
and RTAI and the associated kernel patches:
and a bunch of other stuff:
(note: i didn't install gcc-2.95) Now verify that the kernel sources arrived intact:
(well, this didn't work for me, but it ought to dammit!) Unpack the kernel and rtai patches:
Compiling a Test KernelIt is a good idea to see if you can compile a straight vanilla kernel first just to make sure it works, before attempting to compile one with RTAI support. Let's do this now. First, configure the kernel. This is a subject in its own right. Suffice to say, I left most values at their default settings. (xconfig will try to use the settings of your current kernel)
turn off ACPI, APM, CPU frequency scaling, module versioning (under general setup,) make sure CONFIG_REGPARM (under firmware drivers) is not on - it wasn't even there when I looked, save, and close the window.
Compile the kernel:
(This took 10 minutes on my 900MHz Duron)
You should see something like:
Otherwise, you are going to have to use your brain! Now, build and install the modules:
Install the new kernel:
I edited my /boot/grub/grub.conf file to look like this: (fenn: fix this crappy wiki formatting please!)
That's it for installing the plain kernel. Let's reboot and see if it works! If it doesn't work, you can always boot from the old kernel. Also, make sure your CD drive is empty, as it can be annoying if it tries to boot from a CD instead of your kernel. If you manage to really screw up your grub.conf and are locked out of your system completely, you can still edit it in "rescue mode" with the disc that came with your distribution. Patching the KernelOkay, I'm assuming you're now reading this with your new kernel running. Now it's time to patch the kernel sources with RTAI. You kept the original .tar of your kernel sources as a backup, right? Well, if not, then now's a good time to back up the source tree.
Let's patch the kernel! (finally)
Now, compile the kernel as usual. (I wanted to wait until after compiling RTAI to do this, since compiling the kernel takes forever, but the automatic RTAI configuration script assumes that you're compiling on the kernel you want to run on, so we have to wait until we get the patched kernel running to compile RTAI.)
Install the new kernel as before...
Edit /boot/grub/grub.conf as follows: (and make changes where necessary, i.e. which hard disk partition and default kernel choice)
Configure RTAI:
change linux source tree to /usr/local/src/linux-2.6.10-adeos select "exit", and "yes," you wanna save the configuration. Compile RTAImake sure you're running a realtime kernel before you do this
Now, test out RTAI:
you should see a bunch of numbers... max_latency is the one we're interested in. You can compare your results to others found on http://issaris.org/rtai/ That's it! If you've got numbers, it means your RTAI is up and running. Now it's time for CompilingEMC2. I followed these steps on FC4. I had to install compat-gcc-32 and compat-gcc-32-c++, and build the kernel, rtai, and emc2 with that compiler. EMC2 runs, but there's an unsolved problem where the keyboard stops working until I reboot. -- JeffEpler another bug.. it seems udev deletes the shared memory device files... this is confirmed by rebooting, and /dev/rtai_shm and /dev/rtf[0-9] disappear. a temporary fix to this problem is to re-make the device files, then tell udev not to delete them.
|
Moved to RtaiSteps. If you are seeing this page, please fix the link that brought you here. |