From owner-freebsd-hackers Wed Aug 28 17:33:54 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA19246 for hackers-outgoing; Wed, 28 Aug 1996 17:33:54 -0700 (PDT) Received: from eac.iafrica.com (196-7-192-139.iafrica.com [196.7.192.139]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id RAA19201 for ; Wed, 28 Aug 1996 17:33:34 -0700 (PDT) Received: (from rnordier@localhost) by eac.iafrica.com (8.6.12/8.6.12) id CAA00393; Thu, 29 Aug 1996 02:27:29 +0200 From: Robert Nordier Message-Id: <199608290027.CAA00393@eac.iafrica.com> Subject: Re: Determining disk type & size To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Thu, 29 Aug 1996 02:27:28 +0200 (SAT) Cc: hackers@freebsd.org In-Reply-To: <199608282135.XAA01269@labinfo.iet.unipi.it> from "Luigi Rizzo" at Aug 28, 96 11:35:09 pm X-Mailer: ELM [version 2.4 PL24 ME8a] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Luigi Rizzo wrote: > > > Most of the userland code I've looked at doesn't seem to handle this > > very elegantly, where it checks. And some of my attempts to do the > > obvious seem to produce inconsistent results (below). > > ----- fdtest output ----- > > > > ./fdtest /dev/fd0 > > sectors per cylinder: 158 [<-- 30 expected] > > 158 = 30 + 128 > maybe bit 7 is not significant, or used for different purposes. Good point, which may also explain why the value is sometimes > 1024 on another disk in the same drive. I guess it just means: read through the code line by line before using any of this stuff. Meaningful variable names only encourage assumptions. :( -- Robert Nordier