

                     I N S T A L L A T I O N





Overview of the installation process
====================================


Due to it's nature this package requires at least two computer systems. One
acts as a server, and at least one other will be setup as a diskless client.
Therefore this installation guide is divided into four sections:

	1.) Compilation and installation of utility programs on the server
	2.) Create a netbootable image of the target operating system
	3.) Setup of the server
	4.) Setup of the client including building the bootrom

The server has to support TCP/IP and certain protocols based on this network
standard. Most likely this will be a Unix-type server. Though it's probably
possible to also use servers running OS/2 or Windows-NT, for example, all
server related programs in this package can currently only be compiled on
a Unix-type host. This requirement is independed of the operating system
which is later booted on the diskless client. Therefore even if you want
to boot MS-DOS on your client(s) you need at least one Unix-type computer
for program compilation and generation of all boot files. Lateron when all
necessary files are built you can use any server you want.

This package contains two main parts:

	1.) The bootrom source and binaries. This part gets installed on
	    the diskless client. Though the sources are written for MS-DOS
	    development tools (MASM and Borland-C, unfortunately I coulnd't
	    find a free Intel-16-bit C compiler for Unix systems yet), all
	    binaries are already precompiled. There are no further user
	    changeable or adjustable options in the sources so you don't
	    have to have access to a DOS system to use the bootrom. You can
	    just use the binaries provided.
	    In order for the bootrom to access the network card in your
	    diskless client you need a driver. Currently the bootrom only
	    supports so called packet drivers, which are normally used on
	    MS-DOS systems to interface a network stack with the hardware.
	    With this package only the packet driver binaries are required,
	    so you don't need to recompile anything here as well. You can
	    find precompiled packet drivers for many popular network cards
	    on any SimTel FTP mirror (it's called Crynwr packet driver col-
	    lection), and for those of you without internet access some of
	    those packet driver binaries are included with this package.
	    Another good source for a packet driver for your network cards
	    might be the manufacturer. At least the well known manufacturers
	    (3Com and SMC for exmaple) provide packet drivers for their
	    complete product line. Those manufacturer provided packet drivers
	    are usually faster and easier to install than those from the
	    Crynwr collection, and can sometimes determine the hardware
	    configuration at runtime, which the Crynwr drivers can't. However,
	    there is a limitation in that you can only use packet drivers
	    which are COM-type executables. EXE-type programs are not
	    supported yet.

	2.) A set of programs to generate netbootable images on the server.
	    These programs are called mknbi-<os>, where <os> identifies the
	    operating system which is lateron running on the diskless client.
	    Currently only Linux and MS-DOS are supported. The mknbi programs
	    are the only ones which you have to compile.

There is another requirement which should not leave unnoted. Although you
can build a bootrom with slightly limited functionality which is less than
16kB in size, the usual size for a bootrom will be between 16kB and 32kB.
Therefore when you go shopping for a network card you should try to get
one which is able to support 32kB EPROM's. This is standard on almost all
cards from major manufacturers, but most cheap NE2000 are known to allow
only a maximum of 16kB. Also note that some network cards from 3Com and SMC
allow you to select ROM sizes of 32kB and more with their configuration
programs, but can physically support only 16kB!





Compilation and installation of utility programs on the server
==============================================================


This package uses GNU's autoconf to configure the compilation process
of the utility programs. You shouldn't have any problems to compile
these programs on any Unix-type system.

	1.) Cd into the netboot directory and run ./configure. It's
	    a configuration script generated by autoconf and checks
	    for header files and system specific details. The mknbi
	    utility programs contain some Intel assembler modules which
	    lateron run on the diskless client. If you want to assemble
	    these modules you need as86 and ld86, which you can get for
	    free for Unix systems. However, there are preassembled files
	    available so you actually don't need these two programs.
	    configure checks for their existence and creates the Makefiles
	    accordingly.
	    For an explanation of the switches available to configure
	    just run it with the --help option. Two additional switches
	    are available:

		--disable-mknbi-linux
		--disable-mknbi-dos

	    Choose these options if you don't want to create any of the
	    corresponding mknbi utility programs.

	2.) Check that all generated Makefiles and the config.h are correct
	    for your system.

	3.) Compile all programs with

		make dep
		make clean
		make

	    This will compile all programs without those which you disabled
	    during the configuration stage.

	4.) If you want to premanently install the utility programs on
	    your server you can run

		make install

	    This will also install the corresponding man pages for later
	    reference. However, it's perfectly ok to skip this step and
	    run the mknbi program from their source directories. But please
	    note that they are just called "mknbi" within their source
	    directories. Therefore if you read further down to run mknbi-dos,
	    you have to use "./mknbi-dos/mknbi" instead if you didn't install
	    the programs publicly.





