Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2002 13:20:50 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        John Hay <jhay@icomtek.csir.co.za>
Cc:        current@FreeBSD.ORG
Subject:   Re: umass CF geometry problems, was Re: fdisk -BI ob clean disk broken
Message-ID:  <Pine.BSF.4.21.0211041311450.7556-100000@root.org>
In-Reply-To: <200211041719.gA4HJvaG014484@zibbi.icomtek.csir.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 4 Nov 2002, John Hay wrote:
> > Let's work on the 'proper' solution first.
> > 
> > What SCSI commands are suitable for getting the geometry, generically
> > on a device?
> 
> Hmmm, I made an interesting discovery. I searched through some of the
> scsi drivers, sys/dev/{aha|ahb|aic*|sym}, looking for XPT_CALC_GEOMETRY
> and they all fake the geometry. :-/

That's the currently the only correct way to do it.  Geometry means
nothing in SCSI, everything is linear block address.  For an example of
how to convert from LBA to C/H/S, see p. 92 of CAM2.

---
SETSIZE converts a read capacity value to int 13h head-cylinder-sector
requirements.  It minimizes the value for number of heads and maximizes
the number of cylinders.  This supports very large disks before the number
of heads will not fit in 4 bits (or 6 bits).  This algorithm also
minimizes the number of sectors that are unused at the end of the disk
while allowing for large disks to be accommodated.  This algorithm does
not use physical geometry.
---

It might be more useful for GEOM to query the BIOS for the physical values
and provide a way for upper levels (like CAM) to retrieve this.  I'm not
familiar with what GEOM provides so far so perhaps someone can speak up
with a better way.  I'm also not sure why someone would need the physical
values.

-Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0211041311450.7556-100000>