Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Bootloader changes (Was: Anyone have working pre-v8 machines?)



Hi everyone,

I've looked at the way that the 2nd stage bootloader was checking for RAID
partitions and I think I have a possible solution.

The way it worked before was that we read the disklabel in the device open
routine.  This meant that we had to close and reopen to avoid trying to
open the device twice.  However, the approach still had problems - it needed
a check for floppy boot and also failed on older PROM versions (with the
message "Data Access Exception").

With these changes, we move the read of the disklabel into the strategy
routines, when we are going to read from the disk anyway.  The first time
that we read from the disk, we now additionally read the disklabel to check
for a RAID partition.  This means that we don't need to (ab)use the devopen
routine.  Note, that I kept the check for floppy devices to avoid an extra
read on a slow medium which isn't going to be a RAID partition.

I've tested this on 4/330 (SUN4/oldmon), SS2 (SUN4C/OBP V0), SS20 and 4/630
(SUN4M/OBP V2) and also with RAID on the SS20, so I'm fairly confident that
it's working.  However, I don't have any machines to test with where the
current bootloader fails.

If anyone is able to test, that would be great.  One caveat is that it
might still have a bug that breaks the disk boot, so you do need some
recovery mechanism (e.g. netboot or a second disk) in order to be able
to recover.

I've put the changes and the new 2nd stage boot (both with debug output) at:

  https://ftp.netbsd.org/pub/NetBSD/misc/jdc/sparc/boot/promdev.c.diff
  https://ftp.netbsd.org/pub/NetBSD/misc/jdc/sparc/boot/boot.388000

To test:

  cp -p /boot /boot.backup	# make a backup of /boot
  ftp https://ftp.netbsd.org/pub/NetBSD/misc/jdc/sparc/boot/boot.388000
  cp -p boot.388000 /boot	# install the test 2nd stage
  installboot -nv /dev/rsd0a /usr/mdec/bootxx /boot	# sanity check
  installboot -v /dev/rsd0a /usr/mdec/bootxx /boot	# update the 1st stage

Note, that if your boot disk isn't sd0, then you'll need to alter the
`installboot` lines above.

Thanks and regards,

Julian


Home | Main Index | Thread Index | Old Index