Create a netbootable image of the target operating system
=========================================================


This step of the installation process depends on which operating you
want to boot on your diskless clients:

Linux:	With Linux you have far too many options to list them all in
	this text. Please refer to the mknbi-linux man page for all
	details. I will only describe the most common ways to setup a
	diskless Linux client here.
	First you have to decide where the Linux client is going to
	mount it's root filesystem from. This can either be a directory
	on an NFS server or a ram disk. Setup your Linux kernel accordingly.
	To use a root filesystem on an NFS server you should include TCP/IP
	network support into the kernel together with support for NFS file-
	systems. You cannot load this NFS support using a module as it has
	to be available at bootup. Additionally you also have to select
	NFSROOT support during kernel configuration. However, you don't
	need BOOTP or RARP support. Accordingly if you want to use ramdisk
	support the filesystem type you are going to use on the ramdisk has
	to be permanently compiled into the kernel. You don't need initrd
	support, though it makes it possible to remove the ramdisk lateron.


	1.) Configuring for NFS root filesystem.

	Next copy your Linux kernel into the current directory and run
	mknbi-linux:

		mknbi-linux -d rom -i rom -k zImage -o bootImage

	This supposes that your kernel image is called zImage, and gives
	you a netbootable image named bootImage.


	2.) Configuring for root filesystem on ramdisk

	If you want to use a ramdisk as a root device you have to create
	a ramdisk image first. Probably the easiest way to setup such an
	image is to use a floppy, though you can also use the loopback
	device if you are working on a Linux host. First format the floppy
	and make a filesystem on it. Next copy all programs and files onto
	it which you want to have on the root filesystem of the diskless
	client lateron. You should then test your root floppy. To do this
	copy your kernel onto another floppy with dd and set it's root device
	to floppy using rdev:

		dd if=zImage of=/dev/fd0
		rdev /dev/fd0 /dev/fd0

	Now boot your diskless client using this boot disk. After the kernel
	started up, it will ask you to insert the root floppy and to press
	enter. Your root floppy will be mounted.
	If everything works as you intended, you can now create a netbootable
	image. Re-insert the root floppy into your server system (or whereever
	this netboot directory is located), and type:

		dd if=/dev/fd0 of=ramImage
		gzip -9 ramImage
		mknbi-linux -d ram -i rom -r ramImage.gz -k zImage -o bootImage

	Like above this will now give you a file bootImage with the netbootable
	Linux kernel image in it.


MS-DOS:	To boot DOS on your diskless client you have to have a bootable floppy
	with MS-DOS Version 5.0 or higher on it. In order to create such a
	floppy you have to have a running MS-DOS system. On that system
	format a floppy using

		format a: /s

	and then copy all files onto it which your diskless client is lateron
	to see on it's C: drive. Before you create the netbootable image you
	should test that floppy by booting from it on the target client. If
	everything goes as intended you can then insert that floppy into the
	server (or whereever this netboot directory is located) and run
	mknbi-dos to create a netbootable image:

		mknbi-dos -r /dev/fd0 -o bootImage

	This assumes that you inserted the boot floppy into the fd0 drive
	of your server, and will create a file name bootImage. If your
	boot floppy is already pretty full you can specify an increased
	size for the ramdisk with the -s option to mknbi-dos. Please refer
	to the man page to mknbi-dos for further information.






Setup of the server
===================


Setup of the server depends on the kind of server you are using. There-
fore all further explanations in this chapter can only serve as a general
guide. You should consult your server's documentation as the final autho-
rity.

