From d4b514f3bfb051444dae360e892e1fe03f4abc54 Mon Sep 17 00:00:00 2001 From: downsj Date: Wed, 5 Feb 1997 11:16:37 +0000 Subject: [PATCH] An 8k kernel may not be loaded at a 4k address, as the ROM supplies. We align it to the the next 8k address, as per our 8k kernels. (This ain't NetBSD, baby.) Fixed with debugging help from niklas. --- sys/arch/hp300/stand/inst.c | 9 ++++++--- sys/arch/hp300/stand/libsa/Makefile | 3 ++- sys/arch/hp300/stand/uboot.c | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/arch/hp300/stand/inst.c b/sys/arch/hp300/stand/inst.c index 4d1b1cfcd02..12be80246a1 100644 --- a/sys/arch/hp300/stand/inst.c +++ b/sys/arch/hp300/stand/inst.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inst.c,v 1.1 1997/01/17 08:36:51 downsj Exp $ */ +/* $OpenBSD: inst.c,v 1.2 1997/02/05 11:16:37 downsj Exp $ */ /* $NetBSD: inst.c,v 1.6 1996/12/21 21:23:43 thorpej Exp $ */ /* @@ -60,6 +60,7 @@ #include #include #include +#include #include #include "stand.h" #include "samachdep.h" @@ -109,7 +110,7 @@ main() printf("\n>> OpenBSD MINIROOT INSTALLATION HP9000/%s CPU\n", getmachineid()); - printf(">> $OpenBSD: inst.c,v 1.1 1997/01/17 08:36:51 downsj Exp $\n"); + printf(">> $OpenBSD: inst.c,v 1.2 1997/02/05 11:16:37 downsj Exp $\n"); gethelp(); for (;;) { @@ -630,7 +631,9 @@ bootmini() howto = RB_SINGLE; /* _Always_ */ printf("booting: %s -s\n", bootname); - exec(bootname, lowram, howto); +#define LOADALIGN(_x) ((u_long)_x + ((u_long)_x % __LDPGSZ)) + exec(bootname, (char *)LOADALIGN(lowram), howto); +#undef LOADALIGN printf("boot: %s\n", strerror(errno)); } diff --git a/sys/arch/hp300/stand/libsa/Makefile b/sys/arch/hp300/stand/libsa/Makefile index 840aeba7566..94be65a1a9f 100644 --- a/sys/arch/hp300/stand/libsa/Makefile +++ b/sys/arch/hp300/stand/libsa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 1997/01/18 03:18:19 downsj Exp $ +# $OpenBSD: Makefile,v 1.5 1997/02/05 11:16:41 downsj Exp $ # $NetBSD: Makefile,v 1.5 1996/06/26 17:44:42 thorpej Exp $ LIB= sa @@ -8,6 +8,7 @@ LIB= sa # Don't need these now... # DEBUGFLAGS=-DNETIF_DEBUG -DRPC_DEBUG -DNFS_DEBUG -DRARP_DEBUG -DNET_DEBUG +# DEBUGFLAGS+=-DEXEC_DEBUG CFLAGS+=-Dhp300 -DSTANDALONE -DCOMPAT_UFS -DNO_LSEEK ${DEBUGFLAGS} CFLAGS+=-I${.CURDIR}/.. diff --git a/sys/arch/hp300/stand/uboot.c b/sys/arch/hp300/stand/uboot.c index 8ccd5982714..0fd3df7b5d9 100644 --- a/sys/arch/hp300/stand/uboot.c +++ b/sys/arch/hp300/stand/uboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uboot.c,v 1.2 1997/02/03 04:48:08 downsj Exp $ */ +/* $OpenBSD: uboot.c,v 1.3 1997/02/05 11:16:38 downsj Exp $ */ /* $NetBSD: uboot.c,v 1.2 1996/10/14 07:33:45 thorpej Exp $ */ /*- @@ -38,6 +38,7 @@ #include #include +#include #include #include "stand.h" #include "samachdep.h" @@ -71,7 +72,7 @@ main() printf("\n>> OpenBSD UNIFIED BOOT HP9000/%s CPU\n", getmachineid()); - printf(">> $OpenBSD: uboot.c,v 1.2 1997/02/03 04:48:08 downsj Exp $\n"); + printf(">> $OpenBSD: uboot.c,v 1.3 1997/02/05 11:16:38 downsj Exp $\n"); printf(">> Enter \"reset\" to reset system.\n"); bdev = B_TYPE(bootdev); @@ -91,7 +92,9 @@ main() } else printf(": %s\n", name); - exec(name, lowram, howto); +#define LOADALIGN(_x) ((u_long)_x + ((u_long)_x % __LDPGSZ)) + exec(name, (char *)LOADALIGN(lowram), howto); +#undef LOADALIGN printf("boot: %s\n", strerror(errno)); } } -- 2.20.1