summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-05-11 04:27:24 +0000
committerbde <bde@FreeBSD.org>1996-05-11 04:27:24 +0000
commit89ed4b1107020c586e4c71815210cd3d1179f125 (patch)
tree282bb0793c9bb1c0cae3b5be30aff1b7677eaa50 /sys
parentf9a86966d520ba27eb81f92a7afea05501b86586 (diff)
downloadFreeBSD-src-89ed4b1107020c586e4c71815210cd3d1179f125.zip
FreeBSD-src-89ed4b1107020c586e4c71815210cd3d1179f125.tar.gz
Fixed BOOT_HD_BIAS.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/boot/biosboot/Makefile16
-rw-r--r--sys/i386/boot/biosboot/boot.c16
2 files changed, 21 insertions, 11 deletions
diff --git a/sys/i386/boot/biosboot/Makefile b/sys/i386/boot/biosboot/Makefile
index de2f403..d5cb29b 100644
--- a/sys/i386/boot/biosboot/Makefile
+++ b/sys/i386/boot/biosboot/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.38 1996/03/08 06:29:05 bde Exp $
+# $Id: Makefile,v 1.39 1996/04/07 14:27:55 bde Exp $
#
PROG= boot
@@ -21,11 +21,17 @@ CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
#CFLAGS+= -DFORCE_COMCONSOLE
# Bias the conversion from the BIOS drive number to the FreeBSD unit number
-# for hard disks to save typing. E.g., BOOT_HD_BIAS=1 makes BIOS drive 1
-# correspond to 1:sd(0,a) instead of 1:sd(1,a).
-# This may be useful for people booting in a mixed IDE/SCSI environment
-# (set BOOT_HD_BIAS to the number of IDE drives).
+# for hard disks. This may be useful for people booting in a mixed IDE/SCSI
+# environment (set BOOT_HD_BIAS to the number of IDE drives).
#CFLAGS+= -DBOOT_HD_BIAS=1
+#
+# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number
+# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
+# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g.,
+# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:sd(0,a) instead of
+# 1:wd(1,a). If `sd' is given explicitly, then the drive is assumed to be
+# SCSI and have BIOS drive number (sd_unit_number + BOOT_HD_BIAS). E.g.,
+# BOOT_HD_BIAS=1 makes sd(0,a) correspond to 1:sd(0,a) instead of 0:sd(0,a).
CLEANFILES+= boot.nohdr boot.strip boot1 boot2 sizetest
DPADD= ${LIBC}
diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c
index 90a638a..1c4c1c9 100644
--- a/sys/i386/boot/biosboot/boot.c
+++ b/sys/i386/boot/biosboot/boot.c
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, [92/04/03 16:51:14 rvb]
- * $Id: boot.c,v 1.48 1996/04/07 14:28:00 bde Exp $
+ * $Id: boot.c,v 1.49 1996/05/02 10:43:01 phk Exp $
*/
@@ -112,14 +112,18 @@ boot(int drive)
part = 0;
#endif
if (drive & 0x80) {
- /*
- * Hard drive. Adjust. Guess that the FreeBSD unit number
- * is the BIOS drive number biased by BOOT_HD_BIAS,
- */
+ /* Hard drive. Adjust. */
maj = 0;
#if BOOT_HD_BIAS > 0
- if (BOOT_HD_BIAS <= unit)
+ if (unit >= BOOT_HD_BIAS) {
+ /*
+ * The drive is probably a SCSI drive with a unit
+ * number BOOT_HD_BIAS less than the BIOS drive
+ * number.
+ */
+ maj = 4;
unit -= BOOT_HD_BIAS;
+ }
#endif
}
OpenPOWER on IntegriCloud