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 [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message