svn commit: r216269 - head/sys/geom/part

Bruce Cran bruce at
Fri Dec 10 08:58:40 UTC 2010

On Fri, 10 Dec 2010 10:12:34 +1100 (EST)
Bruce Evans <brde at> wrote:

> The BIOS has little control over the mode.  It can't enforce LBA if
> the drive supports CHS.  It can't force any particular CHS mode since
> the driver may set any CHS mode.  ata used to reset the drive in the
> probe and in reinit.  I think this is a hard reset which restores the
> default CHS.  I can't see where ata resets now.  It is nicely
> obfuscated using function pointers.  I think it does less resetting.
> It also has a soft reset for at least sata, but sata won't be using
> CHS.  Removing of resets would explain why it now has to use the
> current CHS (since it doesn't change the CHS back to the default).

The BIOS does seem to have complete control over the geometry that
FreeBSD detects. Yes we'll use LBA mode if it's available, but what I'm
talking about is the geometry that gets used for creating disklabels
and the MBR. Since I saw the change in the BIOS reflected in what
FreeBSD detected, it appears the BIOS has control over those values
except when it decides to initially use LBA mode.

> The driver always ignores CHS (except to report it) and uses LBA if
> possible.  If a manufacturer stops supporting CHS, then the driver
> shouldn't notice, but the manufacturer's non-support should include
> setting the obsolete fields to 0 (or possibly other specified magic
> numbers).  It is then up to utilities whether to report these fields
> as simply there value or to decrypt their magic values into a CHS-
> unsupported flag (I don't know of any actual flag for this).  Then
> there is the "firmware geometry" reported to GEOM.  You could try
> changing this to 0/0/0 and see what breaks.  CAM for SCSI drives still
> invents a geometry to avoid seeing evil here, since SCSI drives have
> only had no geometry for about 30 years now.

But the problem is that we _do_ use CHS: we use it to create the MBR
and disklabel. Linux invents a geometry if it can't create one from the
on-disk data; we don't.

Bruce Cran

More information about the svn-src-all mailing list