RTAI installation for Ubuntu 14.04

Preparation

1if the kernel is not 3.16/14/12/8

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600_3.16.0-031600.201408031935_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-image-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb
sudo dpkg -i linux-headers-3.16*.deb linux-image-3.16*.deb
sudo reboot
uname -r

It should appear 3.16.0-031600-generic. [Skip this step if it already is.]

2download and unzip

cd /usr/src
curl -L https://www.rtai.org/userfiles/downloads/RTAI/rtai-4.1.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-image-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb -o linux-image-3.16.0-generic-amd64.deb
dpkg-deb -x linux-image-3.16.0-generic-amd64.deb linux-image-3.16.0-generic-amd64
ln -s linux-3.16 linux
ln -s rtai-4.1 rtai

4package requirement

update apt-get list

apt-get update

General:

apt-get install cvs subversion build-essential git-core g++-multilib gcc-multilib

Rtai

apt-get install libtool automake libncurses5-dev kernel-package

scilab 5.5.0

apt-get install default-jre docbook-xsl fop javahelp2 libavalon-framework-java libbatik-java libfftw3-3 libflexdock-java libgfortran3 libhdf5-7 libjeuclid-core-java libjgoodies-looks-java libjgraphx-java libjhdf5-java libjlatexmath-fop-java libjlatexmath-java libjogl-java libjrosetta-java liblapack3gf libncurses5 libpcre3 libpvm3 libquadmath0 libsaxon-java libskinlf-java libstdc++6 libtinfo5 libxml2 tcl8.5 tk8.5 zlib1g libgcc1 libc6 libblas-dev libblas3gf libatlas3gf-base gfortran liblapack-dev

qrtailab

apt-get install libqt4-dev libqwt5-qt4-dev

5compile RTAI Linux kernel

copy ubuntu kernel 3.16 original config

cp /usr/src/linux-image-3.16.0-generic-amd64/boot/config-3.16.0-031600-generic /usr/src/linux/.config

patch for kernel

cd /usr/src/linux
patch -p1 < /usr/src/rtai/base/arch/x86/patches/hal-linux-3.16-x86-3.patch

config

make menuconfig

Set up the kernel settings as follows

Processor type and features
    -> Processor family = Select yours
    -> Maximum number of CPUs (NR_CPUS) = Set your number (it's generally "4")
    -> SMT (Hyperthreading) scheduler support = DISABLE IT
Power Management and ACPI options
    ACPI (Advanced Configuration and Power Interface) Support  = DISABLE IT
    CPU idle PM support = DISABLE IT

build

make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-rtai 

install

cd ..
dpkg -i linux-image-3.16.0-rtai_3.16.0-rtai-1_amd64.deb 
dpkg -i linux-headers-3.16.0-rtai_3.16.0-rtai-1_amd64.deb

modify grub config, set GRUB_CMDLINE_LINUX_DEFAULT as:

vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash lapic=notscdeadline"
GRUB_DEFAULT="1>2"

apply grub config

update-grub

Now, reboot your system. choose the RTAI in GRUB boot menu.

6RTAI installation

Now that the system has restarted, make sure you booted on your RTAI kernel

uname -r 

it should show:

3.16.0-rtai

config RTAI

cd /usr/src/rtai
make menuconfig

UPDATE the CPUs number according to your configuration.

build

make -j `getconf _NPROCESSORS_ONLN`

install

make install

add following line to your ~/.bashrc (if you use bash)

vim ~/.bashrc
export PATH=/usr/realtime/bin:$PATH 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/realtime/lib

use new environment variable

source ~/.bashrc

Create a file /etc/ld.so.conf.d/rtai.conf with the content

vim /etc/ld.so.conf.d/rtai.conf
/usr/realtime/lib

run ldconfigin order to take it into account

ldconfig

Now, run latency test:

cd /usr/realtime/testsuite/kern/latency
./run
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值