Subject: Re: ?: kernel recompilation
To: NetBSD - port hp300 mailing list <port-hp300@netbsd.org>
From: Peter Radcliffe <pir@pir.net>
List: port-hp300
Date: 08/19/1998 14:32:45
Laurentiu COCEA <cocea@ceylan.necker.fr> probably said:
> The hp340 I installed netbsd to only has 8 MB of RAM and the kernel eats
> up about 3.7 MB. I know the kernel can be recompiled to take as little
> as 1.5 MB and leave more memory available to the applications. But I
> don't know how to do that.

You can comple a kernel with only the devices in it that your machine
has. Removing the extra code for devices you don't have drops the size
of the kernel, not sure what happens to running size, though.
Reducing things like maxusers will reduce the size of the running
kernel IIRC.
Removing the debugging options may also decrease the size, but would
make debugging harder later, oddly enough.

> Could anyone tell me where I can find step-by-step instructions "for
> idiots" on recompiling the kernel on a hp300?

You need the sys source installed.

Copy the current (generic) kernel you have to a generic name if you don't
have a copy of the generic kernel already.
# cp /netbsd /netbsd.gen

# cd /usr/src/sys/arch/hp300/conf
# cp GENERIC YOURBOX

Look at the output from dmesg, and comment out anything that doesn't
apply to your machine - like all the options HP3* lines, all the
framebuffers that you don't have, types of HP-IB you don't have,
etc, etc.
Remove a chunk of things, compile (see below), see if it will reboot
and all devices function with the new kernel, if not, boot with the
netbsd.gen kernel and uncomment things until you find what you needed.

Compiling:

config YOURBOX
cd ../compile/YOURBOX
make depend
make all
cp /netbsd /netbsd.old
cp netbsd /netbsd
chmod a+rx /netbsd

Compiling the kernel on a box as small as yours will take an age,
though :/

On my 370 (which took ~ 2 hours to compile, I think):
-rwxr-xr-x  1 root  wheel  960638 Jul 20 00:33 /netbsd

real mem  = 16764928
avail mem = 12406784

Hope that helps.
P.

-- 
pir               pir@pir.net      pir@shore.net      pir@leftbank.com