		RTLINUX INSTALLATION INSTRUCTIONS
			FSM Labs, Inc. 
		   http://www.fsmlabs.com


DOWNLOADING THE APPROPRIATE LINUX KERNEL:
-----------------------------------------

In order to compile the RTLinux kernel, you first need to download the
kernel for which RTLinux was built.  To do so, note that there are two
patches in the top-level directories:

	kernel_patch-2.2, and
	kernel_patch-2.4

Where:

kernel_patch-2.2 is for 2.2.18 (x86 only):
 http://ftp.kernel.org/pub/linux/kernel/v2.2/linux-2.2.18.tar.gz

kernel_patch-2.4 is for 2.4.0-test1 (x86, PowerPC, Alpha):
 http://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.0-test1.tar.gz

Choose which of the two Linux kernels you would like to run, and
download it from the appropriate website, as described above.


PREPARING FOR INSTALLATION:
---------------------------

Make sure you have gcc 2.7.2.3 or egcs-1.1.2 or egcs-2.91 installed.
You can verify that with

	gcc -v

On Debian, it is enough to install the "gcc272" package. On RedHat systems,
one needs to install the "kgcc" RPM.
You may be able to use other compiler versions, but this is not recommended.


RTLINUX INSTALLATION:
---------------------

If you have downloaded the RTLinux distribution with a prepatched
kernel, skip steps 1 and 2. Quick check: if your kernel contains file
arch/i386/kernel/rtlinux.c, you do not need to patch the kernel.

1. put a fresh copy of the Linux kernel in the /usr/src/linux
directory:

	cd /usr/src
	tar xzf linux-2.2.18.tar.gz
	cd linux

1.b. If you haven't done so already, put a fresh copy of the RTLinux
kernel in the /usr/src/rtlinux directory:

	cd /usr/src
	tar xzf rtlinux.tar.gz

1.c. Create a symbolic link from within the rtlinux directory to the
linux directory:

	cd /usr/src/rtlinux
	ln -sf /usr/src/linux ./linux	

2. Patch the kernel with the RTLinux patch:

	cd /usr/src/linux
	patch -p1 < /usr/src/rtlinux/kernel_patch-2.2

OR, if you're using a 2.4.xx kernel:

	patch -p1 < /usr/src/rtlinux/kernel_patch-2.4

3. Now, configure the Linux kernel:

    cd /usr/src/linux	
    make config
      or
    make menuconfig
      or
    make xconfig

Note: Enabling APM support is not recommended.  APM BIOS calls may
have unpredictable effect on real-time performance.

Note: On Alpha, you need to enable RTLinux Support (CONFIG_RTLINUX). On i386
and PPC, this is done automatically.

Note: Please make sure to specify the correct CPU type for the target
machine.

4. After you are finished configuring the Linux kernel, type:

	 make dep

Note. Steps 5 through 7 are x86-specific.

5. Compile the Linux kernel and modules:

	make bzImage
	make modules

5.b Install the Linux modules:

	make modules_install
	cp arch/i386/boot/bzImage /boot/rtzImage

6. Configure LILO.  To do so, edit /etc/lilo.conf to contain the
   following piece (you only need to do this once):

image=/boot/rtzImage
	label=rtlinux
	read-only
	root=/dev/hda1

WARNING: replace /dev/hda1 in the above with your root filesystem. The
  easiest way to find out which filesystem it should be, take a look
  at the existing entry in your /etc/lilo.conf for "root=".
  Alternatively, type "df", and look for the line for "/" in the
  "mounted on" column. The corresponding entry in the "Filesystem"
  column is your root filesystem.

7. Install LILO. To do so, type:
	/sbin/lilo

7.b. Restart the computer:

	/sbin/shutdown -r now

7.c Load the RTLinux kernel: At the LILO: prompt, press "Shift" or
  "Tab".  This will give you a listing of the available kernels.
  Enter:

	rtlinux

RTLinux should boot.

8. Configure RTLinux:
	cd /usr/src/rtlinux
	make config OR 	make menuconfig  OR make xconfig

9. Compile RTLinux:
	make
	make devices
	make install

The last step will create the directory:

     /usr/rtlinux-xx (xx denotes the version) 

which contains the default installation directory for RTLinux which is
needed to create and compile user programs (that is, it contains the
include files, utilities, and documentation). It will also create a
symbolic link:

	  /usr/rtlinux 

which points to /usr/rtlinux-xx.  In order to maintain future
compatibility, please make sure that all of your own RTLinux programs
use /usr/rtlinux as its default path.

POST INSTALLATION AND RUNNING RTLINUX PROGRAMS:
-----------------------------------------------

To be able to run any programs, you must first load the rtlinux
modules. To do so, type:

	/usr/rtlinux/bin/rtlinux start

Or 

	/usr/rtlinux/bin/rtlinux start <programname>

where <programname> is the name of the rtlinux program/module you want
to run.

You can also try running the examples. To do so, simply go to the
appropriate directory under /usr/rtlinux/examples and type:

	make test

For example:

	cd /usr/rtlinux/examples/sound
	make test


SPECIAL NOTES:
--------------
If you change any Linux kernel options, please don't forget to do:

	cd /usr/src/rtlinux
	make clean
	make
	make install


DOCUMENTATION AND SOURCES OF HELP:
----------------------------------

The docs/html/GettingStarted document contains a brief introduction to
RTLinux. Additional documents in docs/html also provide information
about other aspects to RTLinux such as web installation, CD
installation, FAQ, and RTiC-Lab.

In case of problems, please consult the FAQ first, available in the
docs/ directory.

If all of the above fails, you can obtain help -- free of charge --
from your peers via the rtl@rtlinux.org mailing list for which you can
un/subscribe to via http://www.rtlinux.org/mailing_lists.html.

FSM Labs further provides commercial support, development, and
training.  Please contact FSM Labs at 

	business@fsmlabs.com for

additional information or visit their website at

	 http://www.fsmlabs.com.



