Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 1997 13:34:34 -0700 (MST)
From:      Don Yuniskis <dgy@rtd.com>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        dgy@rtd.com, helbig@MX.BA-Stuttgart.De, hackers@FreeBSD.ORG
Subject:   Re: wd driver questions
Message-ID:  <199703162034.NAA22639@seagull.rtd.com>
In-Reply-To: <199703161814.FAA10848@godzilla.zeta.org.au> from "Bruce Evans" at Mar 17, 97 05:14:38 am

next in thread | previous in thread | raw e-mail | index | archive | help
Greetings!

> >> And, how (if at all) does the geometry written to the disklabel
> >> figure into the operation/calculations of the driver?
> >
> >As far as I could decipher from the driver code (wd.c) the probed geometry
> >is used only to read the label.
> 
> No, the probed geometry is used for everything in the driver.

Yes, that's what it appears to be.  Except that the BIOS geometry is
used during boot (at least in the 2.1 stuff).

> >From there on the geometry read from the
> >label is used exclusively by the driver. Both are the same, if you
> >disklabel auto.
> 
> The geometry read from the label is not used by the driver (except in
> `#if 0' code).  It is normally only used by fdisk.  newfs ignores it by
> default.

How does fdisk use it?  Just to determine where cylinder boundaries
exist?  (i.e. so partitions are an integral multiple of cylinder size?)

> The BIOS geometry is not used either, except in some kludgy cases
> involving drives that don't report their geometry (old MFM drives).

Again, the IPL stuff comes from the disk using the BIOS/"system ROM"
geometry, right?

> Old versions of the driver worked like you thought, except for
> complications.  First the MBR was read and the BIOS geometry was
> guessed from it.  The the drive was programmed to use the guessed BIOS
> geometry.  Then the label and possibly the bad block table was read.
> Then the drive was programmed to use the geometry in the label.
> There were many driver bugs (all of this must be done atomically, and
> some of it must be redone after drive reset ...).  There were many
> configuration errors (it was possible to put a physically impossible.
> or just inconsistent, geometry in the label ...).

No one (with the exception of fdisk?) *should* need to know the real
geometry, right?  And, it could possibly be argues that fdisk/newfs
only "need" to know it for "performance" reasons, right?

--don



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703162034.NAA22639>