Subject: NetBSD 1.6.1 on Qube2 not booting --> solution
To: None <port-cobalt@netbsd.org>
From: Christopher Schultz <christopher.d.schultz@comcast.net>
List: port-cobalt
Date: 01/06/2004 10:50:32
All,
I've been working with Dennis Chernoivanov on what's going wrong with 
the Qube 2 and 1.6.1. Apparently, the boot loader has a problem.

 From my limited understanding, here's what's going wrong. I know only a 
little about MIPS and boot loaders, but here goes:

The hardware boot loader automatically loads the image 
(/dev/wd0e)/boot/boot.gz, decompresses it, and executes it. That piece 
of code needs to load more information into memory from the disk, then 
execute that.

Ultimately, the boot loader loads the kernel into memory and jumps to 
the entry point to the kernel, and the machine boots. Unfortunately, you 
have to make sure that you don't load your kernel into memory over top 
of your boot loader, or the boot loader gets trashed and you can't boot 
(makes sense).

The authors of the boot loader chose a starting address of 0x81000000 
for the boot loader. Apparently, this causes part of the boot loader to 
be loaded above the 16MB mark -- the limit of my memory (did I mention 
that I had 16MB? I'm sure that would help). Dennis's machine has 32MB of 
RAM, so he never encountered any problems.

Changing the base address for the boot loader to 0x80800000 solved the 
problem on my machine. The boot loader does not get trashed by the 
kernel, and the kernel boots.

This is the boot loader that Dennis created for me to use:
ftp://ftp.netbsd.org/pub/NetBSD/misc/cdi/boot.gz

If it's no longer there, perhaps Dennis could post this boot image 
somewhere else...

In order to install this image, boot your machine with the serial port 
attached to another computer with a serial terminal open. Press <space> 
during the POST, and at the "Cobalt" prompt, type this:

Cobalt: bfd /boot/netbsd.gz

That should boot your machine into NetBSD -- it bypasses the broken boot 
loader. Next, log-in as root and mount the boot partition:

# mount /dev/wd0e /mnt

Finally, copy the good boot loader onto that partition. If you want, you 
can backup the old boot loader (and you probably should, just for good 
measure):

# cd /mnt/boot
# mkdir old-1.6.1
# mv boot.gz vmlinux* old-1.6.1
# cp /path/to/boot/bootloader ./good.boot.gz
# ln -s good.boot.gz boot.gz
# ln -s good.boot.gz vmlinux.gz
# ln -s good.boot.gz vmlinux-nfsroot.gz
# ln -s good.boot.gz vmlinux_RAQ.gz
# ln -s good.boot.gz vmlinux_raq-2800.gz

All those fymlinks just match those files that I moved to the 'old' 
directory. I'm not sure which ones are required, but it's more than 
boot.gz. If you only swap-out boot.gz, it won't work. I think the 
primordial boot loader looks for one of the vmlinux.gz files...

Now you should be able to reboot and have your machine boot properly.

-chris