Subject: Re: new laptop drive
To: None <port-i386@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 05/29/2002 00:41:11
On Tue, May 28, 2002 at 09:52:35PM +0200, Wojciech Puchar wrote:
> >
> > I think David meant: at install time, have the install kernel detect
> > whether the BIOS supports int13 extensions. If it does, then install
> > the LBA bootblocks; otherwise install the non-LBA bootblocks.
> 
> AFAIK we have one bootloader for both. and it detects it when loaded (as
> on my machine on which my 20GB disk is set to CHS in BIOS and netbsd
> kernel is on partition above 504MB)
> 

I don't think you know what the current released code does!!!!!

From memory the mbr_bootsel code does (it's rather late here):

    if (bios_appears_to_support_lba && fdisk_said_use_lba)
	do_lba_read
    else
	do_chs_read

fdisk sets the flag if a bootable partition is beyond the
CHS boundary, I don't think it ever clears the flag!

In practise this means that the first test is redundant!
If we are trying to boot a sector beyond the CHS boundary we
have to use LBA - comparing the required sector number against a
limit is all that is needed.

If fdisk is going to set a flag to tell the boot code to do
LBA, it could equally well write an entirely different bootstrap.
The end effect is the same.

Indeed if the mbr code didn't have to decide whether to do
CHS or LBA reads I suspect there is room to write code to boot
extended partitions (for those who need to boot more than 4
differnent OS)

	David

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