Installing the Real time Linux (RT_PREEMPT) -Ubuntu

13 Apr

My experiments with Real-time Linux on Ubuntu 10.04

Installation Steps

1) Get the vanilla kernel from

2) Get the real time patch from

3) Extract the linux source files from the *.tar.bz2

4) Go to the folder containing the linux source

5) Patch the source with real time patch
bzcat path_of_the_patch | patch -p1
Install the patch s/w if not present

6) Create a soft link from /usr/src to the folder now containing the patched linux source

ln -s path_of_linux_source /usr/src/linux-rt-preempt

7)Ensure that you have libncurses-dev libraries. If not then install them.

8) Go to /usr/src/linux-rt-preempt
Configure the kernel to enable real time behavior
make menuconfig
1) Select Processor type and features  —>
Preemption Mode (Complete Preemption (Real-Time))  —>
2) For kernel hacking [Optional]
Kernel hacking  —>
[*] Tracers  —>
— Tracers
[*]   Kernel Function Tracer
[*]   Interrupts-off Latency Tracer
[*]     Interrupts-off Latency Histogram
[*]   Preemption-off Latency Traver
[*]     Preemption-off Latency Histogram
[*]   Scheduling Latency Tracer
[*]     Scheduling Latency Histogram
[*]   Missed timer offsets histogram

3) Ensure stack overflow is disabled
Kernel hacking  —>
[ ] Check for stack overflows
Save the kernel configuration and exit

9)Then build the kernel
This step will take up some time
I have encountered errors in the build (not always) for staging/drivers
In that case disable the staging drivers in Device drivers option

10) Install the modules [Require superuser permissions]
make modules_install

11) Then install the image in the /boot folder [Require superuser permissions]
make install

12) Go to /boot folder and create the initrd image
mkinitramfs -o initrd.img-
The number should match exactly with the * of the newly created* and vmlinuz-* after we run make install

13) update the grub

14) Goto /boot/grub/
check the entries are made properly in grub.cfg

15) Reboot the system and verify that the kernel is a real time kernel
uname -a should display the flag

Enjoy real time linux!!!!



Posted by on April 13, 2011 in Linux, Real Time


Tags: ,

4 responses to “Installing the Real time Linux (RT_PREEMPT) -Ubuntu

  1. Rakesh

    December 30, 2011 at 10:50 am

    Thanks a lot Suhas for the step by step tutorial !

    It did ease up my search and work to a great extent …

    Keep posting with your findings …

    Cheers !

  2. red

    April 30, 2013 at 10:02 pm

    I don’t understand the step 4 , can you explain ? thanks

  3. Suhas

    January 5, 2014 at 6:03 am

    In Step 4, i meant go to the directory where the source files have been extracted.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: