Subject: boot problems
To: None <port-sparc@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 12/28/1997 11:46:40
I'm having trouble making modern SPARC bootblocks work on a 2G disk.

The setup: I have two machines (okay, more than that, but only these
two are relevant here): a Sun-3/260 and a SPARCstation 1+.  On the
Sun-3/260, I have a 2G disk,

sd0 at scsibus0 targ 0 lun 0: <SEAGATE, ST12400N, 8650> SCSI2 0/direct fixed
sd0: 2048MB, 2621 cyl, 19 head, 84 sec, 512 bytes/sec x 4194685 sectors

that has been working Just Fine there for at least a year.  On the
SS1+, I have a bank of seven tiny little disks, identical except for
their SCSI IDs,

sd0 at scsibus0 targ 0 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd0: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd1 at scsibus0 targ 1 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd1: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd2 at scsibus0 targ 2 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd2: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd3 at scsibus0 targ 3 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd3: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd4 at scsibus0 targ 4 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd4: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd5 at scsibus0 targ 5 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd5: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors
sd6 at scsibus0 targ 6 lun 0: <QUANTUM, LP80S  980809404, 3.3> SCSI2 0/direct fixed
sd6: 80MB, 921 cyl, 4 head, 44 sec, 512 bytes/sect x 164139 sectors

Now, I want to swap these, to put the big disk on the SPARC and the
bank of little disks on the Sun-3.

Currently, small disks 0 and 1 hold /-swap-/usr for the SS1+, with 2
through 6 available (they held /usr/src while I did a build on the
SS1+).  I've got a working sun3 boot setup on small disks 2 and 3;
that's no problem.

But when I try to make the big disk boot on the SPARC, I'm having no
end of trouble.

I've connected the big disk to the SPARC, by powering down two of the
small disks (2 and 3) and putting the big disk at ID 2, mounted as
/mnt.  I then copied the SPARC / and /usr from small disks 0 and 1 into
a directory (/mnt/SPARKLE) on the big disk.  I then made certain boot
and netbsd in /mnt/SPARKLE were not sparse files (by copying them by
hand), and made hardlinks from /mnt/SPARKLE/boot to /mnt/bootSPARC and
/mnt/SPARKLE/netbsd to /mnt/netbsdSPARC (ie, on the big disk).

Then I ran

# /usr/mdec/installboot -v /mnt/bootSPARC /usr/mdec/bootxx /dev/rsd2a

This produced reasonable-looking output.  But when I try to boot from
it ("boot sd(0,2,0) -as"), I get (IIRC) "Instruction Access Exception".
Right after the ROM's messages.  The NetBSD bootblocks do not run
enough to print anything.

I thought maybe installboot was broken, or perhaps it had to be run
with the matching boot from /usr/mdec.  So I copied small disks 0 and 1
to 5 and 6 and played with installboot there; I was unable to make it
break.  Back to the big disk, I tried copying /usr/mdec/boot to
/mnt/bootSPARC and rerunning installboot.  Now I get "Illegal
Instruction" upon attempting to boot.  With the very same /boot and
installboot that work fine when booting from one of the 80M drives.

Is there something in the boot sequence that breaks if the root
partition is large, or sufficiently far from the beginning of the disk,
or something?  sd2a is 3786585 sectors long, 1848.92Mb, at offset 0;
this isn't large enough to bump into even a 32-bit signed byte offset,
so I can't imagine what could be going wrong.  (sd2 is 4194685 sectors,
which is 381 sectors more than 2G; could this be relevant, even though
sd2a is well below that point?)

I've made a copy of the first 8K of the disk in its latest failure
state, in case anyone wants to look at it.

I booted the Sun-3/260 from the two small disks and ran the sun3
installboot from that system on the 2G drive, and it once again boots
Just Fine on the Sun-3.

The installboot and bootxx I'm using are built from sources supped in
the AM of 1997-12-18.  I've tried two second-stage boots (/boot), one
from late September and one built from that same sup's sources.
Neither one works with the 2G disk; either one works with the small
disks.

Ideas, anyone?  I suppose I could dive into the bootblocks and scatter
debugging output throughout boot, but I'd like to get this going
quickly and I'm hoping someone can whack me upside the head with an
email along the lines of "you forgot to <foo>, go read so-and-so's
message to current-users, message id such-and-such".  But I sure don't
recall anything about it working on small drives and failing on larger
ones (and this one isn't even a very large one!).

More details available, of course; if anyone thinks of anything
relevant I haven't mentioned, do please tell me.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B