Install RTAI 5.0-test2 on Ubuntu 14.04 Kernel 3.18.20

Install RTAI 5.0-test2 on Ubuntu 14.04 Kernel 3.18.20

Preparation

Download and Unzip

cd /usr/src
curl -L --insecure https://www.rtai.org/userfiles/downloads/RTAI/rtai-5.0-test2.tar.bz2 | tar xj
curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.xz | tar xJ
curl -L http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.20-vivid/linux-image-3.18.20-031820-generic_3.18.20-031820.201508081633_amd64.deb -o linux-image-3.18.20-generic-amd64.deb
dpkg-deb -x linux-image-3.18.20-generic-amd64.deb linux-image-3.18.20-generic-amd64

Link (optional)

rm linux
rm rtai
ln -s linux-3.18.20 linux
ln -s rtai-5.0-test2 rtai

Package Requirement

Update apt-get list

add-apt-repository ppa:danielrichter2007/grub-customizer
apt-get update

general:

apt-get -y install cvs subversion build-essential git-core g++-multilib gcc-multilib ncurses-dev vim

Rtai

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

scilab 5.5.0

apt-get -y 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 -y install libqt4-dev libqwt5-qt4-dev

Install grub customizer and show the grub menu

apt-get install grub-customizer

Compile RTAI Linux kernel

Copy ubuntu kernel 3.18 original config

cp /usr/src/linux-image-3.18.20-generic-amd64/boot/config-3.18.20-031820-generic /usr/src/linux/.config

Patch for kernel

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

Config

make menuconfig

Set up the kernel settings as follows

Enable Loadable Module Support
        -> Module Versioning Support = DISABLE IT
Processor type and features
    -> SMT (Hyperthreading) scheduler support = DISABLE IT
Power Management and ACPI options
    -> ACPI (Advanced Configuration and Power Interface) Support -> PROCESSOR = DISABLE IT
    -> CPU Frequency scaling -> CPU Frequency scaling = DISABLE IT
    -> Cpu idle --> CPU idle PM support --> DISABLE IT

Build

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

Install

dpkg -i ../linux-image-3.18.20-rtai_3.18.20-rtai-1_amd64.deb
dpkg -i ../linux-headers-3.18.20-rtai_3.18.20-rtai-1_amd64.deb

Modify /etc/default/grub

gedit /etc/default/grub

Set GRUB_CMDLINE_LINUX_DEFAULT as:

#GRUB_HIDDEN_TIMEOUT=0
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash lapic=notscdeadline”

Apply grub config

update-grub

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

RTAI installation

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

uname -r 

It should print:

3.18.20-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)

gedit ~/.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

/usr/realtime/lib

Run ldconfigin order to take it into account

ldconfig

Now, run latency test:

cd /usr/realtime/testsuite/kern/latency
./run

RTAI-LAB Installation

sudo apt-get -y install doxygen bison cvs subversion build-essential automake checkinstall x11proto-xext-dev libfontenc-dev libfreetype6-dev libx11-dev libxdmcp-dev libxfont-dev x11proto-fonts-dev x11proto-kb-dev xtrans-dev zlib1g-dev libxext-dev libxt-dev gettext libncurses5-dev fakeroot kernel-package swig python-dev libtool libboost-program-options-dev libgsl0-dev libxmu-dev libxi-dev xutils-dev libtalloc-dev libdrm-dev x11proto-dri2-dev x11proto-gl-dev libxdamage-dev

Install MesaLib

MesaLib is needed by EFLTK. Get MesaLib source from its FTP:

mkdir ~/src
cd ~/src
wget ftp://ftp.freedesktop.org/pub/mesa/older-versions/7.x/7.10/MesaLib-7.10.tar.bz2
tar jxvf MesaLib-7.10.tar.bz2
cd Mesa-7.10

Make and install MesaLib:

make clean
./configure
make -j `getconf _NPROCESSORS_ONLN`
sudo make install

Install EFLTK

EFLTK is needed by xrtailab. Get EFLTK from here:

cd ~/src
wget http://sourceforge.net/projects/ede/files/efltk/2.0.8/efltk-2.0.8.tar.gz/download -O efltk-2.0.8.tar.gz
tar zxvf efltk-2.0.8.tar.gz

Start configuration and installation:

cd efltk
sed -i '62s:void\*:dirent \**:g' src/core/filename_list.cpp
sed -i '68,69s:=":+=" :' configure.in
autoconf
./configure --disable-mysql --disable-unixODBC
./emake
sudo ./emake install

RTAI-LAB installation

Configure RTAI and select to install RTAI:

cd /usr/src/rtai
make menuconfig

Under menu RTAI, select RTAI-Installation. Use the default EFLTK path. Under general options select the inline to be “eager”.

Scilab config

cd ~/src
curl -L http://www.scilab.org/download/5.3.0/scilab-5.3.0.bin.linux-x86_64.tar.gz |tar zx

Every RTAI-Lab user must edit $HOME/.Scilab/scilab-5.x.x/.scilab with:

load('/usr/src/rtai/rtai-lab/scicoslab/macros/RTAI/')
scicos_pal($+1,:)=['RTAI-Lib','RTAI-Lib.cosf'];

To add Scilab to the executable path you must either: cd /usr/local/bin ln -s /usr/local/scilab-5.x.x/bin/scilab scilab or add /usr/local/src/scilab-4.x.x/bin to the PATH variable in your .bash profile and/or .bashrc or relevant shell start-up file.

Install Comedi

apt-get flex bison byacc
sudo apt-get install libxmu-dev libxi-dev

sudo su
cd /usr/local/src/

git clone git://comedi.org/git/comedi/comedi.git
git clone git://comedi.org/git/comedi/comedilib.git 

Comedilib

sudo su
cd /usr/local/src/comedilib
sh autogen.sh
./configure
makev make install
mkdir /usr/local/include/linux
exit
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值