format OpenAirKernel357Ubuntu1204x86Setups

update TODO
Cedric Roux
2016-01-18 12:21:39 +01:00
parent a0ddf9b750
commit 74b37fa5b9
2 changed files with 145 additions and 73 deletions

@@ -1,5 +1,6 @@
This document describes how to install RTAI 4.0 on a Ubuntu 12.04.4 LTS using a 3.8.13 kernel, either 32bit or 64 bit version.
---++++ Prerequisites
## Prerequisites
Install Ubuntu 12.04.4 using one of the following images:
@@ -8,125 +9,197 @@ http://releases.ubuntu.com/precise/ubuntu-12.04.4-desktop-amd64.iso
http://releases.ubuntu.com/precise/ubuntu-12.04.4-desktop-i386.iso
And then follow the installation instructions here: https://help.ubuntu.com/community/Installation/
---++++ Introduction
If the ROOT user is not created yet, log as your usual user, open a terminal and type ->
<verbatim># sudo su -
# sudo passwd root
</verbatim>
## Introduction
If the ROOT user is not created yet, log as your usual user, open a terminal and type:
```shell
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 :
<verbatim># apt-get update
</verbatim>
Open a terminal and update your package repository source file:
```shell
apt-get update
```
Some tools are required in order to set up the kernel (You need to be connected to Internet)
<verbatim># apt-get -y install qt3-apps-dev build-essential kernel-package vim cvs
</verbatim>
---++++ I - Kernel source and RTAI download
<verbatim># cd /usr/src/</verbatim>
```shell
apt-get -y install qt3-apps-dev build-essential kernel-package vim cvs
```
## I - Kernel source and RTAI download
```shell
cd /usr/src/
```
Get the kernel source from kernel.org
<verbatim># wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.bz2
# tar xf linux-3.8.13.tar.bz2
</verbatim>
```shell
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.13.tar.bz2
tar xf linux-3.8.13.tar.bz2
```
Get RTAI 4.0 from the RTAI homepage
<verbatim># wget https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2
tar xf rtai-4.0.tar.bz2</verbatim>
---++++ II - Kernel Preparation
<verbatim># cd /usr/src
# ln -s linux-3.8.13 linux
# cd linux </verbatim>
---+++++ Applying patch
```shell
wget https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.0.tar.bz2
tar xf rtai-4.0.tar.bz2
```
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.
<verbatim># patch -p1 < /usr/src/rtai-4.0/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch
</verbatim>
## II - Kernel Preparation
---+++++ Kernel Configuration
<verbatim># cd /usr/src/linux</verbatim>
```shell
cd /usr/src
ln -s linux-3.8.13 linux
cd linux
```
In order to retrieve your current kernel configuration : (If at this step, questions are asked give the answer by default)
<verbatim># make oldconfig</verbatim>
### 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.
```shell
patch -p1 < /usr/src/rtai-4.0/base/arch/x86/patches/hal-linux-3.8.13-x86-4.patch
```
### Kernel Configuration
```shell
cd /usr/src/linux
```
In order to retrieve your current kernel configuration: (If at this step, questions are asked give the answer by default)
```shell
make oldconfig
```
Now we modify the kernel settings the way we need it (NOTE: some parameters cannot be disabled with xconfig - better to use menuconfig):
<verbatim># make xconfig </verbatim>
Set up the kernel settings as follows :
```shell
make xconfig
```
*Processor type and features*
Set up the kernel settings as follows:
-&gt; Processor family = <em>Select yours<br /></em>-&gt; Maximum number of CPUs (NR_CPUS) = <em>Set your number (it's generally "4")</em><br />-&gt; SMT (Hyperthreading) scheduler support = _DISABLE IT_
`Processor type and features`
*Power Management and ACPI options* <span style="background-color: transparent;"> </span>
* Processor family = _Select yours_
* Maximum number of CPUs (NR_CPUS) = _Set your number (it's generally "4")_
* SMT (Hyperthreading) scheduler support = _DISABLE IT_
CPU idle PM support<br /><span style="background-color: transparent;">-&gt; Cpu idle Driver for Intel Processors = </span><em style="background-color: transparent;">DISABLE IT<br /></em><span style="background-color: transparent;">-&gt; ACPI (Advanced Configuration and Power Interface) Support -&gt; PROCESSOR = </span><em style="background-color: transparent;">DISABLE IT<br /></em><span style="background-color: transparent;">-&gt; APM (Advanced Power Management) BIOS support = </span><em style="background-color: transparent;">DISABLE IT<br /></em><span style="background-color: transparent;">-&gt; CPU Frequency scaling -&gt; CPU Frequency scaling = </span><em style="background-color: transparent;">DISABLE IT<br /></em><span style="background-color: transparent;">CPU idle PM support = DISABLE IT</span>
`Power Management and ACPI options`
Save and Quit
CPU idle PM support:
Note (Sylvain, May 2014): these settings should be verified in the .config file, since there have been cases that xconfig does not do it correctly.
---++++ *III - Kernel Compilation*
<verbatim># cd /usr/src/linux
# make && make modules_install && make install</verbatim>
* Cpu idle Driver for Intel Processors = _DISABLE IT_
* ACPI (Advanced Configuration and Power Interface) Support -> PROCESSOR = _DISABLE IT_
* APM (Advanced Power Management) BIOS support = _DISABLE IT_
* CPU Frequency scaling -> CPU Frequency scaling = _DISABLE IT_
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.
---+++++ Kernel Boot Options
CPU idle PM support = DISABLE IT
This is very important - it took us (and the guys at the RTAI mailing list) ages to find that special config that makes everything work smoothly!
Save and Quit.
Note (Sylvain, May 2014): these settings should be verified in the `.config` file,
since there have been cases that xconfig does not do it correctly.
## III - Kernel Compilation
```shell
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 around one hour.
### Kernel Boot Options
This is very important - it took us (and the guys at the RTAI mailing list)
ages to find that special config that makes everything work smoothly!
You need to add the following option to the kernel at boot time
<verbatim>lapic=notscdeadline</verbatim>
```shell
lapic=notscdeadline
```
The best way to do this is in /etc/default/grub in the field GRUB_CMDLINE_LINUX_DEFAULT, i.e.,
The best way to do this is in `/etc/default/grub` in the field `GRUB_CMDLINE_LINUX_DEFAULT`, i.e.:
<verbatim>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash lapic=notscdeadline"</verbatim>
·`GRUB_CMDLINE_LINUX_DEFAULT="quiet splash lapic=notscdeadline"`
You will also have to change the GRUB_DEFAULT to the number that corresponds to the new kernel.
Finally run update-grub and reboot
<verbatim>
# update-grub
# reboot
</verbatim>
```shell
update-grub
reboot
```
---++++ *IV - RTAI installation*
## IV - RTAI installation
Now that the system has restarted, make sure you booted on your new OpenAir kernel
<verbatim># uname -r </verbatim>
Should give you "3.8.13" as result
<verbatim># cd /usr/src/rtai-4.0
# make xconfig
</verbatim>
```shell
uname -r
```
UPDATE the CPUs number according to your configuration and disable RTAI_USE_NEWERR and real-time COMEDI support in Add-ons. Enable the watchdog, CONFIG_RTAI_WD.
Should give you `3.8.13` as result.
Save and quit. If any error occurs here, solve it and repeat this "make xconfig" step until it's OK
<verbatim># make && make install </verbatim>
```shell
cd /usr/src/rtai-4.0
make xconfig
```
Add what follows, to the end of the file ~/.bashrc
<verbatim>export PATH=/usr/realtime/bin:$PATH
UPDATE the CPUs number according to your configuration and disable RTAI_USE_NEWERR
and real-time COMEDI support in Add-ons. Enable the watchdog, CONFIG_RTAI_WD.
Save and quit. If any error occurs here, solve it and repeat this "make xconfig" step until it's OK.
```shell
make && make install
```
Add what follows, to the end of the file `~/.bashrc`.
```shell
export PATH=/usr/realtime/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/realtime/lib
</verbatim>
```
Create a file /etc/ld.so.conf.d/rtai.conf with the content
<verbatim>/usr/realtime/lib</verbatim>
Create a file `/etc/ld.so.conf.d/rtai.conf` with the content
`/usr/realtime/lib`
and run "ldconfig"in order to take it into account
For OpenAir code compilation, we need to create the following symbolic link :
<verbatim>ln -s /usr/src/linux-3.8.13/include/generated/autoconf.h /lib/modules/3.8.13/build/include/linux/autoconf.h</verbatim>
For OpenAir code compilation, we need to create the following symbolic link:
We will test the RTAI system via the latency test
<verbatim># cd /usr/realtime/testsuite/kern/latency
# ./run </verbatim>
```shell
ln -s /usr/src/linux-3.8.13/include/generated/autoconf.h /lib/modules/3.8.13/build/include/linux/autoconf.h
```
If the test fails to start, it could be related to a bad RTAI configuration. Check error messages with "dmesg".<br />You should have absolutely no overrun and the "lat-max" column values should not exceed 45 000ns.
We will test the RTAI system via the latency test:
-- User.FlorianKaltenberger - 12 Mar 2014
```shell
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.
-- @florian.kaltenberger - 12 Mar 2014

@@ -71,7 +71,6 @@ Here are the pages that need to be converted.
* [OpenAirExpressMimo2](OpenAirExpressMimo2)
* [OpenAirInterface](OpenAirInterface)
* [OpenAirKernel2632genericx86Setups](OpenAirKernel2632genericx86Setups)
* [OpenAirKernel357Ubuntu1204x86Setups](OpenAirKernel357Ubuntu1204x86Setups)
* [OpenAirKernel357genericx86Setups](OpenAirKernel357genericx86Setups)
* [OpenAirKernelSetups](OpenAirKernelSetups)
* [OpenAirLTEEmulation](OpenAirLTEEmulation)