Subject: Re: ICH6 SATA
To: Thor Lancelot Simon <tls@rek.tjls.com>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 04/03/2006 20:56:25
On Mon, Apr 03, 2006 at 01:52:11PM -0400, Thor Lancelot Simon wrote:
> 
> The boot code uses the *BIOS* to read the disk; so it is, in fact, the
> case that it would work right up until the kernel started even with a
> disk controller for which NetBSD had no driver at all.
> 
> Whatever the problem is, it's not with NetBSD's support for the ICH6;
> rather, it seems to be some kind of partitioning issue.  The MegaRAID
> undoubtedly presents a different geometry for the disks than the BIOS's
> driver for the ICH6 does; if you look at the difference in geometries,
> perhaps it will be easier to tell what's wrong.

The mbr code (and IIRC the pbr code) request the geometry from the bios,
and multiply out the CHS value for the partition and compare against
the LBA value in the mbr table.  If the values differ the code will do
an LBA read.  (This probably doesn't matter much for sector 63 though!).

Once all of bootxx is loaded, I suspect we divide the LBA sector number
by the geometry and use bios chs reads for everything below the chs limit.
If the reported geometry isn't consistent with that used for CHS reads,
then this could well give serious problems with the boot code reading
the disk.

Possibly forcing the code (in libsa?) to use LBA reads might be illuminating.

	David

-- 
David Laight: david@l8s.co.uk