summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweingart <weingart@openbsd.org>1997-10-24 01:38:50 +0000
committerweingart <weingart@openbsd.org>1997-10-24 01:38:50 +0000
commit8ac8618cc785aead779a8cb19836e6fb623d0c0a (patch)
tree10e60ad097a6bd63fdeb7f6693b8739e23aa0430
parentUse int not char in two places. Noted by Dale. (diff)
downloadwireguard-openbsd-8ac8618cc785aead779a8cb19836e6fb623d0c0a.tar.xz
wireguard-openbsd-8ac8618cc785aead779a8cb19836e6fb623d0c0a.zip
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;
}