Subject: Re: Disk copy grumbles
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 02/03/2002 02:16:56
>> Then I have no idea why it failed.  What happened when you tried to
>> boot from the resulting partition?
> Varied.  But, always consistent with "crud" getting dragged in and
> executed (aren't any sanity checks done on the image as it is
> loaded??? even a magic number test???).

Perhaps.  But if the crud is the _second_ block of the file, the magic
number can be intact and still end up executing garbage.

> For example:
>     Instruction Access Exception
> (sorry, may be misremembering this... notes are in the other room)

Probably trashed code, yeah.

Does your root partition include anything beyond the first 1G of the
disk?  I'm wondering if your ROM version has the 6-byte-CDB limit.
Copying /boot into / could "fix" it then because files in / will often
end up entirely in cylinder group zero, whereas if the file is created
in /usr/mdec it usually will be in some "random" higher cg and quite
possibly past the 1G point.  (If you copy /usr/mdec/boot to (say)
/usr/mdec/fnord and then mv /usr/mdec/fnord to /boot, instead of
copying /usr/mdec/boot to /boot directly, that could reveal the
difference.)

This is exactly the symptom you get if the boot file is past - or
partially past - the 1G point: everything but the low 21 bits of the
block number gets ignored, so blocks past the magic boundary end up
reading as a predictable but otherwise unrelated block below the
boundary.  (Writing is no problem, since the writing code is NetBSD's,
which doesn't have the limitation.  But reading goes through the ROM.)

>> (7.5K isn't really much room, even when you don't have to do the
>> actual disk I/O yourself.)
> I guess that's relative... designed a LORAN-C position plotter in
> *12K* (and that had to do *all* the I/O as well  :>)

Perhaps your skill at tightening code up would be valuable in this
endeavour.  Fitting functionality into small amounts of space is a much
less common skill now than it has been in the past.  I know I don't
have nearly as much of it as I'd like....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B