summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1997-10-24 01:38:52 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1997-10-24 01:38:52 +0000
commit7514cf9cb914a02d030562f9181e8b2e62239661 (patch)
tree4d00bd25614c6dbd7ee9253027d89cc550fd275d
parentfdfab4b386263894bf3f562986773cfd0aee74ec (diff)
Fix hang on disk probe.
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c11
-rw-r--r--sys/arch/i386/stand/libsa/diskprobe.c10
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index cb97b38ca7c..f7dd1d6e043 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.40 1997/10/23 15:13:26 weingart Exp $ */
+/* $OpenBSD: biosdev.c,v 1.41 1997/10/24 01:38:50 weingart Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -87,7 +87,7 @@ bios_getinfo(dev, pdi)
pdi->bios_cylinders++;
if (rv & 0xff)
- return (rv & 0xff) >> 8;
+ return(1);
/* EDD support check */
__asm __volatile(DOINT(0x13) "; setc %b0"
@@ -105,7 +105,12 @@ bios_getinfo(dev, pdi)
__asm __volatile (DOINT(0x13) "; setc %b0"
: "=a" (rv) : "0" (0x1500), "d" (dev) : "%ecx", "cc");
- return rv & 0xffff;
+ if(!(rv & 0xff00))
+ return(1);
+ if(rv & 0x00ff)
+ return(1);
+
+ return(0);
}
/*
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c
index 16e8ee6b029..080871da11a 100644
--- a/sys/arch/i386/stand/libsa/diskprobe.c
+++ b/sys/arch/i386/stand/libsa/diskprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskprobe.c,v 1.4 1997/10/23 15:13:29 weingart Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.5 1997/10/24 01:38:51 weingart Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -62,8 +62,7 @@ diskprobe()
for(drive = 0; drive < 4; drive++) {
rv = bios_getinfo(drive, &bios_diskinfo[i]);
- if( (rv & 0x00FF)) break;
- if(!(rv & 0xFF00)) break;
+ if(rv) break;
printf(" fd%u", drive);
@@ -76,8 +75,7 @@ diskprobe()
for(drive = 0x80; drive < 0x88; drive++) {
rv = bios_getinfo(drive, &bios_diskinfo[i]);
- if( (rv & 0x00FF)) continue;
- if(!(rv & 0xFF00)) continue;
+ if(rv) break;
unit = drive - 0x80;
printf(" hd%u%s", unit, (bios_diskinfo[i].bios_edd > 0?"+":""));
@@ -168,7 +166,7 @@ disksum(bdi)
sum = adler32(sum, buf, DEV_BSIZE);
- /* Do a minimum of 8 sectors (floppy is slow...) */
+ /* Do a minimum of 8 sectors */
if((len >= 8) && ((bd = find_sum(sum)) == NULL))
break;
}