Hi,

Thanks to Paulo for the help but it has nothing to do with the "make mrproper"
step in the installation. It has everything to do with enabling version 
information on all symbols for modules!

It works out that during the "make xconfig" the menu LOADABLE MODULE SUPPORT
has (as it's second option) to "Set version information on all symbols for
modules". A look at the help text suggests that this is not an unreasonable
thing to do - but oh yes it is: make sure you set this option to NO or you
will be royally screwed. 

That done, it builds OK and loads fine. Here are my notes for those interested.

Regards,
P

+==================================================================+
 Phil Daly, NOAO/AURA, 950 N. Cherry Avenue, Tucson AZ 85719, U S A
 E-mail: [EMAIL PROTECTED]  V-mail: (520) 318 8438  Fax: (520) 318 8360




NOTES ON INSTALLING DIAPM RT-Linux Kernel-2.2.10+RTAI02x
========================================================

These notes pertain to kernel v2.2.10 and RTAI-02.x.
Decide now if you require the kernel in bz2 or gz format.
Since the beta8 real time extensions come in gz format, I
will assume you get the kernel the same way.

Caveat Emptor: these instructions worked for me. Your
mileage may vay. Please report problems (but do not expect me 
to fix them). By the way, I am installing this on a dual 
Pentium II 350MHz with 256Mb of main memory so all of the 
below is just a good mornings work :-)

0. Login as root and watch your typing!

                                                    CHECK HERE WHEN OK ______

1. Get the appropriate kernel from ftp.kernel.org (if the
   load is too high try ftp.us.kernel.org or something
   appropriate to your country):

      % cd /usr/src
      % ftp ftp.kernel.org
      username: anonymous
      password: [EMAIL PROTECTED]
      ftp> cd pub/linux/kernel/v2.2
      ftp> binary
      ftp> get linux-2.2.10.tar.gz
      ftp> quit

                                                    CHECK HERE WHEN OK ______

2. Move any old linux directory and unpack the kernel.

      % if [ -e linux ]; then mv linux linux.old; fi
      % gunzip -c linux-2.2.10.tar.gz | tar xvf -
   __OR__
      % bunzip2 -c linux-2.2.10.tar.bz2 | tar xvf -

                                                    CHECK HERE WHEN OK ______

3. Go to the linux directory and prepare the kernel. Make
   sure the asm include directory points to the correct
   directory in the linux source tree for your architechture!
 
      % cd linux
      % rm /usr/include/asm /usr/include/linux /usr/include/scsi
      % ln -s /usr/src/linux/include/asm-i386  /usr/include/asm
      % ln -s /usr/src/linux/include/linux     /usr/include/linux
      % ln -s /usr/src/linux/include/scsi      /usr/include/scsi

                                                    CHECK HERE WHEN OK ______

4. Get the latest RTAI release from www.aero.polimi.it from the RTAI
   sub-directory as the rtai-0.2x.tgz file at the login directory
   is not world readable:

      % cd /usr/src
      % ftp www.aero.polimi.it
      username: anonymous
      password: [EMAIL PROTECTED]
      ftp> cd RTAI
      ftp> binary
      ftp> get rtai-0.2x.tgz
      ftp> quit

                                                    CHECK HERE WHEN OK ______

5. Patch the kernel as per the instructions. Remember to check the location
   of LINUXDIR in the copyto file and fix it as required (if you do not
   have /bin/bash, edit the copyto file to use /bin/sh). Check the patches
   were applied OK by using diff (which should return with no output) and
   find:

          % gunzip -c rtai-0.2x.tar.gz | tar xvf -
          % cd rtai-0.2x
          % cd linux-2.2.10
          % grep 'LINUXDIR=' copyto
          LINUXDIR=/usr/src/linux
          % ./copyto
          % diff irq.c /usr/src/linux/arch/i386/kernel/
          % ^irq^time^
          % ^time^smp^
          % ^smp^io_apic^
          % ^io_apic^i386_ksyms^
          % diff system.h /usr/src/linux/include/asm-i386/
          % cd /usr/src/linux
          % find ./ -name "*.old" -print
          ./include/asm-i386/system.h.old
          ./arch/i386/kernel/irq.c.old
          ./arch/i386/kernel/time.c.old
          ./arch/i386/kernel/io_apic.c.old
          ./arch/i386/kernel/smp.c.old
          ./arch/i386/kernel/i386_ksyms.c.old

                                                    CHECK HERE WHEN OK ______