When the bootrom starts on the server it first tries to query a bootp
server for information like IP numbers and the name of the boot image
file. Such a bootp server program is usually called bootpd. Most sun
servers use a program called bootparamd instead. Note that you _cannot_
use bootparamd as a substitute for bootpd as both programs use different
protocols. Install a publicly available bootpd instead on your sun.
Next you should copy the bootImage file, which you have created in the
previous step above, into a publicly accessible directory (called /boot
for example). If you want to boot more than one diskless client you can
use the same bootImage file for every client. However, if you configured
for a ramdisk (with Linux or DOS) and the ramdisk image contains different
files or information for every client, you will obviously also need a
different bootImage file for each client.
Then you need to setup a boot description file for bootpd, which is
usually called /etc/bootptab. Consult your server's documentation for
further information. However, the entries in this file will usually
look something like this for every diskless client:

client1:hd=/boot:vm=auto:ip=192.109.225.66:\
	:ht=ethernet:ha=004001417173:\
	:bf=bootImage-client1:rp=/boot/client1/root

'hd' specifies the home directory and 'bf' is the name of the bootImage file,
which you created in the previous step. Therefore the full pathname for
the bootImage file for the diskless system called "client1" will be

	/boot/bootImage-client1

with this sample entry. The 'ip' tag specifies the IP address of the client,
'ht' the type of the network the client is attached to, and 'ha' it's hard-
ware address. The 'vm=auto' tag tells bootpd to use the same vendor encoding
as the bootrom. If your diskless client is going to use it's root filesystem
via NFS you should also specify the directory on the server which gets mounted
lateron with the 'rp' tag. However, if your diskless client uses a ramdisk,
you can omit 'rp'. When you choose to use the standard bootrom with ANSI
display driver (see below for further information) you could also setup
a menu for letting the user select different boot image files. See the
additional file INSTALL.menu about how to use this feature. But I recommend
to first use the standard way of setting up the bootptab file as described
above. You can always add a user menu lateron.
Of course you should also remember to get bootpd running on the server,
either on bootup from /etc/rc or some similar mechanism, or from inetd.
Again, see your server's documentation about how to do this.

The next step preformed by the bootrom after querying the bootp server is
to load in the boot image file specified by the 'hd' and 'bf' tags in
/etc/bootptab. To do this a protocol named tftp is used. Therefore you
will next have to setup a daemon process for this protocol on your server.
Such a daemon is usually called tftpd, and there are usually no configuration
files to edit for tftpd. However, you should again remember to get tftpd
running, usually via inetd.

If you selected a ramdisk for the diskless client's root directory you are
now finished with the server setup. But if your client is going to use NFS
you should now setup everything which is necessary for mounting an NFS
directory on the server. This usually involves running several programs:
portmap, mountd, nfsd and optionally ugidd. portmap usually doesn't require
editing any configuration files. But for mountd and nfsd you need to specify
the permissions to allow the client to access the required directories on
the server. These permissions are usually set with a file called /etc/exports.
Typically it looks like this for our sample client:

#
#  Export directories for client1 (diskless workstation)
#
/boot/client1/root		client1(rw,link_absolute)
/boot/client1/usr		client1(rw,link_absolute)

If you use 'map-daemon' to map UID and GID numbers on the server you
should remember to also configure and run ugidd on the server. Please
consult your server's documentation for further information regarding
setup of NFS exports.

Another important step is also to fill up the root directory for the
diskless client. It has to contain all files necessary for the client
to startup and mount further directories via NFS (like a /usr filesystem
as specified in the /etc/exports example above). How to setup this
root directory is far beyond the scope of this documentation. Just one
hint: if your server is _not_ running Linux, you should be aware of
major/minor number assignments in the /boot/client1/root/dev directory.
For example, simply using mknod on an AIX server will eventually give
you wrong major/minor number when the directory is later exported to
a Linux diskless client. With some configurations AIX will add a certain
offset to all major numbers which makes them unusable for Linux. Refer
to your server's manuals for further information. You might also find
some useful hints in the file Documentation/nfsroot.txt in the Linux
source tree, if your diskless client is booting Linux.






Setup of the client including building the bootrom
==================================================


Until now you only had to work on the server (with the exception of maybe
booting your diskless client from a diskette to check the correctness of
the root filesystem). As the last step we can now go on and setup the
diskless client.

The first step is to configure the network card in the diskless client. For
this refer to the manual which came with the network card. Some cards require
setting of jumpers. Others have setup programs which have to be run. After
configuring the network interface write down all necessary hardware parameters
like I/O addresses, memory addresses, interrupt line number or DMA channel
numbers, as you might need this information lateron in the configuration
process.

