summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2003-09-18 08:24:12 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2003-09-18 08:24:12 +0000
commit5812a5bf57ae0811c582a45039f9ff7cacb8cec2 (patch)
tree62bb3ad94b092816af8e527b555b9837507c5324 /sys/arch/i386
parent267fd2860524ea8256b7305d48adec99957041e3 (diff)
- move checks earlier to catch inexistent devices before testing for edd.
- bump version. toby@ ok.
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/conf.c4
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/i386/stand/boot/conf.c b/sys/arch/i386/stand/boot/conf.c
index 4a9116aa3ea..959b7064d3e 100644
--- a/sys/arch/i386/stand/boot/conf.c
+++ b/sys/arch/i386/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.24 2003/09/11 17:39:33 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.25 2003/09/18 08:24:10 fgsch Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -42,7 +42,7 @@
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "2.02";
+const char version[] = "2.03";
int debug = 1;
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 71ade047420..252522a535f 100644
--- a/sys/arch/i386/stand/libsa/biosdev.c
+++ b/sys/arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.63 2003/09/18 06:55:55 fgsch Exp $ */
+/* $OpenBSD: biosdev.c,v 1.64 2003/09/18 08:24:11 fgsch Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -114,6 +114,14 @@ bios_getdiskinfo(int dev, bios_diskinfo_t *pdi)
if (rv & 0xff)
return (1);
+ /* Sanity check */
+ if (!pdi->bios_cylinders || !pdi->bios_heads || !pdi->bios_sectors)
+ return(1);
+
+ /* CD-ROMs sometimes return heads == 1 */
+ if (pdi->bios_heads < 2)
+ return(1);
+
/* Fix up info */
pdi->bios_number = dev;
pdi->bios_heads++;
@@ -150,14 +158,6 @@ bios_getdiskinfo(int dev, bios_diskinfo_t *pdi)
} else
pdi->bios_edd = -1;
- /* Sanity check */
- if (!pdi->bios_cylinders || !pdi->bios_heads || !pdi->bios_sectors)
- return(1);
-
- /* CD-ROMs sometimes return heads == 1 */
- if (pdi->bios_heads < 2)
- return(1);
-
return(0);
}