Subject: Re: bootblocks dying on new IDE card
To: Kevin Van Maren <vanmaren@fast.cs.utah.edu>
From: Paulo Alexandre Pinto Pires <pappires@vortex.del.ufrj.br>
List: port-i386
Date: 01/14/1997 09:48:45
> >This is an old ISA machine, the controller is a SIIG CI-1050 (this is what
> >the card and the BIOS say, the box says 'Model CN2419').  The card does have
> >an on-board BIOS which claims to do LBA, but when the controller attaches the
> >drive the drive is attached as 780cyl/64hd/63sec rather than the native
> >geometry of 3121cyl/16hd/63sec that the drive claims it is.  Don't know if
> >this is important, though.
> 
> Well, the problem most likely lies here.  The *physical* intrface to the
> drive only has 4 bits for the head (meaning 16 heads max).  However,
> the BIOS interface only has 10 bits for the cylinder count, but extra
> bits for the heads.  To deal with larger disks (>512MB), bits from the
> cylinder are shifted into the heads register to pass to the BIOS.
> However, you can't actually *use* this geometry.  The BIOS shifts these
> into the cylinder count.
> 
> The problem is a) the boot blocks use the bios translation to boot
> the kernel; b) NetBSD uses direct hardware access.  You need to partition
> the disk with the BIOS's translation so that the bootblocks know what
> to pass to the BIOS.

My experience with geometry translations make me believe that the best
thing to do (both on IDE and SCSI) is to have all partitions an other
references to be made using sectors rather than cylinders as the base
unit.

The real geometry is recognized by NetBSD at boot time (unless the
disk itself lies to the system) because NetBSD does not use what is
recorded in your CMOS memory (which is what BIOS uses).

If you'll be using NetBSD alone, there's nothing to worry about with
translations: simply use what NetBSD shows you.  However, if you'll
have NetBSD and DOS (or any other system with FAT) on the same disk,
you'd better partition it with DOS FDISK program, because DOS demands
the translated geometry since it is built upon the BIOS, and your
partitions will be aligned by the BIOS's cylinder size.

Cylinder sizes may differ significantly from BIOS to NetBSD (i.e., 
they may even not be multiples).  So, after having partitioned your
disk with a partitioner which uses BIOS, you might consider running
a disk editor program (like Norton's DISKEDIT) and examine your
partition table to find its start position and offset given in sectors
instead of any other unit (fortunately, sector size is still 512bytes).

---
	Pappires