Subject: Re: boot problem (0410 snap)
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 04/25/2002 18:03:26
On Thu, Apr 25, 2002 at 12:40:47PM -0400, der Mouse wrote:
> 
> Have I just done something stupid, or is it broken?

I suspect it is designed that way :-(

The pbr code (sector 0 of the fdisk partition) has to
read in the rest of itself (sectors 2+ of the partition).
To do this it scans the the mbr to find the netbsd
partition - so will always find the first one.
(Actually I can't remember whether it reloads the
first sector, there are references back into it - so
it could go horribly wrong if there are different versions
of boot code in different partitions.)

Even if you got the bootloader loaded from the right partition
it still defaults to wd0a:netbsd :-(


I have modified versions of the code that controls the
boot sequence - on www.l8s.co.uk then netbsd

My version of the mbr_bootsel code passes the
disk sector number through to the pbr code.
The pbr code uses this to determine which partition it was
loaded from, and passes it on into the bootcode.
The bootcode passes it into the kernel.
The kernel uses it to find the netbsd disklabel.
(In all cases the number is used as a hint - ie if there
are multiple netbsd partitions).

So F1 loads a 1.5.2 system from partition 1,
and F3 loads a current system from partition 3.
In both cases root is wd0a once the system is running.

I have though of writing the code to boot from a dos
extended partition, and to auto detect such partitions
- for disks that don't have a netbsd label, or dual
boot systems (safer than having the same info in multiple
places)

	David

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