summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>1997-10-25 02:07:11 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>1997-10-25 02:07:11 +0000
commitd04712500a72b697b72d70932b1e3cf2a0e517af (patch)
tree43002c9fc7fef9098717b88e22cab42215b2d102
parent74c14980d83a8c43424dc4879fd7a4f0a68910cb (diff)
Fix disk probe. Get rid of EDD check, it goes haywire on
some machines. Thinkpad 760ED is one of them. IBM/MS extention, and IBM does not support it. Nice. Add some more debug statements for BIOS_DEBUG. Init EDD flags to "not supported" for now. Change 'machine memory' back to display the type of each range it displays. Testing by todd@ (thanks).
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c29
-rw-r--r--sys/arch/i386/stand/libsa/cmd_i386.c20
-rw-r--r--sys/arch/i386/stand/libsa/diskprobe.c6
3 files changed, 38 insertions, 17 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index b311e49eff8..b81f1e9e2e9 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.43 1997/10/24 22:49:58 mickey Exp $ */
+/* $OpenBSD: biosdev.c,v 1.44 1997/10/25 02:07:08 weingart Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -38,6 +38,7 @@
#include <machine/tss.h>
#include <machine/biosvar.h>
#include <lib/libsa/saerrno.h>
+#include "debug.h"
#include "libsa.h"
#include "biosdev.h"
@@ -61,16 +62,16 @@ struct EDD_CB {
};
/*
- * return a word that represents the max number
- * of sectors and heads for this device
- *
+ * Fill out a bios_diskinfo_t for this device.
+ * Return 0 if all ok.
+ * Return 1 if not ok.
*/
int
bios_getinfo(dev, pdi)
int dev;
bios_diskinfo_t *pdi;
{
- u_int rv, bm;
+ u_int rv;
#ifdef BIOS_DEBUG
printf("getinfo: try #8, %x,%p\n", dev, pdi);
#endif
@@ -94,16 +95,30 @@ bios_getinfo(dev, pdi)
if (rv & 0xff || !pdi->bios_cylinders)
return(1);
+#if 0
+ /* NOTE:
+ * This currently hangs/reboots some machines
+ * The IBM Thinkpad 750ED for one.
+ *
+ * Funny that an IBM/MS extension would not be
+ * implemented by an IBM system...
+ */
if (dev & 0x80) {
+ int bm;
/* EDD support check */
- __asm __volatile(DOINT(0x13) "; setc %b0"
+ __asm __volatile("int $2;" DOINT(0x13) "; setc %b0"
: "=a" (rv), "=c" (bm)
: "0" (0x4100), "2" (0x55aa), "d" (dev) : "cc");
+ DUMP_REGS;
if (!(rv & 0xff) && (BIOS_regs.biosr_bx & 0xffff) == 0xaa55)
pdi->bios_edd = bm & 0xffff;
else
pdi->bios_edd = -1;
- }
+ }else
+ pdi->bios_edd = -1;
+#else
+ pdi->bios_edd = -1;
+#endif
/*
* NOTE: This seems to hang on certain machines. Use function #8
diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c
index 2e641f00094..e1b497332ba 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.17 1997/10/24 22:22:56 mickey Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.18 1997/10/25 02:07:09 weingart Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner
@@ -139,20 +139,22 @@ bad:
return 0;
}
-int
+static int
Xmemory()
{
bios_memmap_t *tm = memory_map;
- int total = 0;
+ int count, total = 0;
+
+ for(count = 0; tm[count].type != BIOS_MAP_END; count++){
+ printf("Region %d: type %u at 0x%lx for %luKB\n", count,
+ tm[count].type, (long)tm[count].addr, (long)tm[count].size);
- printf ("Map:");
- for(; tm->type != BIOS_MAP_END; tm++){
- printf(" [%luK]@0x%lx", (long)tm->size, (long)tm->addr);
- if(tm->type == BIOS_MAP_FREE)
- total += tm->size;
+ if(tm[count].type == BIOS_MAP_FREE)
+ total += tm[count].size;
}
- printf("\nTotal: %uK, Low: %uK, High: %uK\n", total, cnvmem, extmem);
+ printf("Low ram: %dKB High ram: %dKB\n", cnvmem, extmem);
+ printf("Total free memory: %dKB\n", total);
return 0;
}
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c
index 317ca36f348..874cdf14086 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.6 1997/10/24 22:22:57 mickey Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.7 1997/10/25 02:07:10 weingart Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -78,6 +78,10 @@ diskprobe()
i++;
}
+#ifdef BIOS_DEBUG
+ printf("/");
+#endif
+
/* Hard disks */
for(drive = 0x80; drive < 0x88; drive++) {
rv = bios_getinfo(drive, &bios_diskinfo[i]);