Subject: Re: Compaq diagnostic partition Vs Bootselector
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 01/12/2002 21:36:44
Manuel Bouyer wrote:
> 
> On Sat, Jan 12, 2002 at 04:45:31PM +0000, David Laight wrote:
> > There is nothing anywhere that is likely to force a bootable partition
> > (for a PC) onto a cylinder boundary.
> 
> In theory maybe, but I got no ends of troubles with unaligned partitions.
> It seems some BIOSes read the MBR themselves.

Hummm...

Once the mbr code (ie the bootselect code) has loaded any bios checks
should already have happened.

It is possible than an os boot (the pbr code) requires cylinder
alignment.

The other possibility is that the various sets of chs <=> LBA mappings
are mixed up and don't match unless you are reading from a cylinder
boundary.

We have:
1) the LBA mapping the drive supports
2) the CHS map the drive supports
   (limit 16 heads, 255 sectors 65536 cylinders)
3) the CHS map the bios supports
   (limit 256 heads, 63 sectors, 1024 cylinders, top two bits of
cylinder
   are at the top of the 'sectors' byte)
4) the LBA map that netBSD wants

(the ATA limits for LBA and CHS modes are both roughly 2^28, CHS values
are
a figment of reality these days)

I guess that is you wrote the sector number to each sector you could
work
out what the bios was up to......

I've found a comment that some SCSI bios don't support LBA mode - even
though
the rest of the system says it does.  Thus the boot code tries to avoid
LBA
unless it is reading a sector which cannot be read otherwise.

My disk was formatted with dos fdisk - so has cylinder aligned
partitions.
Except for the 63 sector (maybe 1 track?) gap between the start of the
disk and the start of the first partition.  This will also be true for
the contents of DOS LBA extended partions.

I don't have a spare disk to mess with :-)

	David