Subject: Re: Net boot question
To: Alex Pelts <alexp@broadcom.com>
From: Andy Ruhl <acruhl@gmail.com>
List: port-cobalt
Date: 11/15/2005 05:19:10
On 11/14/05, Alex Pelts <alexp@broadcom.com> wrote:
> Andy,
>
> I would hate to correct you, but this time you are not entirely correct.
> The procedure is definitely qube specific. Well to be entirely correct
> it can be reproduced on many platforms but qube has very piculiar
> requirements for netboot, and here they are:
> 1. It obtains the address from dhcp (nothing unusual here)
> 2. It mounts nfs filesystem of the dhcp server, and it only mounts
> particular location - /nfsroot
> 3. It loads kernel, specific to the device, like raq loads one qube anoth=
er.
> 4. The kernel has a limit on its size, different sources provide
> different numbers but they all agree it should be less than 1000000
> bytes compessed and 2500000 uncompressed. I personally think it is even
> smaller.
> 5. Kernel then must mount the same /nfsroot as a root filesystem and
> keep on booting.
>
> That is basically the process, and someone can correct me if I am wrong.
> I think though, that I am wrong not by much.
>
> So the page you are refering to provides no help to qube owners as far
> as I can see. Although there is a posibility that before mounting nfs
> qube does something with tftp. I need to explore that. Regardless of
> tftp, ramdisk is not an option.
>
> So the consequences of the sequence above are following:
> 1. Later kernels are large and have a hard time booting on the qube
> without a smaller bootloader.
> 2. Ramdisk is not an option due to the small kernel size.
> 3. Filesystem that serves nfs must be capable of serving device nodes.
> This is where cygwin comes in. It is capable of creating and serving
> device nodes on the windows filesystems.
>
> Now I have a question for you, which I asked Christopher. Is there a
> tool on netbsd that can change boot parametes compiled in to kernel,
> like the one on linux?
>
> One thing could be done is to extend the netbsd bootloader to support
> tftp and do 2 stage boot as it is done from disk:
> stage one - load small bootloader named as linux kernel
> stage two - bootloader loads large kernel with ramdisk and the things
> become more like other architectures, except there is no screen and
> keyboard so someone must ether telnet to the box or use serial console.

I think you might be wrong on 4 and 5. I've never had a problem
booting ANY kernel as long as the firmware boots the bootloader, which
then can find netbsd on wd0a. On #5, that's only true if you use the
"2 button method". If you break into the firmware, you can tell the
Qube to boot from any root path:

Cobalt Microserver Diagnostics - 'We serve it, you surf it'
Built Tue May 25 15:58:41 PDT 1999

 1.LCD Test................................PASS
 2.Controller Test.........................PASS
 5.Bank 0:.................................64M
 6.Bank 1:.................................64M
 7.Bank 2:.................................16M
 8.Bank 3:.................................16M
 9.Serial Test.............................PASS
10.PCI Expansion Slot....................**EMPTY**
12.IDE Test................................PASS
13.Ethernet Test...........................PASS
16.RTC Test................................PASS

Cobalt: bfd /netbsd.gz nfsroot=3D/home/taz     <----------- My own root pat=
h
Decompressing done
Executing bootloader kernel...
Decompressing -- done.
invalid bootinfo (standalone boot?)
[ Kernel symbol table missing! ]
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.0_BETA (INSTALL) #0: Sat Nov  5 07:00:37 MST 2005
        root@foghorn:/usr/obj-cobalt-r3/sys/arch/cobalt/compile/INSTALL
total memory =3D 160 MB
avail memory =3D 154 MB
mainbus0 (root)
com0 at mainbus0 addr 0x1c800000 level 3: st16650a, working fifo
com0: console
cpu0 at mainbus0: QED RM5200 CPU (0x28a0) Rev. 10.0 with built-in FPU Rev. =
10.0
cpu0: 32KB/32B 2-way set-associative L1 Instruction cache, 48 TLB entries
cpu0: 32KB/32B 2-way set-associative write-back L1 Data cache

Of course, you need a serial cable to do this, which means you have a
Qube2 or Raq2 and not the older ones without the serial connection.

Despite how it seems, the Qube2 or Raq2 do not have all that unusual a
netboot sequence. If you look at how other platforms do it, old sparcs
in particular, it seems easy to netboot the Qube. The point here is
you need the kernel named a certain way, and if you use the "2 button
method", you need to have your server set up a certain way, which some
other architectures want as well (I think).

NetBSD has userconf, but it's not able to change the root path as far
as I know like rdev does (did?) on Linux. To netboot, I change the
config line to boot from NFS, that's it. I hope someone can correct
me, it would be nice to be able to change the root path externally.

But I still think your setup of a Cygwin boot server is useful to
anyone booting NetBSD, not just the Cobalt people. It's worth writing
for the netboot page.

Andy