Dear all,
here is a procedure from someone with less programming expirence.
I hope that this will help someone.
Joerg Demtroeder
HowTo install RT Linux under SuSE 6.0 with Kernel 2.0.36
Written by Joerg Demtroeder
eMail: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Introduction:
This procedure is written for people with less expirience in software programming.
Basic knowledge about C and
UNIX is very usefull.
It is my aim, to show a way for the installtion and the start of the first test
programm (Servo Control) written by
Bernhard Kuhn.
1. Installation of SuSE 6.0
1.1 Additional packages
2. Download of the files
3. Build the standard Kernel
3.1 Patch and build of the RT Kernel
3.2 Patch the Kernel
4. Build the RT Modules
5. Build the Servo Control Test application
5.1 Run the Servo Control application
1. Installation of SuSE 6.0
? Boot from the SuSE Bootdisk and follow the instruction
? Select the SuSE default system for the installtion
? Configure your system as you like it. E.g. Printer Network etc.
? Install the boot methode you like lilo or loadlin.
? Finish the installtion and boot the system.
? Login as root and let yast do his work.
? Configure X that the command startx works.
1.1 Additional packages
To run and compile the Servo Control application it is nessecary to install some more
packages.
? Call up yast select the installation source.
? Then configure the packages
? Under the Programmdevelopment package (d) select for installation.
- gpp GNU C++ Compiler
? Under the Development under X11 package (xdev) select the following items:
- qtcompat - wxwin
- qtdevel - wxwstat
- qtext - wxxt
- qtlib - xforms
? Start the installtion and reboot the system
2. Download the files
? From the SuSE internet pages downlaod a patch for the compilers to build a stabel
kernel.
http://www.suse.de/~florian/kernel+egcs.html (3240 Bytes)
On the top of the page you find a link called patches. Holddown the SHIFT key and
press the left mouse button to
get the "Save as Menu" and save the file. E.g. : /root/download/linux-2.0.x.patch
? From the RT Linux homepage download the kernel patch, for SuSE 6.0 with the
installed Kernel 2.0.36
it is the file: rtlinux1.1.tgz
If you are not sure wich kernelversion is installed on your system type at a
terminal window
the command uname -a.
http://rtlinux.org/~rtlinux
In the download area you find the Version V1.1 for Linux 2.0.36.
Holddown the SHIFT key and press the left mouse button to get the "Save as
Menu" and save
the file. E.g. :/root/download/rtlinux1.1.tgz (101 755 Bytes)
? From the linux-magazinhomepage download/print the report of Bernhard Kuhn
about RT linux and the example for the control of Servos.
http://www.linux-magazin.de/ausgabe.1998.11/Rtlinux/rtlinux2.html (37 827 Bytes)
? To download the sources use the following from a link at the end of the report. In
the Info Frame
you find a link with the label "hier".
http://www.linux-magazin.de/ausgabe.1998.11/Rtlinux/servo.tgz (3018 Bytes)
Save the file to e.g. : /root/download/servo.tgz
3. Build the standard Kernel
If you already build and installed succesfull a kernel with your current installtion
you can skip this point.This is only a
test to see that everything works and you know that the basic kernel setup will work
and do what you are expecting.
For detailed information about the kernel setup see in the handbook chapter VI.
? Login as root and start X windows with startx
? Open a Terminal window and move with cd /usr/src/linux into the Linux Directory
? Type make xconfig to configure the kernel and save the configuration as
standardkernel. Then exit the tool.
? Now type the following commands, for detailed information see the handbook page 338:
make dep
make clean
make zImage
If you have configured your kernel to use modules type
make modules
make modules_install
? I you use lilo to boot the system edit know the file /etc/lilo.conf and add your new
boot image. It is also a good
idear to keep the old kernel to have fall back position. For details see page 339 in
the SuSE handbook.
? Printout of my lilo.conf file:
# LILO Konfigurations-Datei
# Start LILO global Section
boot=/dev/hda
#compact # faster, but won't work on all systems.
read-only
prompt
timeout=100
vga = normal # force sane state
# End LILO global section
# DOS bootable partition config begins
other = /dev/hda1
label = NT
table = /dev/hda
# DOS bootable partition config ends
#
# Linux bootable partition config begins
image = /boot/vmlinuz.org
root = /dev/hda7
label = Linux.org
# Linux bootable partition config ends
#
# RT Linux
image = /boot/vmlinuz
root = /dev/hda7
label = rtl
# Linux bootable partition config ends
#
? Now run the command make zlilo.
? Boot the system from the new Kernel and have a look that no boot errors ocur
and the system works as expected.
3.1 Patch and build of the RT Kernel
? Login as root and start X Windows
? Change with cd /usr/src to /usr/src-
? Unpack the Kernelpatch with:
tar -xzvf /root/download/rtlinux1.1.tgz
? Change into the Linux directory with cd linux
? Start the kernel patch with:
patch -p1 </usr/src/rtlinux/kernel_patch
? Now it is time to configure your kernel with make xconfig, if you have a good
configuration, use this configuration.
? To build the kernel type the following commands:
make clean
make dep
make bzImage (With make zImage the build failed !!)
make modules
make modules_install
? Config the the file /etc/lilo.conf with a new boot Image. For details see under 3.
Build the standard Kernel in this
document.
? When the change is done type:
make bzlilo
? When all task run trough with any errors, it is now time to reboot the system.
? After a succesfull reboot login as root and type to test the RT kernel
ksyms -a |grep " "rt_ |wc -l
? If the result is a number greater than 0, the kernel build a success.
? The RT system needs now four devices, the realtime fifos
mknod /dev/rtf0 c 63 0
mknod /dev/rtf1 c 63 1
mknod /dev/rtf2 c 63 2
mknod /dev/rtf3 c 63 3
3.2 Patch the Kernel
The Kernel pach must be done to compile the the realtime Modules, otherwise
you will receive some error messages where you get the information to patch
your Kernel.
? Boot the system and login as root
? Change with cd /usr/src/linux into the right directory
? Patch the kernel with patch -s -p1 < /root/download/linux-2.0.x.patch
? Reboot the system
4. Build the RT Modules
Before you can use the Realtime Modules, you have to build them.
? Change into the right directory with cd /usr/src/rtl.You will find the following
entry in this directory:
-rw-r--r-- 1 root root 3040 Jul 13 16:26 Makefile
-rw-r--r-- 1 root root 547 Jul 13 16:26 README
drwxr-xr-x 7 root root 1024 Jul 13 16:26 examples
drwxr-xr-x 2 root root 1024 Jul 15 11:30 fifos
drwxr-xr-x 2 root root 1024 Jul 13 16:26 include
drwxr-xr-x 2 root root 12288 Jul 9 12:46 lost+found
drwxr-xr-x 2 root root 1024 Jul 15 11:30 modules
drwxr-xr-x 3 500 500 1024 Jul 13 13:03 rtlinux
drwxr-xr-x 3 root root 1024 Jul 15 11:30 schedulers
drwxr-xr-x 4 root root 1024 Jul 15 11:30 semaphores
For details read the README file.
- To build the modules type make all
- To confirm the build check the directory modules
cd modules
ls -l
Printout of the ls -l command:
-rw-r--r-- 1 root root 6000 Jul 15 11:30 rtl_fifo.o
-rw-r--r-- 1 root root 9096 Jul 15 11:30 rtl_nfifo.o
-rw-r--r-- 1 root root 5136 Jul 15 11:30 rtl_sched.o
5. Build the Servo Control Test application
For a detailed description of this RT test task see the report from Bernhard
Kuhn (http://www.linux-magazin.de/ausgabe.1998.11/Rtlinux/rtlinux2.html).
If you do not want to build / buy the hardware you can also use a standard
scope to check the signals produced from the program.
? Login as root
? Unpack the file into the /root/servo directory with:
cd /root/servo
tar -xzvf /root/download/servo.tgz
? The ls -l command should give you the following listing:
-rw-r--r-- 1 500 users 378 Jul 14 12:00 Makefile
-rw-r--r-- 1 500 users 595 Jul 6 1998 README
-rw-r--r-- 1 500 users 866 Jul 13 12:53 rt_ctrl.c
-rw-r--r-- 1 500 users 2823 Jul 13 12:51 rt_servo.c
-rw-r--r-- 1 500 users 1770 Jul 13 12:44 servo.cpp
-rw-r--r-- 1 500 users 307 Jul 6 1998 servodata.h
- Under normal conditions the makefile will fail when you start now the make
process. There are a few changes to to that the make will run through
without any problems. The reason for these changes is that each system is
setup differnt and that the pathes have to be setup in the right way.
If you have a problem with the make and you do not know where the file is
e.g. qslider.h use the following comand: find / -name qslider.h -print
Remember that the LPT1 address is set to 0x378 !!!
? Changes in Makefile:
Line 4: moc -p /usr/lib/qt/include -o servo.moc.cpp servo.cpp
Line 5: g++ -I /usr/lib/qt/include -o servo servo.cpp -lqt
? Changes in rt_ctrl.c:
Line 7: #include </usr/src/rtlinux/rtl/include/rtl_sched.h>
Line 8: #include </usr/src/rtlinux/rtl/include/rtl_fifo.h>
? Changes in rt_servo.c:
Line 9: #include </usr/src/rtlinux/rtl/include/rtl_sched.h>
Line 10: #include </usr/src/rtlinux/rtl/include/rtl_fifo.h>
? Changes in servo.cpp:
Line 8: #include "/usr/lib/qt/include/qapp.h"
Line 9: #include "/usr/lib/qt/include/qslider.h"
Line 10: #include "/usr/lib/qt/include/qlayout.h"
? If the changes are done type : make all
? When the make was a success the ls -l should give you this listing:
-rw-r--r-- 1 500 users 378 Jul 14 12:00 Makefile
-rw-r--r-- 1 500 users 595 Jul 6 1998 README
-rw-r--r-- 1 500 users 866 Jul 13 12:53 rt_ctrl.c
-rw-r--r-- 1 root root 1512 Jul 16 11:10 rt_ctrl.o
-rw-r--r-- 1 500 users 2823 Jul 13 12:51 rt_servo.c
-rw-r--r-- 1 root root 2012 Jul 16 11:10 rt_servo.o
-rwxr-xr-x 1 root root 14651 Jul 16 11:10 servo
-rw-r--r-- 1 500 users 1770 Jul 13 12:44 servo.cpp
-rw-r--r-- 1 root root 1382 Jul 16 11:10 servo.moc.cpp
-rw-r--r-- 1 500 users 307 Jul 6 1998 servodata.h
5.1 Run the Servo Control application
If you connect a servo to the lpt1, it is now time to do it. If you like to
use an oszilloskope connect the ground to pin 25 and the signal lead to 14
this is the first channel.
? Powerup the computer and login as root.
? To start the realtime process type the following commands:
insmod /usr/src/rtlinux/rtl/modules/rtl_fifo.o
insmod /usr/src/rtlinux/rtl/rtl/modules/rtl_sched.o
insmod /root/servo/rt_servo.o
/root/servo/servo
? To control type the lsmod command and get this listing:
Module Pages Used by
rt_servo 1 0
rtl_sched 1 [rt_servo] 0
rtl_fifo 2 [rt_servo] 1
? Check it out and enjoy ;-)
? To unload the RT Tasks type :
quit the servo task and check that the task is dead.
(ps -x and kill -9 PID if the taskis still aktiv)
rmmod rt_servo
rmmod rtl_sched
rmmod rtl_fifo