6. Configure the kernel for your system. The command "make config"
   should work on any dumb terminal but I prefer to use the
   menu-driven X-interface:

          % cd /usr/src/linux
          % make mrproper
      % make xconfig

   NB: Make sure to "Set version information on all symbols for modules" 
   in the loadable module support menu to N!!

   Remember to select SMP if you require it plus the enhanced real
   time clock support! 

                                                    CHECK HERE WHEN OK ______

7. Make the dependencies and clean up before proceeding:

      % make dep
      % make clean

                                                    CHECK HERE WHEN OK ______

8. Decide which kernel image you want to build. In my humble opinion the
   safest at this stage is bzdisk which compresses the kernel and makes
   a boot floppy. So, put a floppy in the drive and type:

      % make bzdisk 

   (other options are: % make zImage __OR__ % make bzImage)

                                                    CHECK HERE WHEN OK ______

9. The kernel should make without errors. If you get errors check your
   distribution and options and try again. Start at note 1.

                                                    CHECK HERE WHEN OK ______

10. Assuming your kernel built OK, build and install the modules:

      % make modules
      % make modules_install

                                                    CHECK HERE WHEN OK ______

11. Prepare your machine for a reboot. The following just cleans up
   some files (which may not be present on your system):

      % rm /var/log/messages
      % touch /var/log/messages
      % rm /var/log/kernel
      % touch /var/log/kernel
      % kill -HUP `cat /var/run/syslogd.pid`

   If the above commands do not work, ignore them as they are purely
   housecleaning options.

                                                    CHECK HERE WHEN OK ______

12. You can boot from the floppy by putting the floppy in the drive
    and typing:

      % reboot

   The system should boot normally (for your architecture). If it does
   not, and you have LILO, try step 11. If both fail, return to step
   1 and try again.

                                                    CHECK HERE WHEN OK ______

13. You can boot from the hard drive with LILO. Here I force
    the /etc/lilo.conf file to accept a new boot sequence but it
    might be easier for you to edit the file with vi, emacs etc.
    Be aware that you partition might not be called /dev/hda3!
    Note the tabs in the following echo statements.

      % cp /usr/src/linux/arch/i386/boot/bzImage /boot/rtai2210
      % cp /etc/lilo.conf /etc/lilo.conf.old
      % echo "image=/boot/rtai2210"    >> /etc/lilo.conf
      % echo "  label=rtai2210"        >> /etc/lilo.conf
      % echo "  root=/dev/hda3"        >> /etc/lilo.conf
      % echo "  read-only"             >> /etc/lilo.conf
      % /sbin/lilo
      % reboot

    and at the LILO: prompt type, rtai2210. You should boot the new
    kernel directly off the hard disk.

                                                    CHECK HERE WHEN OK ______

14. Make the RTAI modules: 

      % cd /usr/src/rtai-0.2x
          % ./cleanall
          % ./makeall

                                                    CHECK HERE WHEN OK ______

15. Initial test of the release is to insert the modules without error:

      % ./ldmod
      % lsmod
      Module                  Size    Used by
      rtai_sched             11332     0  (unused)
      rtai_fifos              8420     0  (unused)
      rtai                   14116     0  [rtai_sched rtai_fifos]

                                                    CHECK HERE WHEN OK ______

16. Because NMT RT-Linux and DIAPM RT-Linux use fifos with different
        major numbers, we must re-make them. You can do this manually or use
        the utility appended below:

          % ./mkrtf.sh 63

17. Test the examples. I did not bother with the examples that toggle
        the output port.

          % cd /usr/src/rtai-0.2x
          % ./remod
          % ./ldmod
          % cd examples/timer
          % rmmod rtai_sched
          % insmod rt_process
          % ./checkloop
          TRUNCATING
          GO
          (ctrl/C after a short while)
          % rmmod rt_process
          % tail /var/log/messages

          % cd /usr/src/rtai-0.2x
          % ./remod
          % ./ldmod
          % cd examples/tasktimer
          % insmod rt_process
          % ./checkloop
          TRUNCATING
          GO
          (ctrl/C after a short while)
          % rmmod rt_process
          % tail /var/log/messages

          % cd /usr/src/rtai-0.2x
          % ./remod
          % ./ldmod
          % cd examples/sound
          % insmod rt_process
          % cat linux.au > /dev/rtf0
          % rmmod rt_process

          % cd /usr/src/rtai-0.2x
          % ./remod
          % ./ldmod
          % cd examples/sem_clock
          % make insmod
          (type in r then c then f without carriage returns)
          % make rmmod

          % cd /usr/src/rtai-0.2x
          % ./remod
          % ./ldmod
          % cd examples/msg_clock
          % make insmod
          (type in r then c then f without carriage returns)
          % make rmmod

