diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 1997-09-03 04:32:45 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 1997-09-03 04:32:45 +0000 |
commit | b9b2334acd76b54749905eb72032fcfd1754b967 (patch) | |
tree | aa5773d81a56746d73c610a9fcc5438619235fe0 | |
parent | ae5f09a73a41d9926fce84fc8985be0adac86ed8 (diff) |
1st part of pretty "machine diskinfo" stuff
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.c | 9 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/biosdev.h | 4 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/cmd_i386.c | 12 |
3 files changed, 13 insertions, 12 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c index 37147f8e354..83d8b38c543 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.30 1997/09/02 23:06:54 mickey Exp $ */ +/* $OpenBSD: biosdev.c,v 1.31 1997/09/03 04:32:43 weingart Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -57,13 +57,14 @@ struct biosdisk { * of sectors and heads for this device * */ -u_int16_t +u_int32_t biosdinfo(int dev) { int f, rv; __asm __volatile (DOINT(0x13) "; setc %b0\n\t" - /* form a word w/ nhead/nsect packed */ - "movb %%cl, %b1; andb $0x3f, %b1" + /* form a word with ntrack/nhead/nsect packed */ + "shll $16, %1; movw %%cx, %w1" + /* "movb %%cl, %b1; andb $0x3f, %b1" */ : "=a" (f), "=d" (rv) : "0" (0x800), "1" (dev) : "%ecx", "cc"); return (f & 0xff)? 0 : rv; diff --git a/sys/arch/i386/stand/libsa/biosdev.h b/sys/arch/i386/stand/libsa/biosdev.h index b0843581915..eca8f947751 100644 --- a/sys/arch/i386/stand/libsa/biosdev.h +++ b/sys/arch/i386/stand/libsa/biosdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.h,v 1.19 1997/09/02 22:42:26 weingart Exp $ */ +/* $OpenBSD: biosdev.h,v 1.20 1997/09/03 04:32:43 weingart Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -41,7 +41,7 @@ int biosstrategy __P((void *, int, daddr_t, size_t, void *, size_t *)); int biosopen __P((struct open_file *, ...)); int biosclose __P((struct open_file *)); int biosioctl __P((struct open_file *, u_long, void *)); -u_int16_t biosdinfo(int); +u_int32_t biosdinfo(int); /* bioscons.c */ diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c index 1f58de1af58..04f0378d848 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.4 1997/09/02 23:06:55 mickey Exp $ */ +/* $OpenBSD: cmd_i386.c,v 1.5 1997/09/03 04:32:44 weingart Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner @@ -48,13 +48,13 @@ const struct cmd_table cmd_machine[] = { static int Xdiskinfo() { - u_int16_t di; + u_int32_t di; int i; - for(i = 0x80; i < 0x85; i++){ - if (!(di = biosdinfo(i))) - printf("\tDisk 0x%x => Heads %d, Sectors %d\n", - i, BIOSNHEADS(di), BIOSNSECTS(di)); + for(i = 0x80; i < 0x84; i++){ + if ((di = biosdinfo(i))) + printf("\tDisk 0x%x => Tracks %d, Heads %d, Sectors %d\n", + i, BIOSNTRACKS(di), BIOSNHEADS(di), BIOSNSECTS(di)); } return 0; |