summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1997-09-02 22:42:27 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1997-09-02 22:42:27 +0000
commitfce5c3c267c022e7ebc25e85403ff8b4a6bf24a4 (patch)
treea4bc2b577835eb1b181fbc2c45ca4514ed251355
parentf3870775c4bccd46e64cfc47ea5ebe1e68629556 (diff)
Add "machine diskinfo" command. Needs work.
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c4
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.h4
-rw-r--r--sys/arch/i386/stand/libsa/cmd_i386.c13
3 files changed, 17 insertions, 4 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 202f80edb17..1902c45abea 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.28 1997/09/02 19:24:29 mickey Exp $ */
+/* $OpenBSD: biosdev.c,v 1.29 1997/09/02 22:42:25 weingart Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -57,7 +57,7 @@ struct biosdisk {
* of sectors and heads for this device
*
*/
-static u_int16_t
+u_int16_t
biosdinfo(int dev)
{
int f, rv;
diff --git a/sys/arch/i386/stand/libsa/biosdev.h b/sys/arch/i386/stand/libsa/biosdev.h
index 3305ae729a4..b0843581915 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.18 1997/08/13 14:24:01 niklas Exp $ */
+/* $OpenBSD: biosdev.h,v 1.19 1997/09/02 22:42:26 weingart Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -41,6 +41,8 @@ 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);
+
/* bioscons.c */
void pc_probe __P((struct consdev *));
diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c
index 01323e545cb..54d9516e45c 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.1 1997/09/02 20:58:15 mickey Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.2 1997/09/02 22:42:26 weingart Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner
@@ -33,6 +33,8 @@
*/
#include <sys/param.h>
+#include <machine/biosvar.h>
+#include "biosdev.h"
#include "libsa.h"
#include <cmd.h>
@@ -46,6 +48,15 @@ const struct cmd_table cmd_machine[] = {
static int
Xdiskinfo()
{
+ u_int16_t di;
+ int i;
+
+ for(i = 0x80; i < 0x85; i++){
+ di = biosdinfo(i);
+ printf("\t0x%x => Heads %d, Sectors %d\n",
+ i, BIOSNHEADS(di), BIOSNSECTS(di));
+ }
+
return 0;
}