18. Congratulations. RTAI is installed and appears to be working.

+===CUT HERE===========================+

#!/bin/sh
#
# Utility  : rtai.sh
# Author   : P N Daly
# Date     : 25-June-1999, ([EMAIL PROTECTED])
# Warranty : None, use at own risk
# System   : Linux kernel v2.2.10, RT-Linux patch Beta8
# Usage    :   
#  To insert modules
#   %./rtai.sh start
#  To remove modules
#   %./rtai.sh stop
#  To check modules
#   %./rtai.sh status
#  Note that modules in () were not present or not found

# Where are the modules
MOD_DIR=/usr/src/rtai-0.2x
MOD_FILE=/var/lock/subsys/rtai.modules

# See how we were called
case "$1" in
  start|insert)
        touch ${MOD_FILE}
        echo -n "Inserting RTAI modules: "
        if [ -f ${MOD_DIR}/rtai ] ; then
          echo -n " rtai"
          /sbin/insmod -f ${MOD_DIR}/rtai || echo -n " not inserted"
        fi
        if [ -f ${MOD_DIR}/modules/rtai_fifo ] ; then
          echo -n " rtai_fifo"
          /sbin/insmod -f ${MOD_DIR}/modules/rtai_fifo || echo -n " not inserted"
        fi
        if [ -f ${MOD_DIR}/modules/rtai_sched ] ; then
          echo -n " rtai_sched"
          /sbin/insmod -f ${MOD_DIR}/modules/rtai_sched || echo -n " not inserted"
        fi
        echo ""
        ;;
  stop|remove)
        echo -n "Removing RTAI modules: "
        MODINS=`/sbin/lsmod | /bin/grep rtai_fifo`
        if [ "$MODINS" ]; then
          echo -n " rtai_fifo"
          /sbin/rmmod rtai_fifo
        else
          echo -n " (rtai_fifo)"
        fi
        MODINS=`/sbin/lsmod | /bin/grep rtai_sched`
        if [ "$MODINS" ]; then
          echo -n " rtai_sched"
          /sbin/rmmod rtai_sched
        else
          echo -n " (rtai_sched)"
        fi
        MODINS=`/sbin/lsmod | /bin/grep rtai`
        if [ "$MODINS" ]; then
          echo -n " rtai"
          /sbin/rmmod rtai
        else
          echo -n " (rtai)"
        fi
        echo ""
        rm -f ${MOD_FILE}
        ;;
  status)
        echo -n "Checking RTAI modules: "
        MODINS=`/sbin/lsmod | /bin/grep rtai_fifo`
        if [ "$MODINS" ]; then
          echo -n " rtai_fifo"
        else    
          echo -n " (rtai_fifo)"
        fi
        MODINS=`/sbin/lsmod | /bin/grep rtai_sched`
        if [ "$MODINS" ]; then
          echo -n " rtai_sched"
        else
          echo -n " (rtai_sched)"
        fi
        MODINS=`/sbin/lsmod | /bin/grep rtai`
        if [ "$MODINS" ]; then
          echo " rtai"
        else
          echo " (rtai)"
        fi
        ;;
  *)
        echo "Usage: rtai {start|stop|status}"
        exit 1
esac

# Exit normally
exit 0

+===CUT HERE===========================+

#!/bin/sh
#
# Utility  : mkrtf.sh
# Author   : P N Daly
# Date     : 25-June-1999, ([EMAIL PROTECTED])
# Warranty : None, use at own risk
# System   : Linux kernel v2.2.10 (but it shouldn't matter)
# Usage    :   
#  To make fifos with major number 150
#   %./mkrtf.sh 150
#  To make fifos with major number 63
#   %./mkrtf.sh 63

# NB: if you need more than 10 fifos, edit the line below
NUM_FIFOS=10

# Delete the existing fifos
for file in /dev/rtf*
do
  echo "Removing $file"
  rm -f $file
done

# make new fifos with the supplied major number
num=0
while [ $num -le $NUM_FIFOS ]
do
  echo "Creating /dev/rtf$num with major number $1 minor number $num"
  /bin/mknod /dev/rtf$num c $1 $num
  num=`/usr/bin/expr $num + 1`
done

# Exit normally
exit 0

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to