There is a similar topic to this one located at: http://forums.debian.net/viewtopic.php?t=12417
But it is a little outdated and I find my approach a little bit easier..
Introduction
A realtime kernel enables realtime preemption for the kernel which enhances the performance of multimedia applications greatly. A realtime kernel is recommended for small music studios, for people who want to live record MIDI keyboards or for people who want to get overall better performance from their PC. So you want to build your own realtime kernel? Fine, now let's get started!
1. Preparations
If you are familiar with the Terminal and you know how to compile programs, then you are ready to build a realtime kernel. Before we start, I would like to add that you need to run all the commands mentioned in this post as root. Ok, let's do some preparations before the actual kernel building:
Code: Select all
cd /usr/src/
apt-get install wget bzip2 binutils kernel-package module-init-tools initrd-tools yaird
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.3.tar.bz2
wget http://people.redhat.com/mingo/realtime-preempt/older/patch-2.6.20-rt8
tar xvjf linux-2.6.20.3.tar.bz2
cd linux-2.6.20.3
patch -p1 < ../patch-2.6.20-rt8
And let's edit the /etc/kernel-img.conf file:
Code: Select all
cp /etc/kernel-img.conf /etc/kernel-img.conf.backup
nano /etc/kernel-img.conf
Now save the file and proceed to the next step.do_symlinks = yes
warn_initrd = no
ramdisk = /usr/sbin/yaird
do_bootloader = no
do_bootfloppy = no
link_in_boot = no
postinst_hook = /usr/sbin/update-grub
postrm_hook = /usr/sbin/update-grub
2. Configuring the kernel
Ok, now we are ready to build the kernel, but before that, we need to configure it.
For a text-based configuring application fire up menuconfig:
Code: Select all
apt-get install libncurses5-dev
make menuconfig
Code: Select all
apt-get install libqt3-mt-dev
make xconfig
Now you need to configure your kernel from the ground up, but if you don't have any clue on what to set, then you can use these configurations as a base (I ripped them from the Debian 2.6.20 kernel packages from this trunk):
For 486: http://h.1asphost.com/thamarok/config-2.6.20-1-486
For 686: http://h.1asphost.com/thamarok/config-2.6.20-1-686
For amd64: http://h.1asphost.com/thamarok/config-2.6.20-1-amd64
You can easily load the configuration files from xconfig by choosing File -> Load from the menu. If you use menuconfig, then you need to scroll down and choose "Load an Alternate Configuration File".. But remember to save your configuration before building the kernel!
To have a realtime kernel, make sure you have these marked as Y:
If you are ready and you have saved your configuration, let's build the kernel!Processor type and features -> Preemption Mode -> Complete Preemption (Real-Time)
Processor type and features -> Timer frequency -> 1000 HZ
3. Building the kernel
Building the kernel is a fairly easy process, but may take very long depending on your PC's specifications and how the kernel was configured.
Also note that with even a little misconfiguration, you can make a bad kernel.
Despite the consequences of what can happen, let's build the kernel:
Code: Select all
make-kpkg clean
make-kpkg --initrd kernel_image kernel_headers
After the kernel has compiled, you can install it very easily by executing this:
Code: Select all
dpkg -i *.deb
If everything went correctly, the GRUB bootloader should have updated its menu.lst file so that you can boot your new kernel on the next boot.
So, that was it
- Thamarok