summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-10-27 14:42:04 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-10-27 14:42:04 +0000
commit08b8f9c1cea523d834aec400f6ec4d12b2ecdd49 (patch)
tree13a8613dfbea9ef3dfd216fcdd54cae03d2eebb8 /sys/arch
parentb5464f47493b2abb003205f76e8776597eeb176a (diff)
Mandatory disk signature BIOS->BSD mapping enabled
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/conf/files.i3868
-rw-r--r--sys/arch/i386/i386/autoconf.c25
-rw-r--r--sys/arch/i386/i386/conf.c5
-rw-r--r--sys/arch/i386/i386/dkcsum.c8
4 files changed, 32 insertions, 14 deletions
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index 3b0ac979366..aad9fa9016a 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.35 1997/10/27 08:06:31 niklas Exp $
+# $OpenBSD: files.i386,v 1.36 1997/10/27 14:42:01 niklas Exp $
# $NetBSD: files.i386,v 1.73 1996/05/07 00:58:36 thorpej Exp $
#
# new style config file for i386 architecture
@@ -32,6 +32,8 @@ file arch/i386/i386/random.s
file arch/i386/i386/sys_machdep.c
file arch/i386/i386/trap.c
file arch/i386/i386/vm_machdep.c
+file arch/i386/i386/dkcsum.c
+file lib/libz/adler32.c !ppp_deflate
file dev/cons.c
file dev/cninit.c
major {vnd = 14}
@@ -222,7 +224,3 @@ file arch/i386/i386/bios.c bios needs-count
device apm
attach apm at bios
file arch/i386/i386/apm.c apm needs-count
-
-pseudo-device dkcsum
-file arch/i386/i386/dkcsum.c dkcsum needs-flag
-file lib/libz/adler32.c dkcsum & !ppp_deflate
diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c
index d9af43eb9e3..921977a346e 100644
--- a/sys/arch/i386/i386/autoconf.c
+++ b/sys/arch/i386/i386/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.25 1997/05/22 05:28:58 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.26 1997/10/27 14:42:02 niklas Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */
/*-
@@ -62,6 +62,14 @@
#include <dev/cons.h>
+#include "bios.h"
+#if NBIOS > 0
+#include <machine/biosvar.h>
+extern void dkcsumattach __P((void)); /* XXX should be elsewhere */
+extern bios_diskinfo_t *bios_diskinfo; /* XXX should be elsewhere */
+int i386_mountroot __P((void));
+#endif
+
void swapconf __P((void));
void setroot __P((void));
void setconf __P((void));
@@ -363,7 +371,11 @@ noask:
}
doswap:
+#if NBIOS > 0
+ mountroot = i386_mountroot;
+#else
mountroot = dk_mountroot;
+#endif
swdevt[0].sw_dev = argdev = dumpdev =
makedev(major(rootdev), minor(rootdev) + 1);
/* swap size and dumplo set during autoconfigure */
@@ -372,3 +384,14 @@ doswap:
rootdev = dumpdev;
#endif
}
+
+#if NBIOS > 0
+int
+i386_mountroot()
+{
+ /* Establish BIOS to BSD disk mappings. */
+ if (bios_diskinfo)
+ dkcsumattach();
+ return (dk_mountroot());
+}
+#endif
diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c
index 4bb121b12dd..92d71db8939 100644
--- a/sys/arch/i386/i386/conf.c
+++ b/sys/arch/i386/i386/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.39 1997/10/27 08:06:31 niklas Exp $ */
+/* $OpenBSD: conf.c,v 1.40 1997/10/27 14:42:02 niklas Exp $ */
/* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */
/*
@@ -41,7 +41,6 @@
#include <machine/conf.h>
-#include "dkcsum.h"
#include "wdc.h"
#include "wd.h"
bdev_decl(wd);
@@ -370,7 +369,6 @@ blktochr(dev)
return (NODEV);
}
-#if NDKCSUM > 0
/*
* In order to map BSD bdev numbers of disks to their BIOS equivalents
* we use several heuristics, one being using checksums of the first
@@ -406,7 +404,6 @@ dev_rawpart(dv)
RAW_PART));
return (NODEV);
}
-#endif
/*
* This entire table could be autoconfig()ed but that would mean that
diff --git a/sys/arch/i386/i386/dkcsum.c b/sys/arch/i386/i386/dkcsum.c
index 4d93d473bc5..0c70480417e 100644
--- a/sys/arch/i386/i386/dkcsum.c
+++ b/sys/arch/i386/i386/dkcsum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkcsum.c,v 1.1 1997/10/27 08:06:30 niklas Exp $ */
+/* $OpenBSD: dkcsum.c,v 1.2 1997/10/27 14:42:03 niklas Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -56,11 +56,10 @@ dev_t dev_rawpart __P((struct device *)); /* XXX */
extern u_int32_t bios_cksumlen;
extern bios_diskinfo_t *bios_diskinfo;
-void dkcsumattach __P((int));
+void dkcsumattach __P((void)); /* XXX should be elsewhere */
void
-dkcsumattach(unused)
- int unused;
+dkcsumattach()
{
struct device *dv;
struct buf *bp;
@@ -169,5 +168,6 @@ dkcsumattach(unused)
DISKUNIT(bp->b_dev), 0); /* XXX RAW_PART later? */
hit->flags |= BDI_PICKED;
}
+ bp->b_flags |= B_INVAL;
brelse(bp);
}