Subject: Re: Please test BIOS device matching code (i386)
To: Frank van der Linden <frank@wins.uva.nl>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-i386
Date: 03/11/1999 13:14:27
On Mar 11, Frank van der Linden wrote
> Hmm.. could you compile the bootblocks with GEOM_DEBUG defined in
> arch/i386/stand/lib/bootinfo_biosgeom.c, and tell me what value int
> prints for "nhd"? Maybe these BIOSes report an insanely large value
> for the number of BIOS disks present somehow (that should teach
> me not to extract values from BIOS info on a PC without sanity checks..)

That's it. It claims to have 45057 hd's. In hex this is 0xb001.
Don't know what the b stand for, but I guess and'ing the value read with
0xff would be a good approach (this machine really has 1 disk).

With the following hack the boot blocks works fine on these machines,
and reports the rigth geometry:

Index: bootinfo_biosgeom.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c,v
retrieving revision 1.4
diff -u -r1.4 bootinfo_biosgeom.c
--- bootinfo_biosgeom.c	1999/03/08 00:09:25	1.4
+++ bootinfo_biosgeom.c	1999/03/11 12:09:43
@@ -42,6 +42,8 @@
 #include "biosdisk_ll.h"
 #include "bootinfo.h"
 
+#define GEOM_DEBUG
+
 void bi_getbiosgeom()
 {
 	struct btinfo_biosgeom *bibg;
@@ -49,6 +51,7 @@
 	unsigned int cksum;
 
 	pvbcopy((void *)(0x400 + 0x75), &nhd, 1);
+	nhd &= 0xff;
 #ifdef GEOM_DEBUG
 	printf("nhd %d\n", nhd);
 #endif


--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--