This document describes HOW-TO create the 3.5.7-generic-OpenAirInterface kernel on a Ubuntu 12.10.
The RTAI version used in this HOW-TO comes directly from the magma repository. Since this repository is due to change we recomend that you use the same revision number as described below. In the future this might be replaced by one of the official RTAI releases. ---++++ Introduction
If the ROOT user is not created yet, log as your usual user, open a terminal and type -> # sudo su -
sudo passwd root
Enter the password for the ROOT user. Log out and log in as Root.
Open a terminal and update your package repository source file : # apt-get update
Some tools are required in order to set up the kernel (You need to be connected to Internet) # apt-get -y install qt3-apps-dev build-essential kernel-package vim ---++++ I - Kernel source and RTAI download # cd /usr/src/
Get the kernel source from kernel.org # wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.5.7.tar.bz2
tar xf linux-3.5.7.tar.bz2
Get the version dating 2013-08-03 from the RTAI cvs server # cvs -D2013-08-03 -d:pserver:anonymous@cvs.gna.org:/cvs/rtai co magma ---++++ II - Kernel Preparation # cd /usr/src
ln -s linux-3.5.7 linux
cd linux
---+++++ Applying patch
If you want first simulate the patch application, use "--dry-run" after "-p1". It won't touch any files on your computer, but you can see if you get Hunks or not. # patch -p1 < /usr/src/magma/base/arch/x86/patches/hal-linux-3.5.7-x86-3.patch ---+++++ Kernel Configuration # cd /usr/src/linux
In order to retrieve your current kernel configuration : (If at this step, questions are asked give the answer by default) # make oldconfig
Now we modify the kernel settings the way we need it : # make xconfig
Set the right processor type and number of processors, disable hyperthreading. In "Power Management and ACPI options", disable CPU idle PM support, APM, CPU Frequency scaling. Further in "ACPI Support" disable processor.
Save and Quit ---++++ III - Kernel Compilation # cd /usr/src/linux
make && make modules_install && make install
NOTE: The compilation time might be decreased by passing the flags -jX (with X=number of CPUs you have on your machine). This has for effect to parallelize the kernel compilation between the CPUs. This will take ~1 hour.
If you want to be sure that your new kernel will be the default one
# vi /boot/grub/grub.cfg
Look for set default="X' number at the beginning of this file and memorize it
Check at the end of the file that your kernel entry matches this "default" number. To change this setting, edit /etc/default/grub.cfg and run update-grub.
# reboot
---++++ IV - RTAI installation
Now that the system has restarted, make sure you booted on your new OpenAir kernel # uname -r
Should give you "3.5.7" as result # cd /usr/src/magma
make xconfig
UPDATE the CPUs number according to your configuration
Save and quit. If any error occurs here, solve it and repeat this "make xconfig" step until it's OK # make && make install
Add what follows, to the end of the file ~/.bashrc export PATH=/usr/realtime/bin:$PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/realtime/lib
Create a file /etc/ld.so.conf.d/rtai.conf with the content /usr/realtime/lib
and run "ldconfig"
We will test the RTAI system via the latency test # cd /usr/realtime/testsuite/kern/latency
./run
If the test fails to start, it could be related to a bad RTAI configuration. Check error messages with "dmesg".
You should have absolutely no overrun and the "lat-max" column values should not exceed 45 000ns.
-- User.FlorianKaltenberger - 24 Sep 2013 </verbatim>