Subject: Re: Bootability eludes me once again
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 05/02/2002 10:31:43
On Thu, May 02, 2002 at 12:05:00AM -0400, der Mouse wrote:
> > I must admit that I wonder why CHS are used instead of block number
> > from the start of the disk -- I thought that disks were addressed by
> > block number anyway?
> 
> Welcome to i386-land. :-P

Absolutely!
> 
> This depends on whether it's using CHS addressing or LBA addressing,

I suspect that every disk built in the last few years supports LBA
addressing.  Indeed it might be safe to switch the mbr code (etc)
to always use LBA (maybe with alternate files for CHS for VERY
old disks and BIOS).

The problem is that 'for compatibility' the boot code uses CHS
addressing unless that clearly wont work.   Opening up all
sorts of bugs due to geometry mismatches.

FWIW the BIOS CHS interface originally allowed a byte for each
of Cylinder, Head, and Sector.  At some point larger disks
were supported by stealing the top two bits of 'Sector' and
using then to expand 'Cylinder'.  More recent BIOS just lie
about the geometry and convert 8 bits of each to the disks
geometry (or LBA?) - giving a BIOS CHS limit of 2^24
sectors (8Gb).

(The ATA interface itself has 28 bits available in both
CHS and LBA modes - about 128Gb.)

Since most modern disks have different numbers of sectors
per track across the volume.  The disk itself may have to
convert CHS to LBA before finding the sector!

	David

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