<a href="http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Debian_Lenny_Compile_RTAI#Regenerate_the_kernel_module_dependencies">regenerate the kernel module dependencies.</a> |
<a href="http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Debian_Lenny_Compile_RTAI#Regenerate_the_kernel_module_dependencies">regenerate the kernel module dependencies.</a> |
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 Lenny to compile RTAI.
su - aptitude update && aptitude safe-upgrade aptitude install \ kernel-package \ build-essential \ dh-make \ module-assistant \ libncurses5-dev \ zlib1g-dev \ dh-kpatches \ fakeroot \ autoconf \ dctrl-tools |
Because of dependencies the following packages will be installed too
kernel-package -> binutils build-essential dpkg-dev g++ g++-4.3 gcc gcc-4.3 gettext intltool-debian libc6-dev libcompress-raw-zlib-perl -> libcompress-zlib-perl libdigest-hmac-perl libdigest-sha1-perl libfile-remove-perl libgomp1 libio-compress-base-perl -> libio-compress-zlib-perl libio-stringy-perl libmail-box-perl libmail-sendmail-perl libmailtools-perl libmime-types-perl -> libobject-realize-later-perl libstdc++6-4.3-dev libsys-hostname-long-perl libtimedate-perl liburi-perl -> libuser-identity-perl linux-libc-dev make patch po-debconf dh-make -> debhelper html2text
touch /etc/udev/rules.d/92-rtai.rules |
Edit /etc/udev/rules.d/92-rtai.rules with your favorite editor.
ACTION!="add|change", GOTO="rtai_end" KERNEL=="rtf*", MODE="0666" KERNEL=="rtai*", MODE="0666" LABEL="rtai_end" |
Edit /etc/security/limits.conf with your favorite editor.
Add the following line
* hard memlock 8192 |
adduser your_user_name src |
Logout and re-login for the change to take effect.
cd mkdir rtai cd rtai |
wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.5.tar.bz2 tar xjf linux-2.6.30.5.tar.bz2 -C /usr/src ln -s linux-2.6.30.5/ /usr/src/linux |
NOTE: rtai_3.7.1.orig.tar.gz is the daily snapshot (07 Sep 2009) of the RTAI's Vulcano repository. The name of the source tarball must be as <packagename>_<upstream_version>.orig.tar.gz to Debianize |
wget http://linuxcnc.org/experimental/lenny/rtai_3.7.1.orig.tar.gz tar zxf rtai_3.7.1.orig.tar.gz |
wget http://linuxcnc.org/experimental/lenny/rtai_3.7.1-2.diff.gz cd rtai-3.7.1/ gunzip -c ../rtai_3.7.1-2.diff.gz | patch -p1 --dry-run gunzip -c ../rtai_3.7.1-2.diff.gz | patch -p1 chmod u+x debian/rules |
dpkg-buildpackage -rfakeroot -uc |
The following files will be built in the upper directory:
cd .. su dpkg -i librtai1_3.7.1-2_i386.deb dpkg -i librtai-dev_3.7.1-2_i386.deb dpkg -i rtai-source_3.7.1-2_i386.deb exit |
cd /usr/src/linux make-kpkg clean time fakeroot make-kpkg --initrd \ --append-to-version -rtai \ --revision r1 \ --added-patches rtai \ --config menuconfig \ kernel-image \ kernel-headers \ kernel-source |
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 multi 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.
NOTE: No need to disable Module Versioning Support for RTAI 3.7.1 but it's needed to
regenerate the kernel module dependencies.
You can prefer to disable Module Versioning Support, if you don't want to deal with the kernel module dependencies. Loadable module support ---> Module versioning support ---> disabled |
NOTE: No need to disable High Memory Support for RTAI 3.7.1 and newer
|
NOTE: No need to disable Symmetric multi-processing support for the uniproccesor machine for RTAI 3.7.1 and newer. But if you don't have a multi cores CPU or SMP system, you can prefer to disable it to improve the performance |
After to finish all changes, save and exit from menuconfig.
cd /usr/src su dpkg -i linux-image-2.6.30.5-rtai_r1_i386.deb dpkg -i linux-headers-2.6.30.5-rtai_r1_i386.deb rm linux ln -s linux-headers-2.6.30.5-rtai linux |
NOTE: If you have a SMP system, dedicate the last core/CPU to the realtime tasks,
resulting in a significant increase in performance. Edit /boot/grub/menu.lst and add isolcpus parameter to the end of the kernel line of the RTAI kernel. The value of the isolcpus parameter will be the number of the last core/CPU. Start to count from #0. 1 for dual core/CPU system, 3 for quad core/CPU etc... This is the kernel line for my dual core machine kernel /vmlinuz-2.6.30.5-rtai root=/dev/sda5 ro isolcpus=1 |
reboot |
cd /usr/src tar jxf rtai-source.tar.bz2 cd /usr/src/linux fakeroot make-kpkg --append-to-version -rtai --added-modules rtai --config menuconfig modules_image |
For EMC2 2.3 and newer, enable CONFIG_RTAI_MATH parameter.
Base system ---> Other features ---> Mathfuns support in kernel ---> enabled
Default values are OK for other parameters. Save and exit.
cd /usr/src su dpkg -i rtai-modules-2.6.30.5-rtai_3.7.1-2+r1_i386.deb |
cd /usr/src/linux cp Module.symvers Module.symvers.old cat /usr/realtime/modules/Module.symvers >> Module.symvers ln -s /usr/realtime/modules/ /lib/modules/2.6.30.5-rtai/rtai depmod -a |
cd /usr/realtime/testsuite/user/latency; time ./run cd /usr/realtime/testsuite/user/preempt/; time ./run cd /usr/realtime/testsuite/user/switches/; ./run cd /usr/realtime/testsuite/kern/latency/; time ./run cd /usr/realtime/testsuite/kern/preempt/; time ./run cd /usr/realtime/testsuite/kern/switches/; ./run |
739f635c2aecb6eadcf46fd5023a6efa linux-image-2.6.30.5-rtai_r1_i386.deb f034cac05d7b293f79da927c243ea108 linux-headers-2.6.30.5-rtai_r1_i386.deb e5911a52b0321fe9340503d64cbf4d11 rtai-modules-2.6.30.5-rtai_3.7.1-2+r1_i386.deb 04385cdc5c24a15b78bd9ab3859672a1 librtai1_3.7.1-2_i386.deb 2cbbd4b4474f912ac09fee590e29ac0c librtai-dev_3.7.1-2_i386.deb b01f1c4bac6f40c3820474050cba9595 config-2.6.30.5-rtai 69efdf2a0b2a09c92d5e4e963ad11b0f rtai_3.7.1.orig.tar.gz 2925d5057f14dfd809d063f1e8df1d89 rtai_3.7.1-2.dsc fd204bbc8f6d2666c60906ba776319a3 rtai_3.7.1-2.diff.gz
su - |
cd your_download_folder dpkg -i librtai1_3.7.1-2_i386.deb dpkg -i librtai-dev_3.7.1-2_i386.deb dpkg -i linux-image-2.6.30.5-rtai_r1_i386.deb dpkg -i linux-headers-2.6.30.5-rtai_r1_i386.deb dpkg -i rtai-modules-2.6.30.5-rtai_3.7.1-2+r1_i386.deb cd /usr/src/ ln -s linux-headers-2.6.30.5-rtai/ linux reboot |
su - |
c58bd4abd12fff7d319b7c7507e6c658 linux-image-2.6.22-rtai_r2_i386.deb ab04c24b3b561e3f3c5f86b939f6de33 linux-headers-2.6.22-rtai_r2_i386.deb e1613edaa36f14f77fbcd3cb5d113c64 linux-source-2.6.22-rtai_r2_all.deb 4810e03a05ff991aadee283ccda605ff rtai-modules-2.6.22-rtai_3.6+r2_i386.deb 3a2c60ade0102f3f77c9533ce5160311 rtai-dev-2.6.22-rtai_3.6+r2_i386.deb