Next change into the netboot directory on your server (where this documen-
tation file is in) and type

	make bootrom

This will compile all necessary utility programs and then run the
configuration program. It will first ask you which bootrom kernel you
want to use. The minimal kernel is necessary for network cards which
only allow up to 16 kB ROM size, and kernel86 can be used to boot on
16-bit systems (older than 386), for example for booting MS-DOS. Unless
you have any special requirements you should choose the standard kernel.
Then you have to specify the packet driver to use for your network card.
You can either choose one of the supplied drivers, or provide your own.
If you want to provide your own driver you have to give the full path
name of the packet driver binary on your server, and also specify all
necessary options to run it. Don't specify any options here which switch
the packet driver into windows mode or which allow it to work for disk-
less systems. Those options are provided for Novell network bootroms,
and are not necessary for this bootrom.
If you use one of the drivers in the list shown, the configuration
program will ask you about all necessary hardware information to run
the packet driver which you selected. This usually includes the I/O
address of the network card, it's interrupt number and a DMA channel
number. Note that only that information is requested which is really
necessary. You should have your network card information handy when
entering this information. Some packet drivers are able to determine
hardware related information at runtime and therefore don't require
any further information.
Next the configuration program asks you wether you want to include
some additional drivers. First it lets you select the ANSI display
driver. This will allow you to draw nice menus on the screen with
the standard bootrom kernel. If you've choosen the minimal kernel
because of ROM size constraints, there is no need to include this
ANSI driver because the minimal kernel cannot display menus. Then
you can select the packet driver debugging program. This is an
additional module to trace network problems and is usually not re-
quired. It shows you the first couple bytes of all packets (where
the UDP/IP headers are encoded) going through the packet driver
during boot time of the diskless client. Only select this debugging
module if you run into problems during the initial network boot process
of the bootrom _and_ you know how to decode the UDP/IP header infor-
mation. The configuration program will also ask you about any additional
modules you want to install into the bootrom. These modules have to
be standard DOS COM-type programs, and can, for example, preset
the network card to a special state before the packet driver starts,
or setup a serial line to support booting over a PPP or SLIP connec-
tion (the Crynwr packet driver collection also contains a SLIP packet
driver which is not provided in this package). However note that the
total size of the resulting bootrom image can't be larger than 64kB.

When the configuration program has finished you will find two new
files in the current directory:

	image.flo - this file can be written onto a floppy using dd
	image.rom - image to be burned into an EPROM

You should now copy image.flo onto a floppy using

	dd if=image.flo of=/dev/fd0

and then boot your diskless client using this floppy. If you have setup
everything (including your network card) you will see the bootrom code
starting, querying the bootp server and loading the boot image file. When
everything works as required you can then go on and burn the file image.rom
into an EPROM. Please consult the manual of your EPROM burner how to do
this. It usually requires converting the image file into a special format
(Intel or Motorola hex format for example). Insert the EPROM into the
socket on your network card and turn on the diskless system. You should
now see the bootrom coming up.
Another way of getting the bootrom code into your client is using the
Flash-EPROM card (called FlashCard), of which you can find a schematic
drawing in this package. You can use image.rom directly to burn it into
FlashCard. About how to use and program the FlashCard see the documen-
tation in the FlashCard directory.






Appendix: Recompiling the bootrom
========


If you want to recompile the bootrom for some reason, you need to have
an assembler and C compiler for DOS. However, you don't need to recompile
the bootrom if you just want to use it!

The sources are prepared to get compiled with MASM Version 5.1 or higher,
and Borland-C++ V2.0 or later. They use some macro features only available
with MASM, so you can't substitute that, but there is no limitation on
the C compiler. However, all programs have to be able to get run from the
command line. There is no support for any IDE. You also need GNU-make for
DOS, which you can get from prep.ai.mit.edu for free. It is assumed that
this GNU-make is in your search path and is called gmake.

First change into the bootrom directory and edit the file config.mk. The
comments in that file should be sufficient to adjust it for your setup.
Then simply run the script makeall.bat. It will compile everything, put
the results into the binaries directory and cleanup afterwards. If you
only want to recompile certain parts of the source tree take a look into
the makeall.bat script about how to call gmake for the parts you want
to create.

