From owner-freebsd-hackers Sun Mar 16 12:36:18 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA18161 for hackers-outgoing; Sun, 16 Mar 1997 12:36:18 -0800 (PST) Received: from seagull.rtd.com (seagull.rtd.com [198.102.68.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA18156 for ; Sun, 16 Mar 1997 12:36:17 -0800 (PST) Received: (from dgy@localhost) by seagull.rtd.com (8.7.5/8.7.3) id NAA22639; Sun, 16 Mar 1997 13:34:34 -0700 (MST) From: Don Yuniskis Message-Id: <199703162034.NAA22639@seagull.rtd.com> Subject: Re: wd driver questions To: bde@zeta.org.au (Bruce Evans) Date: Sun, 16 Mar 1997 13:34:34 -0700 (MST) Cc: dgy@rtd.com, helbig@MX.BA-Stuttgart.De, hackers@FreeBSD.ORG In-Reply-To: <199703161814.FAA10848@godzilla.zeta.org.au> from "Bruce Evans" at Mar 17, 97 05:14:38 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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