From aeaefd37278e54710bbb0455a5a97801ea25de89 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Fri, 9 Jan 1998 12:14:43 +0000 Subject: Make booting new kernels with old bootblocks moer robust --- sys/arch/i386/i386/bios.c | 3 +-- sys/arch/i386/i386/machdep.c | 13 +++++-------- sys/arch/i386/include/biosvar.h | 4 +++- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'sys/arch/i386') 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 #include #include +#include #include #include @@ -98,11 +99,6 @@ #include #include -#include "bios.h" -#if NBIOS > 0 -#include -#endif - #include "apm.h" #if NAPM > 0 #include @@ -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 */ -- cgit v1.2.3