summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1998-01-09 12:14:43 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1998-01-09 12:14:43 +0000
commitaeaefd37278e54710bbb0455a5a97801ea25de89 (patch)
tree404a2bf3749b8e25fec01a3ee5eb3b06f6e75b53
parent8d9f7c516df2437b9807a8470ff2c4e15058a38f (diff)
Make booting new kernels with old bootblocks moer robust
-rw-r--r--sys/arch/i386/i386/bios.c3
-rw-r--r--sys/arch/i386/i386/machdep.c13
-rw-r--r--sys/arch/i386/include/biosvar.h4
3 files changed, 9 insertions, 11 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index c14d38ce15d..1f5ab2ced8f 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.20 1997/11/10 16:09:55 flipk Exp $ */
+/* $OpenBSD: bios.c,v 1.21 1998/01/09 12:14:42 niklas Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -79,7 +79,6 @@ struct cfdriver bios_cd = {
NULL, "bios", DV_DULL
};
-extern u_int bootapiver; /* locore.s */
extern dev_t bootdev;
bios_diskinfo_t *bios_diskinfo = NULL;
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index fc6c7386422..bb5ff1d11a9 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.70 1998/01/04 11:34:49 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.71 1998/01/09 12:14:41 niklas Exp $ */
/* $NetBSD: machdep.c,v 1.202 1996/05/18 15:54:59 christos Exp $ */
/*-
@@ -90,6 +90,7 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/specialreg.h>
+#include <machine/biosvar.h>
#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>
@@ -98,11 +99,6 @@
#include <i386/isa/isa_machdep.h>
#include <i386/isa/nvram.h>
-#include "bios.h"
-#if NBIOS > 0
-#include <machine/biosvar.h>
-#endif
-
#include "apm.h"
#if NAPM > 0
#include <machine/apmvar.h>
@@ -235,7 +231,7 @@ cpu_startup()
msgbufmapped = 1;
/* Boot arguments are in page 1 */
- if (bootargv != NULL) {
+ if (bootapiver >= BOOT_APIVER) {
pa = NBPG;
for (i = 0; i < btoc(bootargc); i++, pa += NBPG)
pmap_enter(pmap_kernel(),
@@ -1528,7 +1524,8 @@ init386(first_avail)
* BIOS leaves data in low memory and VM system doesn't work with
* phys 0, /boot leaves arguments at page 1.
*/
- avail_next = avail_start = NBPG + i386_round_page(bootargc);
+ avail_next = avail_start =
+ bootapiver >= BOOT_APIVER ? NBPG + i386_round_page(bootargc) : NBPG;
avail_end = extmem ? IOM_END + extmem * 1024
: cnvmem * 1024; /* just temporary use */
diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h
index 36c13579010..c737c55d4fd 100644
--- a/sys/arch/i386/include/biosvar.h
+++ b/sys/arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosvar.h,v 1.25 1997/10/27 07:44:20 niklas Exp $ */
+/* $OpenBSD: biosvar.h,v 1.26 1998/01/09 12:14:40 niklas Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -179,6 +179,8 @@ void bioscnputc __P((dev_t, int));
int bioscngetc __P((dev_t));
void bioscnpollc __P((dev_t, int));
+extern u_int bootapiver;
+
#endif /* _KERNEL */
#endif /* _LOCORE */
#endif /* _KERNEL || _STANDALONE */