Skip to main content.

======================================================================
========  RTAI for PowerPC Systems running DENX Linux 2.4.x  =========
======================================================================

Installation:
-------------

This installation assumes that you use the ELDK (Embedded Linux 
Development Kit, see http://www.denx.de/re/ELDK.html).

The following sample installation is for a TQM860L module, which 
requires the kernel source tree "linux-2.4" checked out with the 
revision tag "LABEL_2003_05_01_1320":

1. Checkout the DENX Linux kernel source tree with the specified 
   date. When prompted for a password for anonymous, simply press 
   the Enter key:

   $ LINUX_TREE="linux-2.4"
   $ CVS_TAG="LABEL_2003_05_01_1320"
   $ cvs -d :pserver:anonymous@www.denx.de:/cvsroot login
   $ cvs -z6 -d :pserver:anonymous@www.denx.de:/cvsroot \
     co -P -r $CVS_TAG $LINUX_TREE
   $ export LINUX_ROOT=$PWD/$LINUX_TREE


2. Get and apply the RTAI kernel patch. You may first want to use 
   the option "--dry-run" to check if it applies flawlessly:
  
   $ KERNEL_PATCH="patch-denx-${LINUX_TREE}-${CVS_TAG}"
   $ URL="ftp://ftp.denx.de/pub/RTAI/24.1.11"
   $ wget $URL/$KERNEL_PATCH

   $ cd $LINUX_ROOT
   $ patch  -p1 -b -z.PRE_RTAI < ../$KERNEL_PATCH


3. Configure and make the RTAI patched Linux kernel:

   $ export CROSS_COMPILE=ppc_8xx-
   $ make TQM860L_config
   $ make menuconfig
   ... make additional configuration ...
   $ make dep
   $ make pImage
   $ cp -p arch/ppc/mbxboot/pImage /tftpboot


4. Unfold, configure and make RTAI. [Instead of using the Validated 
   Release you could checkout "rtai4" from the CVS repository.]
   Usually the default configuration is OK. Just for the IBM 405GP 
   you must disable the floating point support manually.

   $ export CROSS_COMPILE=ppc_8xx-
   $ cd <directory-shared-with-target>
   $ wget $URL/rtai-24.1.11-denx.tar.bz2
   $ bzip2 -dc rtai-24.1.11-denx.tar.bz2 | tar xf -
   $ cd rtai-24.1.11
   $ make
   sh ./configure
   Enter location of Linux source tree [...]: /temp/rtai/linux-2.4
   using LINUXDIR=/temp/rtai/linux-2.4
   using CROSS_COMPILE=ppc_8xx-
   using ARCH=ppc
   #
   # Using defaults found in scripts/config.dist
   #
   *
   * Code maturity level options
   *
   *
   Prompt for experimental code (CONFIG_RTAI_EXPERIMENTAL) [N/y/?]
   *
   * Schedulers
   *
   UP scheduler (CONFIG_RTAI_SCHED_UP) [M/n/?]
   *
   * Features
   *
   *
   * Floating point support disabled (kernel reports non-FPU processor)
   *
   *
   *
   *
   * Subsystems
   *
   RT memory manager (CONFIG_RTAI_DYN_MM) [Y/m/n/?]
   FIFOs (CONFIG_RTAI_FIFOS) [M/n/?]
   Shared Memory (CONFIG_RTAI_SHMEM) [M/n/?]
   POSIX API (CONFIG_RTAI_POSIX) [M/n/?]
   Watchdog (CONFIG_RTAI_WATCHDOG) [N/m/?]
   *
   * Tests and Examples
   *
   Compile examples in kernel space (CONFIG_RTAI_EXAMPLES) [Y/n/?]
   Compile tests (CONFIG_RTAI_TESTS) [N/y/?]
   
   Makefiles for rtai should now be configured.
   Run 'make dep && make' to compile, then 'make install' to install.
   
   If rtai has never been installed on your system,
   then run 'make dev' to build the device files.
   
   Scheduler will default to UP scheduler.
   ...

   $ make


4. Boot the new Linux kernel on your target, create once the device 
   files, load the RTAI modules and run the example program "ex_sw"  
   and then the latency calibration test "latency_calibrate". There
   is also a demo script "load-rtai" available at $URL:

   ...
   tqm860l login: root
   Last login: Thu Nov 16 14:25:32 on ttyS0
   bash-2.04# uname -a
   Linux tqm860l 2.4.4-rthal5 #1 Thu Sep 26 18:18:01 CEST 2002 ppc unknown
   ...
   bash-2.04# cd rtai-24.1.11
   bash-2.04# make dev
   ...
   bash-2.04# cd modules
   bash-2.04# insmod -m rtai.o > rtai.o.map
   rtai: decrementer frequency 5000000 Hz
   rtai: mounting
   rtai: mount done
   bash-2.04# insmod -m rtai_fifos.o > rtai_fifos.o.map
   bash-2.04# insmod -m rtai_sched.o > rtai_sched.o.map
   
   
   ==== RT memory manager v1.3 Loaded. ====
   
   
   ***** STARTING THE UP REAL TIME SCHEDULER WITH LINUX *****
   ***** FP SUPPORT AND READY FOR A PERIODIC TIMER *****
   ***<> LINUX TICK AT 100 (HZ) <>***
   ***<> CALIBRATED CPU FREQUENCY 5000000 (HZ) <>***
   ***<> CALIBRATED TIMER-INTERRUPT-TO-SCHEDULER LATENCY 2600 (ns) <>***
   ***<> CALIBRATED ONE SHOT SETUP TIME 400 (ns) <>***
   
   bash-2.04# insmod -m rtai_leds.o > rtai_leds.o.map
   bash-2.04# cd ../examples/sw
   bash-2.04# insmod -m ex_sw.o > ex_sw.o.map
   bash-2.04# rmmod ex_sw  
   
   
   CPU USE SUMMARY
   # 0 -> 102950
   END OF CPU USE SUMMARY
   
   bash-2.04# cd ../../latency_calibration
   bash-2.04# insmod -m latency_calibrate.o > latency_calibrate.o.map
   bash-2.04# ./check
   ## RTAI latency calibration tool 
   # overall=1
   # period=100000
   # avrgtime=1
   # use_fpu=0
   # start_timer=1
   
   1967/11/16 02:20:16   min:    19000    max:    40800    average:    21484
   1967/11/16 02:20:16   min:    19000    max:    42000    average:    21260
   ^C
   bash-2.04#