summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>2003-06-27 05:13:20 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>2003-06-27 05:13:20 +0000
commit51782cf30624a14d9b4f74fdc050243fc5036723 (patch)
treedae30083224a004893cd066b022dc91f7cf51814 /sys/arch/i386/stand
parent190314899430c56a2537b7571e2e4104fa1055d2 (diff)
Fix hang in EDD detection routine.
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r--sys/arch/i386/stand/boot/srt0.S4
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c23
2 files changed, 7 insertions, 20 deletions
diff --git a/sys/arch/i386/stand/boot/srt0.S b/sys/arch/i386/stand/boot/srt0.S
index 392e3d67c37..1fa5f2dec1d 100644
--- a/sys/arch/i386/stand/boot/srt0.S
+++ b/sys/arch/i386/stand/boot/srt0.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: srt0.S,v 1.12 2003/06/03 20:22:11 mickey Exp $ */
+/* $OpenBSD: srt0.S,v 1.13 2003/06/27 05:13:19 weingart Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -35,6 +35,7 @@
.globl _C_LABEL(edata)
.globl _C_LABEL(boot)
.globl _C_LABEL(_rtt)
+ .globl _C_LABEL(bios_bootdev)
.globl _ASM_LABEL(pmm_init)
.globl Gdtr
@@ -69,6 +70,7 @@ _start:
mov %ax,%gs
movl $BOOTSTACK,%esp
pushl %edx
+ movl %edx, _C_LABEL(bios_bootdev)
/* Now do it all */
call _ASM_LABEL(pmm_init)
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 4b31eff71c5..76670c34eea 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.58 2003/06/03 20:22:11 mickey Exp $ */
+/* $OpenBSD: biosdev.c,v 1.59 2003/06/27 05:13:19 weingart Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -46,6 +46,7 @@ static int CHS_rw (int, int, int, int, int, int, void *);
static int EDD_rw (int, int, u_int64_t, u_int32_t, void *);
extern int debug;
+int bios_bootdev;
#if 0
struct biosdisk {
@@ -88,7 +89,7 @@ bios_getdiskinfo(dev, pdi)
int dev;
bios_diskinfo_t *pdi;
{
- u_int rv, secl, sech;
+ u_int rv;
/* Just reset, don't check return code */
rv = biosdreset(dev);
@@ -122,22 +123,6 @@ bios_getdiskinfo(dev, pdi)
pdi->bios_cylinders &= 0x3ff;
pdi->bios_cylinders++;
- /*
- * NOTE: This seems to hang on certain machines. Use function #8
- * first, and verify with #21 IFF #8 succeeds first.
- * Do not try this for floppy 0 (to support CD-ROM boot).
- */
- if (dev) {
- __asm __volatile (DOINT(0x13) ";setc %b0"
- : "=a" (rv), "=d" (secl), "=c" (sech)
- : "0" (0x15FF), "1" (dev), "2" (0xFFFF)
- : "cc");
- if (!(rv & 0xff00))
- return (1);
- if (rv & 0xff)
- return (1);
- }
-
/* NOTE:
* This currently hangs/reboots some machines
* The IBM Thinkpad 750ED for one.
@@ -148,7 +133,7 @@ bios_getdiskinfo(dev, pdi)
* Future hangs (when reported) can be "fixed"
* with getSYSCONFaddr() and an exceptions list.
*/
- if (dev & 0x80) {
+ if (dev & 0x80 && (dev == 0x80 || dev == 0x81 || dev == bios_bootdev)) {
int bm;
/* EDD support check */
__asm __volatile(DOINT(0x13) "; setc %b0"