Subject: Re: Booting NetBSD/arm26 from a hard drive
To: Ian Fry <Ian.Fry@sophos.com>
From: Ben Harris <bjh21@netbsd.org>
List: port-arm26
Date: 06/11/2001 15:01:28
On Mon, 11 Jun 2001, Ian Fry wrote:

> 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.

To be honest, I didn't think you would, but I think you've progressed
quite a lot.

> 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.

Could you send me those patches (or send-pr them)?

> 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.

Ooh.  I should add that to FOURMEG.

> 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'.

Hmm.  I really feel that 2334K of user memory should be enough to get the
world going, even with 32K pages.

> 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.

One thing that David and I discussed at Wakefield was the possibility of
replacing the kernel's malloc() with something a little more frugal.  The
current one allocates one page for each power-of-two size of allocation
from 16 bytes to a full page, which is a potential 320K wasted.  A noddy
first-fit allocator (which could also avoid using KVM for small
allocations) might help.

> 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.

Hmm.  Which version of EtherH is this?

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>