Building a Real-Time Kernel

If you don’t want to use a multimedia Linux distribution and your, favorite distro does not package a real-time kernel, you can build your own. A complete kernel-building how-to would be a whole chapter by itself, so I’m not going to try to stuff one into this chapter. You can easily find good how-tos; look for instructions specific to your distribution.

You’ll need a proper build environment installed, kernel sources, and a copy of the configuration file for your current kernel. Once those are in place, you need the rt patch, which you can get from the mothership of the Linux kernel, http://www.kernel.org/. Go to the rt wiki at (http://rt.wiki.kernel.org/index.php/Main_Page), and look for the “CONFIG_PREEMPT_RT Patch” download. It must have the same version number as your kernel sources. Once you have that, apply it to your kernel sources.

In your kernel makefile, set EXTRAVERSION equal to a value that tells you this is a real-time kernel, such as EXTRAVERSION = -rt. Then if your kernel version is 2.6.33.1, for example, your new kernel name will be linux-2.6.33.1-rt.

Now you are ready to configure your new kernel. Start with your existing kernel configuration and run the make oldconfig command; you don’t need to start from scratch just to enable real-time preemption. Review your kernel configuration and enable Processor type and features > Preemption Mode (Complete Preemption (Real-Time)), and Processor type and features > Timer frequency (1000 Hz).

Then finish configuration, and compile and install your new kernel. That should be all there is to it, but review the rt wiki to make sure, because Linux kernel development is a fast-moving target. Keep your old stock kernel installed as well. You can have as many kernels as you want on your system, and if anything goes wrong, you’ll have a good kernel to boot to.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.100.120