Subject: Re: Booting NetBSD/arm26 from a hard drive
To: Ben Harris <bjh21@netbsd.org>
From: Ian Fry <Ian.Fry@sophos.com>
List: port-arm26
Date: 06/11/2001 14:00:38
On Fri, Jun 08, 2001 at 08:10:10PM +0100, Ben Harris wrote:
> On Fri, 8 Jun 2001, Ian Fry wrote:
> > That's what I was going to try. IIRC, you run bb_riscbsd after using
> > HForm to setup the RISC OS side.
> Yeah, that's right.  All that stuff should work on NetBSD/arm26, since I
> share the arm32 disklabel-reading code.

Well, I didn't get that far, unfortunately :-( Here's a shortish summary of
what I have managed to do over the weekend.

Firstly, I got my NetBSD/i386 box running a DHCP/BOOTP server, and got my
A4000 booting from it (that was the easy bit!).

Next, I tried a single user boot, which did get to the 'Enter path to shell,
or press return for sh:' prompt. However, pressing return just produced lots
of 'pid nn: VM shortage, sleeping'. So I tried /bin/csh, this time things got
further - I managed to get a shell prompt and type a few commands (again,
accompanied by lots of VM shortage messages).

Then I started experimenting with kernel options to try to trim the kernel
down. I looked at options(4), and found a few things to tweak (RASOPS_SMALL,
and things like NMBCLUSTERS). I had to patch rasops{2,4,8}.c to remove some
'unused local' warnings before this would build.

Still, not enough, although things seemed to get further before running out
of VM.

Then I tried using 'nm' to find other things to trim - the biggest being
'tcp_debug' (see netinet/tcp_debug.{c,h}). By default, there is a 100 element
array of structures (presumably used to aim TCP debugging), so I added
'options TCP_NDEBUG=n' for a few values of 'n' to my config, and rebuilt the
kernel again. Same result - VM shortage.

With lots of experimenting, removing pseudo devices, changing config file
options (reducing the number of ptys etc), I got as far as having 2334K of
available memory when the kernel starts. Unfortunately, this is still not
enough to get to a single-user shell, and enable swapping (I setup a 16M file
in the NFS root with the intention of swapping to that file). I once got as
far as 'swapctl: adding /swap at priority 0', but the prompt never returned.
Pressing Ctrl+T showed several (different) things, normally that the kernel
was in 'anonget2' or 'biowait'.

So, I still can't quite get as far as being able to setup the hard drive.
I'll keep playing though, and if anybody has some ideas of what else I can
tune/trim I'll certainly try them out.

Ian.

PS I've found that I have to RMKill/Unplug the EtherH module under RISC OS,
as otherwise, the kernel doesn't always detect the card.