Difference between revisions of "LXRT-Howto"

From Mca2
Jump to navigationJump to search
(Download and Patching)
(moved content to sub page and added other kernel/rtai combinations)
Line 3: Line 3:
This section gives a step by step example on how LXRT could be used with mca2.
This section gives a step by step example on how LXRT could be used with mca2.
=== Download and Patching ===
* [[kernel_2_4_29_rtai_3_2| kernel 2.4.29 and rtai 3.2]]
* Create a directory of your choice
* [[kernel_2_4_32_rtai_3_3| kernel 2.4.32 and rtai 3.3]]
  {{cmd|[~]$ mkdir /tmp/rtai-test<br/>[~]$ cd /tmp/rtai-test}}
* [[kernel_2_6_8_rtai_3_3| kernel 2.6.8 and rtai 3.3]]
* Download [[File:mca2.4.0.tgz|MCA2]] from {{mcasf}}
  {{cmd|[/tmp/rtai-test]$ tar xzf mca2.4.0.tgz}}
* Download the [[File:linux-2.4.29.tar.bz2|linux kernel 2.4.29]] from ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.29.tar.bz2:
  {{cmd|[/tmp/rtai-test]$ tar xjf linux-2.4.29.tar.bz2}}
:Note: If you want to use a 2.6 kernel, use version or older. Otherwise you will have a hard time getting the combination adeos/rtai3.2/mca to work properly.
* Download [[File:rtai-3.2.tar.bz2|rtai3.2 (vulcano)]] from http://www.rtai.org/modules.php?name=Downloads&d_op=viewdownload&cid=1
  {{cmd|[/tmp/rtai-test]$ tar xjf rtai-3.2.tar.bz2}}
* Download [[File:adeos-linux-2.4.29-i386-r16.patch|adeos-patch]] corresponing to the kernel at http://download.gna.org/adeos/patches/v2.4/i386/
  {{cmd|[/tmp/rtai-test]$ mv adeos-linux-2.4.29-i386-r16.patch rtai3.2/base/arch/i386/patches/<br>
[/tmp/rtai-test]$ cd linux-2.4.29<br>
[/tmp/rtai-test/linux-2.4.29]$ patch -p1 < ../rtai-3.2/base/arch/i386/patches/adeos-linux-2.4.29-i386-r16.patch}}
:Note: For use with rtai3.2 you should use the older version of adeos (not those named ''ipipe''-something) found at http://download.gna.org/adeos/patches/attic/v2.4/i386/ and http://download.gna.org/adeos/patches/attic/v2.6/i386/.
* Build the linux kernel. linux-2.4.29.config is the kernel config we use.
  {{cmd|[/tmp/rtai-test/linux-2.4.29]$ make mrproper <br>
[/tmp/rtai-test/linux-2.4.29]$ cp ../mca2/etc/linux-2.4.29.config .config <br>
[/tmp/rtai-test/linux-2.4.29]$ make oldconfig <br>
[/tmp/rtai-test/linux-2.4.29]$ make dep bzImage modules <br>
[/tmp/rtai-test/linux-2.4.29]$ cd ..}}
* Patch rtai3.2 with the mca2 patch and prepare for use with mca2:
  {{cmd|[/tmp/rtai-test]$ cd rtai3.2<br>
[/tmp/rtai-test/rtai3.2]$ patch -p1 < ../mca2/etc/mca2-rtai3.2.patch <br>
[/tmp/rtai-test/rtai3.2]$ ln -s ../linux-2.4.29 linux}}<br>
* Build rtai3.2.
  {{cmd|<nowiki>[/tmp/rtai-test/rtai3.2]$ ./configure --with-linux-dir=/tmp/rtai-test/linux-2.4.29</nowiki><br/>
[/tmp/rtai-test/rtai3.2]$ cd base/include/<br/>
[/tmp/rtai-test/rtai3.2/base/include]$ ln -s ../../rtai_config.h .<br/>
[/tmp/rtai-test/rtai3.2/base/include]$ cd ../.. <br/>
[/tmp/rtai-test/rtai3.2]$ make}}
* Build mca2 with lxrt
  {{cmd|[/tmp/rtai-test/rtai3.2]$ cd ../mca2<br>
[/tmp/rtai-test/mca2.4.0]$ <nowiki>scons configure=yes lxrt_dir=/tmp/rtai-test/rtai3.2 </nowiki><br>
[/tmp/rtai-test/mca2.4.0]$ source script/mcasetenv <br>
[/tmp/rtai-test/mca2.4.0]$ scons
=== Testing ===
* Install your kernel/modules and boot your rtai-enabled system
* Load kernel modules
If you compiled the Adeos part of your kernel as a module, first do
  {{cmd|[/tmp/rtai-test/mca2.4.0]$ modprobe adeos}}
Then load the rtai kernel modules
  {{cmd|[/tmp/rtai-test/mca2.4.0]$ insmod /tmp/rtai-test/rtai3.2/modules/rtai_hal.o <br>
[/tmp/rtai-test/mca2.4.0]$ insmod /tmp/rtai-test/rtai3.2/modules/rtai_lxrt.o <br>
[/tmp/rtai-test/mca2.4.0]$ insmod /tmp/rtai-test/rtai3.2/modules/rtai_sem.o  <br>
[/tmp/rtai-test/mca2.4.0]$ insmod export/i686_Linux_debug/bin/mca_lxrt_extension.o <br>
:Note: In kernel 2.6.x the modules are named .ko <br>
:Note: Don't modprobe the modules, as then more than one scheduler may be inserted. The system will not work then.<br>
* Test it
{{cmd|[/tmp/rtai-test/rta]$ time_test<br>
:Call time_test twice with --no-lxrt and compare the summarized measured time values.

Revision as of 12:41, 5 May 2006


This section gives a step by step example on how LXRT could be used with mca2.