
Compiling and using Minix network support 

    modified: Sun Sep 1 11:20:02 EDT 1996 
    
   
     _________________________________________________________________
   

Q: How do I build  TCP/IP support into the kernel?

A: Actually, the changes to the kernel itself are small. The ethernet
driver code is compiled and the kernel is enabled to communicate with
the INET server, which runs outside of the kernel with the same
priority as the MM and FS servers.

To compile a network-capable Minix system you must edit
/usr/include/minix/config.h. as described below and then cd to
/usr/src/tools and type "make". A new Minix system will be created as
/usr/src/tools/image. The new system will include the inet server.

The minimum change to config.h is to set ENABLE_NETWORKING to 1. If
you want to be able to do remote logins with rlogin or telnet you need
to change NR_PTYS to a value greater than zero. If two or more users
are likely to be active at once you may need to increase NR_PROCS
from its default value of 32. NR_PTYS 8 and NR_PROCS 64 seems to work
well for a system that has two or three users logged in at the same
time. These changes will increase the size of the kernel, and if you
are compiling for a system with limited memory you might want to first
try a system with no ptys and only the default 32 processes.

Once the new system image is compiled you can move it to the root
directory as /minix.net. Then you can test it by specifying
image=minix.net at the boot manager prompt. If it works correctly you
can either rename it as /minix or save the image boot parameter. If
you have limited memory you may want to keep the original system image
available to boot when you want to do something that requires a lot of
memory, like recompiling a system.

Q. Having compiled a networking kernel, how do I use it?

A. There are a few more steps after compiling before you can use the
network capabilities.

1. In /dev you probably already have /dev/eth, /dev/ip, /dev/tcp, and
/dev/udp defined, but if they are missing you need to create them with
MAKEDEV. If you have set NR_PTYS to a number greater than 0 you should
also create /dev/ttyp0, /dev/ptyp0, etc., with MAKEDEV.

2. In order for the ethernet driver to be enabled you must add to the
boot parameters a line like DPETH0=on or DPETH0=I/O-addr:irq:mem-addr.
The first form can be used if the ethernet adapter uses the default
settings of 280:3:d0000. If the defaults are used serial line two will
be disabled, since it also needs IRQ 3. A setting of 280:5:d0000 is
recommended if IRQ 5 is free, which is usually the case on AT-class
machines. Of course the ethernet card must be set up for the
parameters you tell Minix.

3. Finally, you may want to review the network initialization
performed by /etc/rc. The default /etc/rc is suitable for a Minix
system running on a large network with sophisticated servers
available, and in this context it allows a Minix system to discover
its own name and address without any editing of the configuration
files. This is very useful for a university laboratory where a large
number of Minix systems may be in use, but it is not optimal for a
small network with a few small systems, all of which may not be
operating all the time. On a system with limited memory it is also
useful to reduce the number of network daemons that are started.
Copies of various configuration files I use on minix1.hampshire.edu
are in that system's anonymous ftp area, in /pub/mx.config.samp.

--------------------------------
 Albert S. Woodhull
 Hampshire College, Amherst, MA
 awoodhull@hampshire.edu
 http://minix1.hampshire.edu/asw

