Subject: Re: MBR boot fails on AMD 64 (infinite loop)
To: Vincent <10.50@free.fr>
From: David Laight <david@l8s.co.uk>
List: current-users
Date: 05/26/2005 20:31:50
On Wed, May 25, 2005 at 02:03:46PM +0200, Vincent wrote:
> 
> However, I have failed to properly boot the machine. Just after boot, it 
>  simply keeps looping on a 'NetBSD MBR boot' message that it displays 
> at libidum.

That is caused by a bug in disklabel(8) that causes it to write the
mbr sector to the pbr after sysinst has written out the correct data
to the pbr.

The problem is that the disklabel code wants to do an 8kb wide
read-modify-write cycle (scanning the entire 8k for the disklabel
signature) and under some circumstances it ends up reading from sector
zero and writing to the start of the partition.

Unfortunately the logic of disklabel is overly complex because it contains
code to update the bootcode on about 2 architectures.  Until this is all
ripped out it is rather difficult to fix properly - ie separate the 'read
disk label' and 'write disk label' paths completely.

	David

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