Module Name:    src
Committed By:   christos
Date:           Fri Jul 13 16:31:49 UTC 2012

Modified Files:
        src/sys/arch/x86/x86: x86_autoconf.c

Log Message:
fix the comparison to determine if a biosdev is a cdrom (from mhitch)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/x86/x86/x86_autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/x86_autoconf.c
diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.63 src/sys/arch/x86/x86/x86_autoconf.c:1.64
--- src/sys/arch/x86/x86/x86_autoconf.c:1.63	Sun Jun 10 13:05:18 2012
+++ src/sys/arch/x86/x86/x86_autoconf.c	Fri Jul 13 12:31:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_autoconf.c,v 1.63 2012/06/10 17:05:18 mlelstv Exp $	*/
+/*	$NetBSD: x86_autoconf.c,v 1.64 2012/07/13 16:31:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.63 2012/06/10 17:05:18 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.64 2012/07/13 16:31:49 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -454,14 +454,20 @@ findroot(void)
 		 * No booted device found; check CD-ROM boot at last.
 		 *
 		 * Our bootloader assumes CD-ROM boot if biosdev is larger
-		 * than the number of hard drives recognized by the BIOS.
-		 * The number of drives can be found in BTINFO_BIOSGEOM here.
+		 * or equal than the number of hard drives recognized by the
+		 * BIOS. The number of drives can be found in BTINFO_BIOSGEOM
+		 * here. For example, if we have wd0, wd1, and cd0:
+		 *
+		 *	big->num = 2 (for wd0 and wd1)
+		 *	bid->biosdev = 0x80 (wd0)
+		 *	bid->biosdev = 0x81 (wd1)
+		 *	bid->biosdev = 0x82 (cd0)
 		 *
 		 * See src/sys/arch/i386/stand/boot/devopen.c and
 		 * src/sys/arch/i386/stand/lib/bootinfo_biosgeom.c .
 		 */
 		if ((big = lookup_bootinfo(BTINFO_BIOSGEOM)) != NULL &&
-		    bid->biosdev > 0x80 + big->num) {
+		    bid->biosdev >= 0x80 + big->num) {
 			/*
 			 * XXX
 			 * There is no proper way to detect which unit is

Reply via email to