Subject: Re: Changing NetBSD's partition ID from 0xa5 (was: NetBSD and FreeBSD co-existing)
To: port-i386@NetBSD.ORG, Duncan McEwan <duncan@MCS.VUW.AC.NZ>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: port-i386
Date: 06/26/1997 10:56:14
Excerpts from netbsd: 26-Jun-97 Changing NetBSD's partition.. Duncan
McEwan@MCS.VUW.AC (2631*)

> So I started looking at what was necessary to change NetBSD's partition ID
> from 165 (0xa5).  I changed the code in sys/arch/i386/stand/lib/biosdisk.c to
> check first for 167 then 165.  I also changed arch/i386/i386/disksubr.c to
> check for both, and in
"sys/arch/i386/stand/lib/crt/bootsect/start_bootsect.S"
> changed BSDPART from 0xA5 to 0xA7 (I wasn't confident enough in my i386
> assembly to make it check for both).

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)

> With the resulting biosboot.sym and kernel installed, the boot blocks loaded
> but then couldn't find the file "netbsd".  When I used the boot program's "ls
> wd0a:" command, I found I was looking at my FreeBSD root partition!  So I
> assume that there is still an 0xa5 reference lurking somewhere that's causing
> the boot process to find the FreeBSD partition rather than the NetBSD one

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.

best regards
Matthias