Subject: Re: Changing NetBSD's partition ID from 0xa5
To: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
From: Duncan McEwan <duncan@MCS.VUW.AC.NZ>
List: port-i386
Date: 06/27/1997 10:10:50
> It should not be necessary to check for both in the assembly part
> because you know how the disk is partitioned when the bootstrap
> is installed. The IDs used here never refer to other disks.
> (we could offer 2 bootstrap versions, an old and a new ID aware)

True.  But it would be more convenient if we didn't have to do that.  Checking
for both should be fairly trivial for someone who knows i386 assembly well
enough.  The only possible problem would be if the extra code made the initial
boot sector too large.  Is this likely?

> Assuming the check in sys/arch/i386/stand/lib/biosdisk.c is done correctly
> the only reason I can imagine is that the disklabel entry for 'a' in the
> NetBSD disklabel points to the FreeBSD partition.

I'm pretty sure the 'a' partition does point to the right place (otherwise
how would my netbsd partition boot correctly when it has an id of 165?).  So
I guess I'll have to do some debugging of my change to biosdisk.c.

Before I start doing that, could some one give me a clue as to how the boot
blocks in biosboot.sym are split up when they are installed by installboot?

I guess the first 512 bytes goes into the first sector of the netbsd partition
and gets loaded initially either by the bios (if netbsd is the only OS on the
disk) or a boot switcher.  Then presumably the next (up to) ~7.5K (coresponding
to the old boot[fsw]d file) go into the spare sectors at the start of the 'a'
partition and this is the code that knows how to read /boot from the
filesystem.  Then /boot will be the code that does the countdown and prompts
for the boot command, etc.

It would be useful to know which files in the /usr/src/sys/arch/i386/stand
directory corespond to which parts of the bootstrap.

Thanks.

Duncan