NOTES ON INSTALLING NMT RT-Linux Kernel-2.2.9+Beta4
===================================================
These notes pertain to kernel v2.2.9 and RT-Linux Beta4.
Decide now if you require the kernel in bz2 or gz format.
Since the beta 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.9.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.9.tar.gz | tar xvf -
__OR__
% bunzip2 -c linux-2.2.9.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
% make mrproper
CHECK HERE WHEN OK ______
4. 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:
% make xconfig
Remember to select SMP if you require it plus the enhanced real
time clock support!
CHECK HERE WHEN OK ______
5. Make the dependencies and clean up before proceeding:
% make dep
% make clean
CHECK HERE WHEN OK ______
6. 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 ______
7. 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 ______
8. Assuming your kernel built OK, build and install the modules:
% make modules
% make modules_install
CHECK HERE WHEN OK ______
9. 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 ______
10. 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 ______
11. 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/bzImage229
% cp /etc/lilo.conf /etc/lilo.conf.old
% echo "image=/boot/bzImage229" >> /etc/lilo.conf
% echo " label=linux229" >> /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, linux229. You should boot the new
kernel directly off the hard disk.
CHECK HERE WHEN OK ______
12. The rest of these notes assume that the regular linux kernel was
built successfully. Indeed, I am installing the beta4 RT-Linux
extensions from a working system booted with the v2.2.9 kernel.
First, back up the configured kernel tree that you just made
and clean the directories:
% cd /usr/src
% tar czvf /usr/src/linux-2.2.9.tar.gz linux
% cd /usr/src/linux
% make clean
CHECK HERE WHEN OK ______
13. Unpack the RT-Linux extensions in beta4:
% cd /usr/src
% gunzip -c beta4.tgz | tar xvf -
CHECK HERE WHEN OK ______
14. Return to the linux tree and patch the kernel:
% cd /usr/src/linux
% patch -p1 < /usr/src/beta/kernel_patch > ../patch.beta 2>&1
CHECK HERE WHEN OK ______
15. Check the patch file. The output I received is shown below and
reports no errors:
% more ../patch.beta
patching file `Makefile'
patching file `arch/i386/config.in'
patching file `arch/i386/kernel/i386_ksyms.c'
patching file `arch/i386/kernel/io_apic.c'
patching file `arch/i386/kernel/irq.c'
patching file `arch/i386/kernel/irq.h'
patching file `arch/i386/kernel/smp.c'
patching file `arch/i386/kernel/time.c'
patching file `fs/proc/array.c'
patching file `fs/proc/root.c'
patching file `include/asm-i386/delay.h'
patching file `include/asm-i386/irq.h'
patching file `include/asm-i386/rtl_sync.h'
patching file `include/asm-i386/system.h'
patching file `include/asm-i386/timex.h'
patching file `include/linux/cons.h'
patching file `include/linux/major.h'
patching file `include/linux/proc_fs.h'
patching file `include/linux/rtl.h'
patching file `include/linux/rtl_version.h'
patching file `init/main.c'
patching file `kernel/Makefile'
patching file `kernel/ksyms.c'
patching file `kernel/rtl.c'
CHECK HERE WHEN OK ______
16. Now go back and remake the kernel, modules, modules_install and
reboot from the floppy or hard drive as before. Note that I call
the new image on disk rtImage as opposed to bzImage (but you can
call it whatever you like):
% make dep
% make bzdisk
% make modules
% make modules_install
% rm /var/log/messages
% touch /var/log/messages
% rm /var/log/kernel
% touch /var/log/kernel
% kill -HUP `cat /var/run/syslogd.pid`
% cp /usr/src/linux/arch/i386/boot/bzImage /boot/rtImage229
% cp /etc/lilo.conf /etc/lilo.conf.old
% echo "image=/boot/rtImage229" >> /etc/lilo.conf
% echo " label=RTL-229" >> /etc/lilo.conf
% echo " root=/dev/hda3" >> /etc/lilo.conf
% echo " read-only" >> /etc/lilo.conf
% /sbin/lilo
% reboot
CHECK HERE WHEN OK ______
17. You should now be able to boot the linux kernel modified for
real time performance. The login banner I get is:
Red Hat Linux Release 5.2 (Apollo)
Kernel 2.2.9.RTL_G on an i686
login:
CHECK HERE WHEN OK ______
18. Now go to the beta directory and read the READMEFIRST file:
% cd /usr/src/beta
% more READMEFIRST
CHECK HERE WHEN OK ______
19. The beta release will not make from the unpacking directory so you
need to change some things around. Also you need to delete all the
old fifos as the major number has changed (and let the rtl make
re-create them):
% cd /usr/src
% mv beta/rtl rtl
% cd rtl
% pwd
/usr/src/rtl
% rm -i /dev/rtf*
CHECK HERE WHEN OK ______
20. If you require more than 4 fifos, edit the Makefile and copy the
lines making the fifo devices (starting mknod). I prefer fifos 0-9
but you can leave it alone if you wish. Then make the modules:
% make clean
% make
% make install
CHECK HERE WHEN OK ______
21. Initial test of the release is to insert the modules without error:
% cd /lib/modules/2.2.9.RTL_G/misc
% insmod rtl_time.o
% insmod rtl_sched.o
% insmod rtl_fifo.o
% lsmod
Module Size Used by
rtl_fifo 6748 0 (unused)
rtl_sched 35484 0 (unused)
rtl_time 7980 0 [rtl_sched]
CHECK HERE WHEN OK ______
22. Try making the frank, measurement and parallel examples (fp has never
worked for me):
% cd /usr/src/rtl/examples/frank
% make clean
% make
% cd /usr/src/rtl/examples/parallel
% make clean
% make
% cd /usr/src/rtl/examples/measurement
% make clean
% make
23. Test the examples. It is here that the makefiles do not appear to work
very well and some problems occur on multi-processor machines.
Unfortunately when I try to remove the measurement module, I get (wait
for it):
RTL measurement module on CPU 0
created RT-thread
Unable to handle kernel NULL pointer dereference at virtual address 00000000
current->tss.cr3 = 00101000, `r3 = 00101000
*pde = 00000000
Oops: 0000
CPU: 1
EIP: 0010:[<00000000>]
EFLAGS: 00010046
eax: 00000080 ebx: c009a000 ecx: c0205d74 edx: c009a000
esi: 00000000 edi: 00000000 ebp: 00000000 esp: c009bfb4
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 0, process nr: 1, stackpage=c009b000)
Stack: 00000246 00000000 c01e9bb4 00000000 00001100 00000000 c01e9b9c c01e5f78
00000001 000007de 00000000 00000018 00000018 00000078 c0107a96 00000010 00000206
00000001 00000001
Call Trace: [<c0107a96>]
Code: <1>
and the repetative message
rmmod rt_process
Removing module on CPU 0
Stuck on TLB IPI wait (CPU#0)
(to be continued ... after any answers are applied :-) )
--- [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/