Subject: Re: Booting sd0 q(disk geometry versus bios geometry)
To: None <rvb@sicily.odyssey.cs.cmu.edu>
From: Justin T. Gibbs <gibbs@plutotech.com>
List: port-i386
Date: 07/13/1998 21:39:10
Hmm.  I will only relate what I've done for the new FreeBSD SCSI system
and you can take it as you will.

Almost all modern controllers allow you to detect the current translation
mode.  The aic7xxx cards, 1742, 1542, Buslogic MultiMaster and FlashPoint
adapters, and AdvanSys cards all provide this information in an area where
the driver can pull it.  So, the new SCSI layer provides a "calculate
geometry" command code which allows a peripheral driver to ask what the
controller driver believes the translated geometry should be for a given
number of sectors and sector size.  The direct access driver uses this
information to construct a dummy label.  If no partition information is
found on the disk, the dummy label is used and this "bootable" geometry is
provided auto-magically to tools like fdisk so the naive user working on an
uninitialized disk gets a geometry that will certainly work if they don't
muck with their controller after partitioning the disk. If partition
information is found, then geometry information is extracted from there and
the dummy label is discarded.  On platforms where the geometry makes little
difference or conforms to one particular practice (as is the case for the
first two SCSI disks on the PC98), there is a convenient place in the XPT
(SCSI routing layer) to intercept the calculate geometry calls before they
go to the controller driver layer, and customize the result.

I'm hopeful that this addition to FreeBSD will reduce the number of
people who wind up with un-bootable installations to almost 0.

--
Justin