Subject: Re: Supporting sector size != DEV_BSIZE -- tests
To: Bill Studenmund <wrstuden@netbsd.org>
From: Trevin Beattie <trevin@xmission.com>
List: tech-kern
Date: 06/11/2002 18:28:08
At 06:12 PM 6/11/2002 -0700, Bill Studenmund wrote:
>On Tue, 11 Jun 2002, Bill Studenmund wrote:
>
>> On Tue, 11 Jun 2002, Trevin Beattie wrote:
>>
>> > The way things stand now, the disk label on the i386 port gets written at
>> > an offset of 512 bytes from the start of the partition.  (Or, more
>> > generally, 'LABELSECTOR' DEV_BSIZE blocks from the start of the disk, on
>> > any port.)  I've already posed the question of the disk label location
>> > before, and Bill recommends placing it on sector 1, using the drive's
>>
>> Well, I'm not sure what else to do. Prior Art would be nice. :-)
>
>Doh!
>
>I send this, and someone suggests a test.
>
>Look at the MBR under Windows on such a disk. Does it grow to fill the
>whole sector, or does it stay in only the first 512-bytes?

You know, I had a whole monologue written about some additional tests I did
under MS-Windows, then realized I had found the answer to the question I
was going to ask, so I never sent it!  :->

Here's what I was _going_ to ask:

"My concern lies with the MBR itself.  How big is it supposed to be?
Should it be possible for the BIOS to boot from a disk with 2048-byte
sectors?  (My SCSI BIOS can be set to boot from any arbitrary device,
including the MO drive; it's a question of whether the BIOS will work with
a larger sector size.)  If so, is the MBR structure supposed to take up
just the first 512 bytes, or the entire sector?  (If the entire sector,
then we *definitely* have to move the disk label.)"

And here's where I answered myself:

"After a bit of tweaking using dd and the vnd device, I managed to get
/usr/mdec/mbr written to my MO disk with a proper partition table.  It
looks valid, but I haven't been able to boot from it -- the BIOS reports
"DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER".  This is the same
message reported when there is no disk in the drive.

"I have a couple of MO disks -- one 230MB and the other 640MB -- formatted
with MS-Windows using FAT16.  On both disks, the boot sector is 512 bytes
long (zero-padded on the 640MB disk), but has no partition table -- it's
apparently treated like a floppy.  (For those interested in the msdos
format, it looks like the FAT table starts at sector 1: offset 0x200 for
the 230MB disk, and offset 0x80 for the 640MB disk.)  If I try to boot the
230MB disk, it reads the boot sector (which says "Non-system disk..."), but
booting the 640MB gives the error "DISK BOOT FAILURE".  So I guess I can't
boot 2048B/s disks at all. :-(
"

Does MS' example count as prior art?  ;->

-----------------------
Trevin Beattie          "Do not meddle in the affairs of wizards,
trevin@xmission.com     for you are crunchy and good with ketchup."
      {:->                                     --unknown