diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-09-02 23:06:56 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-09-02 23:06:56 +0000 |
commit | ae5f09a73a41d9926fce84fc8985be0adac86ed8 (patch) | |
tree | 987bbe6d76eab613d6b711562f23213d10d59e15 | |
parent | cafae5e80b0c95bcaa4b0b336a333615f8e9f072 (diff) |
change biosdinfo() to return fail value. use fake geo, where needed
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 1902c45abea..37147f8e354 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.29 1997/09/02 22:42:25 weingart Exp $ */ +/* $OpenBSD: biosdev.c,v 1.30 1997/09/02 23:06:54 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -66,7 +66,7 @@ biosdinfo(int dev) "movb %%cl, %b1; andb $0x3f, %b1" : "=a" (f), "=d" (rv) : "0" (0x800), "1" (dev) : "%ecx", "cc"); - return (f & 0xff)? 0x0118 : rv; + return (f & 0xff)? 0 : rv; } /* @@ -230,6 +230,8 @@ biosopen(struct open_file *f, ...) BIOS_vars.bios_dev = bd->biosdev; bd->dinfo = biosdinfo(bd->biosdev); + if (!bd->dinfo) + bd->dinfo = 0x0118; /* fake geometry */ /* pass c: geometry for floppy */ BIOS_vars.bios_geometry = (bd->biosdev & 0x80)? bd->dinfo : biosdinfo(0x80); diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index dc1e849648c..1f58de1af58 100644 --- a/sys/arch/i386/stand/libsa/cmd_i386.c +++ b/sys/arch/i386/stand/libsa/cmd_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd_i386.c,v 1.3 1997/09/02 22:43:17 weingart Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.4 1997/09/02 23:06:55 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner @@ -52,9 +52,9 @@ Xdiskinfo() int i; for(i = 0x80; i < 0x85; i++){ - di = biosdinfo(i); - printf("\tDisk 0x%x => Heads %d, Sectors %d\n", - i, BIOSNHEADS(di), BIOSNSECTS(di)); + if (!(di = biosdinfo(i))) + printf("\tDisk 0x%x => Heads %d, Sectors %d\n", + i, BIOSNHEADS(di), BIOSNSECTS(di)); } return 0; |