summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-11-30 21:51:48 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-11-30 21:51:48 +0000
commit4a96c93ae21b952c781159efe591068ab029a5e6 (patch)
treef6e11928545efa0817379858d4260a3cdfb1eb0d
parent2b1a74232de162de072ea641cae4a1f31b8e79c1 (diff)
big diskinfo changes from toby@
-rw-r--r--sys/arch/i386/stand/libsa/apmprobe.c5
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c109
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.h7
-rw-r--r--sys/arch/i386/stand/libsa/cmd_i386.c22
-rw-r--r--sys/arch/i386/stand/libsa/diskprobe.c193
-rw-r--r--sys/arch/i386/stand/libsa/exec_i386.c5
-rw-r--r--sys/arch/i386/stand/libsa/libsa.h3
-rw-r--r--sys/arch/i386/stand/libsa/machdep.c6
-rw-r--r--sys/arch/i386/stand/libsa/memprobe.c4
9 files changed, 231 insertions, 123 deletions
diff --git a/sys/arch/i386/stand/libsa/apmprobe.c b/sys/arch/i386/stand/libsa/apmprobe.c
index 51389567fb7..bb6b37b61d8 100644
--- a/sys/arch/i386/stand/libsa/apmprobe.c
+++ b/sys/arch/i386/stand/libsa/apmprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmprobe.c,v 1.2 1997/10/22 23:34:36 mickey Exp $ */
+/* $OpenBSD: apmprobe.c,v 1.3 1997/11/30 21:51:36 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -132,7 +132,6 @@ apmprobe()
if ((ai.apm_detail = apm_check())) {
- printf("apm0");
apm_disconnect();
if (apm_connect(&ai) != 0)
printf(": connect error\n");
@@ -143,7 +142,7 @@ apmprobe()
ai.apm_data_base, ai.apm_data_len,
ai.apm_entry);
#else
- printf(" detected");
+ printf(" apm");
#endif
putchar('\n');
addbootarg(BOOTARG_APMINFO, sizeof(ai), &ai);
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 130ed3a6d80..014da740ef1 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.48 1997/11/05 02:02:25 mickey Exp $ */
+/* $OpenBSD: biosdev.c,v 1.49 1997/11/30 21:51:38 mickey Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -38,6 +38,7 @@
#include <machine/tss.h>
#include <machine/biosvar.h>
#include <lib/libsa/saerrno.h>
+#include "disk.h"
#include "debug.h"
#include "libsa.h"
#include "biosdev.h"
@@ -47,11 +48,13 @@ static int biosdisk_errno __P((u_int));
extern int debug;
+#if 0
struct biosdisk {
bios_diskinfo_t *bios_info;
dev_t bsddev;
struct disklabel disklabel;
};
+#endif
struct EDD_CB {
u_int8_t edd_len; /* size of packet */
@@ -62,16 +65,34 @@ struct EDD_CB {
};
/*
+ * reset disk system
+ */
+static int
+biosdreset(dev)
+ int dev;
+{
+ int rv;
+ __asm __volatile (DOINT(0x13) "; setc %b0" : "=a" (rv)
+ : "0" (0), "d" (dev) : "%ecx", "cc");
+ return (rv & 0xff)? rv >> 8 : 0;
+}
+
+/*
* Fill out a bios_diskinfo_t for this device.
* Return 0 if all ok.
* Return 1 if not ok.
*/
int
-bios_getinfo(dev, pdi)
+bios_getdiskinfo(dev, pdi)
int dev;
bios_diskinfo_t *pdi;
{
u_int rv;
+
+ rv = biosdreset(dev);
+ if(rv)
+ return(1);
+
#ifdef BIOS_DEBUG
printf("getinfo: try #8, %x,%p\n", dev, pdi);
#endif
@@ -138,19 +159,6 @@ bios_getinfo(dev, pdi)
}
/*
- * reset disk system
- */
-static __inline int
-biosdreset(dev)
- int dev;
-{
- int rv;
- __asm __volatile (DOINT(0x13) "; setc %b0" : "=a" (rv)
- : "0" (0), "d" (dev) : "%ecx", "cc");
- return (rv & 0xff)? rv >> 8 : 0;
-}
-
-/*
* Read/Write a block from given place using the BIOS.
*/
static __inline int
@@ -245,7 +253,9 @@ biosd_io(rw, dev, cyl, head, sect, nsect, buf)
break;
default: /* All other errors */
+#ifdef BIOS_DEBUG
printf("\nBIOS error 0x%x (%s)\n", error, biosdisk_err(error));
+#endif
biosdreset(dev);
break;
}
@@ -268,22 +278,20 @@ biosd_io(rw, dev, cyl, head, sect, nsect, buf)
* Try to read the bsd label on the given BIOS device
*/
const char *
-bios_getdisklabel(dev, label)
- int dev;
+bios_getdisklabel(bd, label)
+ bios_diskinfo_t *bd;
struct disklabel *label;
{
daddr_t off = LABELSECTOR;
- bios_diskinfo_t *bd;
char *buf;
struct dos_mbr mbr;
int cyl, head, sect;
int error, i;
/* Read MBR */
- bd = bios_dklookup(dev);
btochs(DOSBBSECTOR, cyl, head, sect, bd->bios_heads, bd->bios_sectors);
- error = biosd_io(F_READ, dev, cyl, head, sect, 1, &mbr);
+ error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, &mbr);
if(error)
return(biosdisk_err(error));
@@ -313,7 +321,7 @@ bios_getdisklabel(dev, label)
#endif
/* read disklabel */
btochs(off, cyl, head, sect, bd->bios_heads, bd->bios_sectors);
- error = biosd_io(F_READ, dev, cyl, head, sect, 1, buf);
+ error = biosd_io(F_READ, bd->bios_number, cyl, head, sect, 1, buf);
if(error)
return("failed to read disklabel");
@@ -327,9 +335,8 @@ biosopen(struct open_file *f, ...)
{
va_list ap;
register char *cp, **file;
- const char *st;
dev_t maj, unit, part;
- register struct biosdisk *bd;
+ struct diskinfo *dip;
int biosdev;
va_start(ap, f);
@@ -395,35 +402,41 @@ biosopen(struct open_file *f, ...)
return ENXIO;
}
- bd = alloc(sizeof(*bd));
- bzero(bd, sizeof(bd));
+ /* Find device */
+ bootdev_dip = dip = dklookup(biosdev);
- if (!(bd->bios_info = bios_dklookup(biosdev)))
- return ENXIO;
+ /* Fix up bootdev */
+ { dev_t bsd_dev;
+ bsd_dev = dip->bios_info.bsd_dev;
+ dip->bsddev = MAKEBOOTDEV(B_TYPE(bsd_dev), B_ADAPTOR(bsd_dev),
+ B_CONTROLLER(bsd_dev), unit, part);
+ dip->bootdev = MAKEBOOTDEV(B_TYPE(bsd_dev), B_ADAPTOR(bsd_dev),
+ B_CONTROLLER(bsd_dev), B_UNIT(bsd_dev), part);
+ }
- bootdev = bd->bios_info->bsd_dev;
- bd->bsddev = MAKEBOOTDEV(B_TYPE(bootdev), B_ADAPTOR(bootdev),
- B_CONTROLLER(bootdev), unit, part);
- bootdev = MAKEBOOTDEV(B_TYPE(bootdev), B_ADAPTOR(bootdev),
- B_CONTROLLER(bootdev), B_UNIT(bootdev), part);
+#if 0
+ dip->bios_info.bsd_dev = dip->bootdev;
+ bootdev = dip->bootdev;
+#endif
#ifdef BIOS_DEBUG
if (debug) {
printf("BIOS geometry: heads=%u, s/t=%u; EDD=%d\n",
- bd->bios_info->bios_heads, bd->bios_info->bios_sectors,
- bd->bios_info->bios_edd);
+ dip->bios_info.bios_heads, dip->bios_info.bios_sectors,
+ dip->bios_info.bios_edd);
}
#endif
- /* Get disklabel from drive */
- if ((st = bios_getdisklabel(biosdev, &bd->disklabel)) != NULL) {
- if (debug)
+ /* Try for disklabel again (might be removable media) */
+ if(dip->bios_info.flags & BDI_BADLABEL){
+ const char *st = bios_getdisklabel((void*)biosdev, &dip->disklabel);
+ if (debug && st)
printf("%s\n", st);
return ERDLAB;
}
- f->f_devdata = bd;
+ f->f_devdata = dip;
return 0;
}
@@ -517,24 +530,24 @@ biosstrategy(devdata, rw, blk, size, buf, rsize)
size_t *rsize;
{
u_int8_t error = 0;
- struct biosdisk *bd = (struct biosdisk *)devdata;
+ struct diskinfo *dip = (struct diskinfo *)devdata;
register size_t i, nsect, n, spt, tpc;
int dev;
nsect = (size + DEV_BSIZE-1) / DEV_BSIZE;
if (rsize != NULL)
- blk += bd->disklabel.
- d_partitions[B_PARTITION(bd->bsddev)].p_offset;
+ blk += dip->disklabel.
+ d_partitions[B_PARTITION(dip->bsddev)].p_offset;
/* handle floppies w/ different from drive geometry */
- if (!(bd->bios_info->bios_number & 0x80) &&
- bd->disklabel.d_nsectors != 0)
- spt = bd->disklabel.d_nsectors;
+ if (!(dip->bios_info.bios_number & 0x80) &&
+ dip->disklabel.d_nsectors != 0)
+ spt = dip->disklabel.d_nsectors;
else
- spt = bd->bios_info->bios_sectors;
+ spt = dip->bios_info.bios_sectors;
- tpc = bd->bios_info->bios_heads;
- dev = bd->bios_info->bios_number;
+ tpc = dip->bios_info.bios_heads;
+ dev = dip->bios_info.bios_number;
for (i = 0; error == 0 && i < nsect;
i += n, blk += n, buf += n * DEV_BSIZE) {
@@ -567,7 +580,7 @@ int
biosclose(f)
struct open_file *f;
{
- free(f->f_devdata, 0);
+ f->f_devdata = NULL;
return 0;
}
diff --git a/sys/arch/i386/stand/libsa/biosdev.h b/sys/arch/i386/stand/libsa/biosdev.h
index b2b828316f3..f7e7a49b3ad 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.23 1997/10/22 23:34:37 mickey Exp $ */
+/* $OpenBSD: biosdev.h,v 1.24 1997/11/30 21:51:40 mickey Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -41,11 +41,12 @@ 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 *));
-int bios_getinfo __P((int, bios_diskinfo_t *));
+int bios_getdiskinfo __P((int, bios_diskinfo_t *));
int biosd_io __P((int, int, int, int, int, int, void*));
-const char * bios_getdisklabel __P((int, struct disklabel *));
+const char * bios_getdisklabel __P((bios_diskinfo_t *, struct disklabel *));
/* diskprobe.c */
+struct diskinfo *dklookup __P((int));
bios_diskinfo_t *bios_dklookup __P((int));
/* bioscons.c */
diff --git a/sys/arch/i386/stand/libsa/cmd_i386.c b/sys/arch/i386/stand/libsa/cmd_i386.c
index e1b497332ba..50a5cb36e49 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.18 1997/10/25 02:07:09 weingart Exp $ */
+/* $OpenBSD: cmd_i386.c,v 1.19 1997/11/30 21:51:41 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff, Tobias Weingartner
@@ -33,8 +33,10 @@
*/
#include <sys/param.h>
-#include <sys/disklabel.h>
+#include <sys/reboot.h>
#include <machine/biosvar.h>
+#include <sys/disklabel.h>
+#include "disk.h"
#include "debug.h"
#include "biosdev.h"
#include "libsa.h"
@@ -59,21 +61,7 @@ const struct cmd_table cmd_machine[] = {
static int
Xdiskinfo()
{
- int i;
-
- printf(
- "Disk\tBIOS#\tBSD#\t\tCyls\tHeads\tSecs\tFlags\tChecksum(%d)\n",
- bios_cksumlen);
- for(i = 0; bios_diskinfo[i].bios_number != -1 && i < 10; i++){
- int d = bios_diskinfo[i].bios_number;
-
- printf(
- "%cd%d\t0x%x\t0x%x\t%d\t%d\t%d\t0x%x\t0x%x\n",
- (d & 0x80)?'h':'f', (d & 0x80)?d - 128:d, d,
- bios_diskinfo[i].bsd_dev, bios_diskinfo[i].bios_cylinders,
- bios_diskinfo[i].bios_heads, bios_diskinfo[i].bios_sectors,
- bios_diskinfo[i].flags, bios_diskinfo[i].checksum);
- }
+ dump_diskinfo();
return 0;
}
diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c
index efa39d9aeb1..83b8e901ce1 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.11 1997/10/29 23:12:46 niklas Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.12 1997/11/30 21:51:42 mickey Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -32,12 +32,17 @@
*
*/
+/* We want the disk type names from disklabel.h */
+#define DKTYPENAMES
+
#include <sys/param.h>
+#include <sys/queue.h>
#include <sys/reboot.h>
#include <sys/disklabel.h>
#include <stand/boot/bootarg.h>
#include <machine/biosvar.h>
#include <lib/libz/zlib.h>
+#include "disk.h"
#include "biosdev.h"
#include "libsa.h"
@@ -46,110 +51,202 @@
/* Local Prototypes */
static int disksum __P((int));
-/* These get passed to kernel */
-bios_diskinfo_t bios_diskinfo[16];
-u_int32_t bios_cksumlen;
+/* List of disk devices we found/probed */
+static struct disklist_lh disklist;
-/* Probe for all BIOS disks */
-void
-diskprobe()
-{
- struct disklabel label;
- register u_int i;
- register bios_diskinfo_t *pdi;
- u_int type;
- u_int scsi = 0, ide = 0, bsdunit;
+/* Pointer to boot device */
+struct diskinfo *bootdev_dip;
- printf("Probing disks:");
- pdi = bios_diskinfo;
+
+/* Probe for all BIOS floppies */
+static void
+floppyprobe()
+{
+ struct diskinfo *dip;
+ int i;
/* Floppies */
- for(i = 0; i < 4; i++, pdi++) {
- if(bios_getinfo(i, pdi)) {
+ for(i = 0; i < 4; i++) {
+ dip = alloc(sizeof(struct diskinfo));
+ bzero(dip, sizeof(*dip));
+
+ if(bios_getdiskinfo(i, &dip->bios_info)) {
#ifdef BIOS_DEBUG
printf(" <!fd%u>", i);
#endif
+ free(dip, 0);
break;
- } else
- printf(" fd%u", i);
+ }
+
+ printf(" fd%u", i);
/* Fill out best we can - (fd?) */
- pdi->bsd_dev = MAKEBOOTDEV(2, 0, 0, i, RAW_PART);
+ dip->bios_info.bsd_dev = MAKEBOOTDEV(2, 0, 0, i, RAW_PART);
+ if((bios_getdisklabel(&dip->bios_info, &dip->disklabel)) != 0)
+ dip->bios_info.flags |= BDI_BADLABEL;
+ else
+ dip->bios_info.flags |= BDI_GOODLABEL;
+
+ /* Add to queue of disks */
+ TAILQ_INSERT_TAIL(&disklist, dip, list);
}
+}
-#ifdef BIOS_DEBUG
- printf(";");
-#endif
+
+/* Probe for all BIOS floppies */
+static void
+hardprobe()
+{
+ struct diskinfo *dip;
+ int i;
+ u_int bsdunit, type;
+ u_int scsi = 0, ide = 0;
/* Hard disks */
- for(i = 0; i < 8; i++, pdi++) {
+ for(i = 0x80; i < 0x88; i++) {
+ dip = alloc(sizeof(struct diskinfo));
- if(bios_getinfo(i | 0x80, pdi)) {
+ if(bios_getdiskinfo(i, &dip->bios_info)) {
#ifdef BIOS_DEBUG
printf(" <!hd%u>", i);
#endif
+ free(dip, 0);
break;
}
- printf(" hd%u%s", i, (pdi->bios_edd > 0?"+":""));
+ printf(" hd%u%s", i&0x7f, (dip->bios_info.bios_edd > 0?"+":""));
/* Try to find the label, to figure out device type */
- if((bios_getdisklabel(i | 0x80, &label)) ) {
+ if((bios_getdisklabel(&dip->bios_info, &dip->disklabel)) ) {
printf("*");
bsdunit = ide++;
type = 0; /* XXX let it be IDE */
} else {
/* Best guess */
- switch (label.d_type) {
+ switch (dip->disklabel.d_type) {
case DTYPE_SCSI:
type = 4;
bsdunit = scsi++;
- pdi->flags |= BDI_GOODLABEL;
+ dip->bios_info.flags |= BDI_GOODLABEL;
break;
case DTYPE_ESDI:
case DTYPE_ST506:
type = 0;
bsdunit = ide++;
- pdi->flags |= BDI_GOODLABEL;
+ dip->bios_info.flags |= BDI_GOODLABEL;
break;
default:
- pdi->flags |= BDI_BADLABEL;
+ dip->bios_info.flags |= BDI_BADLABEL;
type = 0; /* XXX Suggest IDE */
bsdunit = ide++;
}
}
- pdi->checksum = 0; /* just in case */
+ dip->bios_info.checksum = 0; /* just in case */
/* Fill out best we can */
- pdi->bsd_dev = MAKEBOOTDEV(type, 0, 0, bsdunit, RAW_PART);
+ dip->bios_info.bsd_dev = MAKEBOOTDEV(type, 0, 0, bsdunit, RAW_PART);
+
+ /* Add to queue of disks */
+ TAILQ_INSERT_TAIL(&disklist, dip, list);
}
+}
+
+
+/* Probe for all BIOS supported disks */
+void
+diskprobe()
+{
+ struct diskinfo *dip;
+ int i;
+
+ /* These get passed to kernel */
+ bios_diskinfo_t *bios_diskinfo;
+ static u_int32_t bios_cksumlen;
+
+ /* Init stuff */
+ printf("disk:");
+ TAILQ_INIT(&disklist);
+
+ /* Do probes */
+ floppyprobe();
+#ifdef BIOS_DEBUG
+ printf(";");
+#endif
+ hardprobe();
+
- /* End of list */
- pdi->bios_number = -1;
/* Checksumming of hard disks */
for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; )
;
bios_cksumlen = i;
- addbootarg(BOOTARG_CKSUMLEN, sizeof(u_int32_t), &bios_cksumlen);
- addbootarg(BOOTARG_DISKINFO, (pdi - bios_diskinfo + 1) *
- sizeof(bios_diskinfo[0]), bios_diskinfo);
+ /* Get space for passing bios_diskinfo stuff to kernel */
+ for(i = 0, dip = TAILQ_FIRST(&disklist); dip; dip = TAILQ_NEXT(dip, list))
+ i++;
+ bios_diskinfo = alloc(++i * sizeof(bios_diskinfo_t));
+
+ /* Copy out the bios_diskinfo stuff */
+ for(i = 0, dip = TAILQ_FIRST(&disklist); dip; dip = TAILQ_NEXT(dip, list))
+ bios_diskinfo[i++] = dip->bios_info;
+
+ bios_diskinfo[i++].bios_number = -1;
+ /* Register for kernel use */
+ addbootarg(BOOTARG_CKSUMLEN, sizeof(u_int32_t), &bios_cksumlen);
+ addbootarg(BOOTARG_DISKINFO, i * sizeof(bios_diskinfo_t), bios_diskinfo);
printf("\n");
}
+
/* Find info on given BIOS disk */
+struct diskinfo *
+dklookup(dev)
+ int dev;
+{
+ struct diskinfo *dip;
+
+ for(dip = TAILQ_FIRST(&disklist); dip; dip = TAILQ_NEXT(dip, list))
+ if(dip->bios_info.bios_number == dev)
+ return(dip);
+
+ return(NULL);
+}
+
+void
+dump_diskinfo()
+{
+ struct diskinfo *dip;
+
+ (void)fstypenames, (void)fstypesnames;
+
+ printf("Disk\tBIOS#\tType\tCyls\tHeads\tSecs\tFlags\tChecksum\n");
+ for(dip = TAILQ_FIRST(&disklist); dip; dip = TAILQ_NEXT(dip, list)){
+ bios_diskinfo_t *bdi = &dip->bios_info;
+ int d = bdi->bios_number;
+
+ printf("%cd%d\t0x%x\t%s\t%d\t%d\t%d\t0x%x\t0x%x\n",
+ (d & 0x80)?'h':'f', d & 0x7F, d,
+ (bdi->flags & BDI_BADLABEL)?"*none*":
+ dktypenames[B_TYPE(dip->disklabel.d_type)],
+ bdi->bios_cylinders, bdi->bios_heads, bdi->bios_sectors,
+ bdi->flags, bdi->checksum);
+ }
+}
+
+/* Find BIOS protion on given BIOS disk
+ * XXX - Use dklookup() instead.
+ */
bios_diskinfo_t *
bios_dklookup(dev)
register int dev;
{
- register int i;
+ struct diskinfo *dip;
- for(i = 0; bios_diskinfo[i].bios_number != -1; i++)
- if(bios_diskinfo[i].bios_number == dev)
- return(&bios_diskinfo[i]);
+ dip = dklookup(dev);
+ if(dip)
+ return(&dip->bios_info);
return(NULL);
}
@@ -164,14 +261,16 @@ static int
disksum(blk)
int blk;
{
- bios_diskinfo_t *bdi, *bd;
+ struct diskinfo *dip, *dip2;
int st, reprobe = 0;
int hpc, spt, dev;
char *buf;
int cyl, head, sect;
buf = alloca(DEV_BSIZE);
- for (bdi = bios_diskinfo; bdi->bios_number != -1; bdi++) {
+ for(dip = TAILQ_FIRST(&disklist); dip; dip = TAILQ_NEXT(dip, list)){
+ bios_diskinfo_t *bdi = &dip->bios_info;
+
/* Skip this disk if it is not a HD or has had an I/O error */
if (!(bdi->bios_number & 0x80) || bdi->flags & BDI_INVALID)
continue;
@@ -189,12 +288,16 @@ disksum(blk)
}
bdi->checksum = adler32(bdi->checksum, buf, DEV_BSIZE);
- for (bd = bios_diskinfo; bd != bdi; bd++)
+ for(dip2 = TAILQ_FIRST(&disklist); dip2 != dip;
+ dip2 = TAILQ_NEXT(dip2, list)){
+ bios_diskinfo_t *bd = &dip2->bios_info;
if ((bd->bios_number & 0x80) &&
!(bd->flags & BDI_INVALID) &&
bdi->checksum == bd->checksum)
reprobe = 1;
+ }
}
return (reprobe);
}
+
diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c
index aa954abab7a..460fd579ace 100644
--- a/sys/arch/i386/stand/libsa/exec_i386.c
+++ b/sys/arch/i386/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.19 1997/10/25 07:00:26 mickey Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.20 1997/11/30 21:51:43 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -40,6 +40,8 @@
#include <dev/cons.h>
#include <stand/boot/bootarg.h>
#include <machine/biosvar.h>
+#include <sys/disklabel.h>
+#include "disk.h"
#include "libsa.h"
#define round_to_size(x) (((int)(x) + sizeof(int) - 1) & ~(sizeof(int) - 1))
@@ -52,6 +54,7 @@ machdep_start(startaddr, howto, loadaddr, ssym, esym)
char *startaddr, *loadaddr, *ssym, *esym;
int howto;
{
+ dev_t bootdev = bootdev_dip->bootdev;
size_t ac = BOOTARG_LEN;
caddr_t av = (caddr_t)BOOTARG_OFF;
#ifdef EXEC_DEBUG
diff --git a/sys/arch/i386/stand/libsa/libsa.h b/sys/arch/i386/stand/libsa/libsa.h
index 4f0da047c1f..54b8b8aee1a 100644
--- a/sys/arch/i386/stand/libsa/libsa.h
+++ b/sys/arch/i386/stand/libsa/libsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libsa.h,v 1.22 1997/10/24 22:22:57 mickey Exp $ */
+/* $OpenBSD: libsa.h,v 1.23 1997/11/30 21:51:44 mickey Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -49,7 +49,6 @@ void time_print __P((void));
extern const char bdevs[][4];
extern const int nbdevs;
-extern int bootdev; /* XXX pass through the global to exec_i386 */
extern u_int cnvmem, extmem; /* XXX global pass memprobe()->machdep_start() */
/* diskprobe.c */
diff --git a/sys/arch/i386/stand/libsa/machdep.c b/sys/arch/i386/stand/libsa/machdep.c
index e4cdd9deca6..366c04e6574 100644
--- a/sys/arch/i386/stand/libsa/machdep.c
+++ b/sys/arch/i386/stand/libsa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.21 1997/10/22 23:34:39 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.22 1997/11/30 21:51:46 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -38,7 +38,6 @@
#include "debug.h"
struct BIOS_regs BIOS_regs;
-int bootdev;
#if defined(DEBUG) && !defined(_TEST)
#define CKPT(c) (*(u_int16_t*)0xb8148 = 0x4700 + (c))
@@ -57,7 +56,10 @@ machdep()
#ifndef _TEST
memprobe(); CKPT('4');
diskprobe(); CKPT('6');
+
+ printf("bios:");
apmprobe(); CKPT('7');
+ printf("\n");
#endif
CKPT('9');
}
diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c
index 6ae13844fd1..984b19f1efb 100644
--- a/sys/arch/i386/stand/libsa/memprobe.c
+++ b/sys/arch/i386/stand/libsa/memprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memprobe.c,v 1.24 1997/10/23 15:13:30 weingart Exp $ */
+/* $OpenBSD: memprobe.c,v 1.25 1997/11/30 21:51:47 mickey Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner, Michael Shalayeff
@@ -278,7 +278,7 @@ memprobe()
/* Register in global var */
addbootarg(BOOTARG_MEMMAP, (pm - bm + 1) * sizeof(*bm), bm);
memory_map = bm; /* XXX for 'machine mem' command only */
- printf("mem0:");
+ printf("memory:");
/* XXX - Compatibility, remove later */
extmem = cnvmem = 0;