Subject: Re: Compiling the kernel.
To: None <baw@ccrc.wustl.edu>
From: Brett Lymn <blymn@baea.com.au>
List: netbsd-help
Date: 10/09/1997 19:25:00
According to Baw:
>
>	Can someone please tell me if there's any step-by-step guide to 
>kernel or system recompilation for NetBSD? I'd like to recompile the 
>kernel, and have downloaded the compiler tools and kernel source code, 
>but I don't seem to be able to find sufficient instructions from the 
>distribution or the installation notes to help me compile.
>

For the sake of simplicity I will assume you are using the i386
architecture (PC) - the process is the same for other architectures
just the directory name changes...

1) cd to /usr/src/sys/arch/i386/conf

2) copy GENERIC to another file name (normally the machine name in
caps is used)

3) edit the file and remove things you definitely do not have, to be
safe if you are not sure then just leave it in.  If there are things
that are commented out that you need then uncomment the ones you
want.  Check all the IRQ/DMA/IO settings to ensure they match your
hardware.  Mostly the autoconfig will do a good job of this (these
will have * or ? entries) but there are some devices that cannot be
probed correctly so they must be hardwired in.

4) Once the editing is done run the config command by typing config
file_name where file_name is the file you just edited.  If config
likes your config file go on to the next step otherwise fix the
problems.

5) cd ../compile/file_name.  This directory is created if the config
has been run successfully.

6) type:

make depend && make

to build the kernel

7) Once the kernel is built then do this:

mv /netbsd /netbsd.old  (this is _very_ important in case the new
                         kernel will not boot for some reason)
cp netbsd /

8) reboot the system.

note that unless you reboot the system there will be weirdness with
ps, netstat and all sorts of other things that grovel kernel
structures.  Steps 7 & 8 should be done in close succession.

Work is in progress (sometimes) on a tool that will make this less
hand-cranked but it is quite a ways off yet :-/

-- 
Brett Lymn, Computer Systems Administrator, British Aerospace Australia
===============================================================================
  What do you get when you cross a cantaloup with a dog?        Melancholy :-P