Subject: Re: netbsd 2.0 no operating system
To: None <netbsd-users@netbsd.org>
From: Nenad Crnko <nc@pcmagic.net>
List: netbsd-users
Date: 04/09/2005 05:34:26
On 04/08/2005 Oliver Fuchs wrote:
> Sadly that it was not
> working - a last thought: could it be that the mbr was writen wrong?

Well, assuming that the bootselector from wd0 offered an opportunity
to boot from wd0, but you either hit F2 or let booting continue
from wd1 after a timeout, the fact that you actually used to see
"No operating system" message, would sugest that the booting progressed
to the point of loading and executing the boot code from mbr on wd1.

The message text can only come from /usr/mdec/mbr, which is used by
fdisk or sysinst to create the mbr. The other two candidates, mbr_bootsel
and mbr_ext, do not contain the string, but instaed just print "3"
if the same problem occours.

The mbr is formed by combining the code from /usr/mdec/mbr and injecting
4 * 16 bytes of partition information at offset 512 - (4 * 16 + 2).
The last two bytes, 0x55 and 0xaa at offset 510, make the MBR_MAGIC,
which is used by BIOS to speculate about presence of a bootable partition.

The source code making an mbr comes from here:
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-release-2-0/src/sys/arch/i386/stand/mbr/mbr.S

If I understand it correctly, the error message you mention is
printed only if mbr code can not find MBR_MAGIC.

We have missed the opportunity to get the content from wd1 mbr when
your system still failed to boot. It would have been useful to get it
like so:
  # dd if=/dev/wd1d of=/tmp/funny_mbr count=1
or
  # dd if=/dev/wd0d count=1 | hexdump -C

It seems that for some reason the sector lost its MBR_MAGIC during
or after installation. If there is a bug in sysinst and you would
like to help tracking it down, you would probably have to repeat your
ordeal a few times to find out and document how to reliably reproduce
the problem.