If you have a problem with test results, see [RTAI Latency Test] |
If you have a problem with test results, see [RTAI Latency Test] |
This page describes how to prepare Debian Etch to compile RTAI
su - cd /etc/init.d touch rtai-dev chmod 755 rtai-dev update-rc.d rtai-dev start 30 2 3 4 5 . |
Edit /etc/init.d/rtai-dev with your favorite editor.
#!/bin/sh -e if [ ! -e /dev/rtai_shm ] ; then mknod -m 666 /dev/rtai_shm c 10 254 fi for n in `seq 0 9`; do f="/dev/rtf$n" if [ ! -c $f ] ; then mknod -m 666 $f c 150 $n fi done |
To test the script, run it:
/etc/init.d/rtai-dev |
echo install pcspkr /bin/true >/etc/modprobe.d/rtai |
FIX: Debian team decided to release Debian Etch with 2.6.18 kernel. Therefore, linux-source-2.6.17
and linux-patch-debian-2.6.17 packages are removed from repository. But there is no RTAI hal patch for 2.6.18
kernel. So, we need to use 2.6.17 packages. Firstly, download linux-source-2.6.17_2.6.17-9_all.deb and linux-patch-debian-2.6.17_2.6.17-9_all.deb packages. Then install them. dpkg -i linux-source-2.6.17_2.6.17-9_all.deb dpkg -i linux-patch-debian-2.6.17_2.6.17-9_all.deb MD5 d0c0ab8ef2dfe5213abe21782b1574b9 linux-source-2.6.17_2.6.17-9_all.deb 67bd1cd4e6bb4fb9b1656b1dd7478053 linux-patch-debian-2.6.17_2.6.17-9_all.deb |
apt-get update apt-get -u upgrade apt-get install linux-source-2.6.17 \ linux-patch-debian-2.6.17 \ kernel-package \ build-essential \ dh-make \ module-assistant \ intltool-debian \ debhelper \ po-debconf \ sharutils \ gettext \ html2text \ libncurses5-dev \ wget |
cd wget --no-check-certif https://www.rtai.org/RTAI/rtai-3.5-cv.tar.bz2 mkdir /usr/src/modules tar xjf rtai-3.5-cv.tar.bz2 -C /usr/src chown root:src /usr/src/rtai-3.5-cv/ -R cd /usr/src/modules ln -s ../rtai-3.5-cv rtai |
cd /usr/src tar xjf linux-source-2.6.17.tar.bz2 ln -s linux-source-2.6.17 linux |
FIX: there is a small bug in kernel-patches package. To fix it, do the followings: cd /usr/src/kernel-patches/all/ mkdir 2.6.17 mv apply/ 2.6.17/ mv debian/ 2.6.17/ mv unpatch/ 2.6.17/ |
cd /usr/src/linux ../kernel-patches/all/2.6.17/unpatch/debian |
cd /usr/src/linux patch -p1 < ../modules/rtai/base/arch/i386/patches/hal-linux-2.6.17-i386-1.5-02.patch |
cp /boot/config-2.6.18-5-486 .config make oldconfig make menuconfig |
Loadable module support ---> Enable loadable module support ---> enabled
Loadable module support ---> Module versioning support ---> disabled
Processor type and features ---> Preemption Model ---> Preemptible Kernel (Low-Latency Desktop)
Processor type and features ---> Interrupt pipeline ---> enabled
Processor type and features ---> High Memory Support ---> off
Power management options (ACPI, APM) ---> Legacy Power Management API ---> disabled
Power management options (ACPI, APM) ---> Software Suspend ---> disabled
Power management options (ACPI, APM) ---> ACPI (Advanced Configuration and Power Interface) Support ---> ACPI Support ---> disabled
Power management options (ACPI, APM) ---> APM (Advanced Power Management) BIOS Support ---> APM BIOS Support ---> disabled
Power management options (ACPI, APM) ---> CPU Frequency scaling ---> CPU Frequency scaling ---> disabled
Power management options (ACPI, APM) ---> Power Management support ---> disabled
For non-SMP systems, disable symmetric multi-processing support:
Processor type and features ---> Symmetric multi-processing support ---> disabled
Choose the most suitable processor family for your machine. For example, for a Pentium-III processor:
Processor type and features ---> Processor family ---> Pentium-III / Celeron(Coppermine) / Pentium-III Xeon
If you have a dual cores CPU or SMP system, don't choose a processor family which has no TSC (time stamp counter).
This means that for example you can not choose 586/K5/5x86/6x86/6x86MX as Processor family if you have a dual cores CPU.
In conclusion, choose the most suitable processor family for your machine.
make-kpkg clean make-kpkg --append-to-version -rtai \ --revision r1 \ --initrd \ --config menuconfig \ kernel_image \ kernel_headers \ kernel_source |
cd /usr/src dpkg -i linux-image-2.6.17-rtai_r1_i386.deb dpkg -i linux-headers-2.6.17-rtai_r1_i386.deb reboot |
Boot with the new RTAI kernel.
If you only want to run EMC2, skip this step and continue from [Compiling RTAI modules]
su - apt-get install libglu1-mesa \ libglu1-mesa-dev \ libgl1-mesa-dev \ libxt-dev exit |
Because of dependencies the following packages will be installed too
libglu1-mesa-dev -> libx11-dev libxau-dev libxdmcp-dev libxext-dev mesa-common-dev x11proto-core-dev -> x11proto-input-dev x11proto-kb-dev x11proto-xext-dev xtrans-dev libxt-dev -> libice-dev libsm-dev
cd wget http://superb-west.dl.sourceforge.net/sourceforge/mesa3d/MesaLib-7.0.1.tar.gz tar zxf MesaLib-7.0.1.tar.gz |
cd Mesa-7.0.1 make realclean make linux-x86 su make install exit |
See http://www.mesa3d.org/install.html for more details.
cd wget http://ovh.dl.sourceforge.net/sourceforge/ede/efltk-2.0.6.tar.bz2 tar xjf efltk-2.0.6.tar.bz2 |
At line 81 in ~/efltk/efltk/Fl_Text_Buffer.h, change this line
char *Fl_Text_Buffer::static_buffer(); |
char *static_buffer(); |
At line 26 in ~/efltk/efltk/Fl_Combo_Box.h, change these two lines
static void Fl_Combo_Box::cb_browse(Fl_Widget *w, void *data); static void Fl_Combo_Box::cb_button(Fl_Widget *w, void *data); |
static void cb_browse(Fl_Widget *w, void *data); static void cb_button(Fl_Widget *w, void *data); |
cd ~/efltk ./configure ./emake |
su ./emake install echo "/usr/local/lib" >> /etc/ld.so.conf ldconfig exit |
su - cd /usr/src/modules/rtai make menuconfig |
If you only want to run EMC2, default values are OK. Save and exit.
make make install reboot |
Boot with the new RTAI kernel.
su - cd /usr/src/modules/rtai make menuconfig |
If you only want to run EMC2, default values are OK. Save and exit.
mkdir debian cd debian touch changelog touch compat touch control.modules.in touch copyright touch rules chmod 755 rules |
Edit /usr/src/modules/rtai/debian/changelog with your favorite editor. See [1]
Edit /usr/src/modules/rtai/debian/compat with your favorite editor. See [2]
Edit /usr/src/modules/rtai/debian/control.modules.in with your favorite editor. See [3]
Edit /usr/src/modules/rtai/debian/copyright with your favorite editor. See [4]
Edit /usr/src/modules/rtai/debian/rules with your favorite editor. See [5]
cd /usr/src/linux make-kpkg --append-to-version -rtai --added-modules rtai modules_clean make-kpkg --append-to-version -rtai --added-modules rtai modules_image |
cd /usr/src dpkg -i rtai-modules-2.6.17-rtai_3.5+r1_i386.deb dpkg -i rtai-dev-2.6.17-rtai_3.5+r1_i386.deb reboot |
Boot with the new RTAI kernel.
su - cd /usr/realtime/testsuite/user/latency; ./run cd /usr/realtime/testsuite/user/preempt/; ./run cd /usr/realtime/testsuite/user/switches/; ./run cd /usr/realtime/testsuite/kern/latency/; ./run cd /usr/realtime/testsuite/kern/preempt/; ./run cd /usr/realtime/testsuite/kern/switches/; ./run exit |
But you don't need Scilab to run EMC2. If you only want to run EMC2, skip this step.
NOTE: The instructions in this document are for Scilab-4.1.1 because Scilab-4.1.2 has some problem with RTAI-3.5. If you want to install Scilab-4.1.2, see Roberto Bucher's e-mail message
|
su - cd /usr/local/ wget http://www.scilab.org/download/4.1.1/scilab-4.1.1-src.tar.gz tar zxf scilab-4.1.1-src.tar.gz |
deb http://ftp.de.debian.org/debian/ etch main contrib non-free deb-src http://ftp.de.debian.org/debian/ etch main contrib non-free deb http://ftp.de.debian.org/debian-security/ etch/updates main contrib non-free deb-src http://ftp.de.debian.org/debian-security/ etch/updates main contrib non-free |
apt-get update apt-get build-dep scilab |
Because of build dependencies, the following packages will be installed:
autoconf cdbs cpp-3.4 diffstat g77 g77-3.4 gawk gcc-3.4 libg2c0-dev libice-dev libpvm3 libreadline5-dev libsm-dev libxmu-dev libxmu-headers libxpm-dev libxt-dev ocaml-base-nox ocaml-interp ocaml-nox pvm pvm-dev quilt tcl8.4-dev tk8.4-dev x-dev xaw3dg-dev
cd /usr/local/scilab-4.1.1 ./configure --without-java --with-tcl-library=/usr/lib --with-tcl-include=/usr/include/tcl8.4 make all ln -s /usr/local/scilab-4.1.1/bin/scilab /usr/local/bin/scilab |
Don't use "make install" to install Scilab.
At line 51 in /usr/local/scilab-4.1.1/bin/scilab, change this line
PATH=$PATH:$SCI:$SCI/util |
PATH=$PATH:$SCI:$SCI/util:/usr/realtime/bin |
At line 63 in /usr/local/scilab-4.1.1/bin/scilab, change this line
PATH=$PATH:$SCI:$SCI/util |
PATH=$PATH:$SCI:$SCI/util:/usr/realtime/bin |
cd /usr/src/modules/rtai/rtai-lab/scilab/macros/ make |
If you install RTAI with Debian way, to install macros
cd /usr/realtime/rtai-lab/scilab/macros/ make |
apt-get install scilab-doc touch /usr/share/menu/scilab |
Edit /usr/share/menu/scilab with your favorite editor.
?package(scilab-doc):\ needs="x11"\ section="Apps/Math"\ title="Scilab 4.1.1"\ command="/usr/local/bin/scilab" ?package(scilab-doc):\ needs="text"\ section="Apps/Math"\ title="Scilab 4.1.1"\ command="/usr/local/bin/scilab -nw" |
update-menus exit |
cd /usr/src/modules/rtai/rtai-lab/scilab/macros/ make user |
If you install RTAI with Debian way, as normal user
cd /usr/realtime/rtai-lab/scilab/macros/ make user |
Firstly, finish to install and to test RTAI. If everything is OK, you can start to install Comedi.
cd wget http://www.comedi.org/download/comedilib-0.8.0.tar.gz tar zxf comedilib-0.8.0.tar.gz cd comedilib-0.8.0 ./configure make su make install exit |
cd wget http://www.comedi.org/download/comedi-0.7.74.tar.gz tar zxf comedi-0.7.74.tar.gz cd comedi-0.7.74/ ./configure --disable-pcmcia make su make install depmod -a make dev cp include/linux/comedi.h /usr/local/include/ cp include/linux/comedilib.h /usr/local/include/ |
FIX: Sometimes "make install" don't install the comedi kernel modules to the right place. I couldn't find what causes this. If there is nothing in /lib/modules/2.6.17-rtai/comedi/, use the following commands to solve the problem. cp -R /lib/modules/2.6.17/comedi/* /lib/modules/2.6.17-rtai/comedi/ depmod -a |
Create a startup script to create Comedi devices at boot time.
cd /etc/init.d touch comedi-dev chmod 755 comedi-dev update-rc.d comedi-dev start 30 2 3 4 5 . |
Edit /etc/init.d/comedi-dev with your favorite editor.
/etc/init.d/comedi-dev
#!/bin/sh -e for n in `seq 0 15`; do f="/dev/comedi$n" if [ ! -c $f ] ; then mknod -m 666 $f c 98 $n fi done |
We need the following symbolic links
mkdir /usr/local/include/linux cd /usr/local/include/linux/ ln -s /usr/local/include/comedi.h comedi.h ln -s /usr/local/include/comedilib.h comedilib.h cd /usr/include/ ln -s /usr/local/include/comedi.h comedi.h ln -s /usr/local/include/comedilib.h comedilib.h cd /usr/include/linux/ ln -s /usr/local/include/comedi.h comedi.h ln -s /usr/local/include/comedilib.h comedilib.h |
Add-ons ---> Comedi support over LXRT --> enable Add-ons ---> COMEDI installation directory ---> /usr/local RTAI Lab ---> RTAI Lab
#!/bin/sh -e if [ ! -e /dev/rtai_shm ] ; then mknod -m 666 /dev/rtai_shm c 10 254 fi for n in `seq 0 9`; do f="/dev/rtf$n" if [ ! -c $f ] ; then mknod -m 666 $f c 150 $n fi done |
rtai (3.5) unstable; urgency=low * Initial Release. -- maintainer <maintainer@domain.com> Sat, 23 Sep 2006 00:39:32 +0300 |
5 |
Source: rtai Section: devel Priority: optional Maintainer: maintainer <maintainer@domain.com> Build-Depends: debhelper (>= 5) Standards-Version: 3.7.2 Package: rtai-modules-_KVERS_ Architecture: any Provides: rtai-modules Depends: linux-image-_KVERS_ Description: rtai modules for Linux (kernel _KVERS_). This package contains the set of loadable kernel modules for the RTAI realtime extension. . This package contains the compiled kernel modules for _KVERS_ . If you have compiled your own kernel, you will most likely need to build your own rtai-modules. The rtai-source package has been provided for use with the Debian kernel-package utility to produce a version of rtai-module for your kernel. Package: rtai-dev-_KVERS_ Architecture: any Provides: rtai-headers Depends: linux-headers-_KVERS_, _GCC_ Description: rtai headers for compiling realtime modules. This package contains the set of headers and helper scripts for the RTAI realtime extension. |
This package was debianized by maintainer <maintainer@domain.com> on Sat, 16 Sep 2006 00:39:32 +0300. It was downloaded from http://www.rtai.org/ Upstream Authors: See RTAI Team at http://www.rtai.org/ Copyright: see AUTHORS License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA The Debian packaging is (C) 2007, maintainer <maintainer@domain.com> and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. |
#!/usr/bin/make -f PACKAGE := rtai-modules MA_DIR ?= /usr/share/modass -include $(MA_DIR)/include/generic.make -include $(MA_DIR)/include/common-rules.make # architecture we're building for DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) ARCH_TARGET := $(DEB_HOST_ARCH)-elf ifeq ($(DEB_HOST_ARCH),amd64) ARCH_TARGET := x86_64-elf endif ifeq ($(DEB_HOST_ARCH),powerpc) ARCH_TARGET := powerpc-be-eabi endif ifeq ($(DEB_HOST_ARCH),mips) ARCH_TARGET := mipsisa32-be-elf endif ifeq ($(DEB_HOST_ARCH),mipsel) ARCH_TARGET := mipsisa32-be-elf endif ifeq ($(DEB_HOST_ARCH),arm) ARCH_TARGET := arm9-le-thumb-elf endif .PHONY: kdist_config fix_cdeps fix_cdeps: cd debian ; cp control.modules.in control.modules.tmp 2>/dev/null ; \ sed -e 's/_GCC_/$(CC)/g' < control.modules.tmp > control.modules.in ; \ rm control.modules.tmp kdist_config: fix_cdeps prep-deb-files .PHONY: binary_modules binary-modules binary-modules: binary_modules binary-modules: kdist_config dh_testdir dh_testroot dh_clean -k # Build and install the module $(MAKE) install DESTDIR=$(CURDIR)/debian/rtai-dev-$(KVERS) # Move the kernel modules to the correct location mkdir -p $(CURDIR)/debian/rtai-modules-$(KVERS)/usr/realtime/modules mv -f $(CURDIR)/debian/rtai-dev-$(KVERS)/usr/realtime/modules/* $(CURDIR)/debian/rtai-modules-$(KVERS)/usr/realtime/modules/ # copy the Scilab macros in deb mkdir -p $(CURDIR)/debian/rtai-modules-$(KVERS)/usr/realtime/rtai-lab/scilab/macros cp -fr $(CURDIR)/rtai-lab/scilab/macros/* $(CURDIR)/debian/rtai-modules-$(KVERS)/usr/realtime/rtai-lab/scilab/macros/ dh_installdebconf dh_installdocs dh_compress dh_installdeb dh_makeshlibs -prtai-dev-$(KVERS) dh_shlibdeps -prtai-dev-$(KVERS) dh_gencontrol -- -v$(VERSION) dh_md5sums dh_builddeb --destdir=$(DEB_DESTDIR) .PHONY: kdist_clean kdist_clean: # dh_testdir # dh_testroot # dh_clean # rm -f install.log # $(MAKE) -C $(CURDIR) distclean |
#!/bin/sh -e for n in `seq 0 15`; do f="/dev/comedi$n" if [ ! -c $f ] ; then mknod -m 666 $f c 98 $n fi done |
To fix the problem, delete the following part from the patch file.
8 lines after the line 2934
@@ -765,7 +767,6 @@ config HOTPLUG_CPU endmenu - menu "Power management options (ACPI, APM)" depends on !X86_VOYAGER |