diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-03-30 19:54:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-03-30 19:54:08 +0000 |
commit | e956ae5efcef0f1c533b6193e9f65ac996832ee0 (patch) | |
tree | 09782ae7c7265a231bf09b5dda3b25a1395c0912 /sys/arch/vax/boot | |
parent | 8ab889efe19d2160b768adfe2b2e818915cfd134 (diff) |
Switch bootloader code to loadfile, and enable a.out and ELF loaders within.
Crank the second stage boot blocks version.
Diffstat (limited to 'sys/arch/vax/boot')
-rw-r--r-- | sys/arch/vax/boot/boot/Makefile | 11 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/boot.c | 32 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/version | 5 |
3 files changed, 16 insertions, 32 deletions
diff --git a/sys/arch/vax/boot/boot/Makefile b/sys/arch/vax/boot/boot/Makefile index 145d023ba81..59bb87a89e6 100644 --- a/sys/arch/vax/boot/boot/Makefile +++ b/sys/arch/vax/boot/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.7 2007/11/25 18:25:33 deraadt Exp $ +# $OpenBSD: Makefile,v 1.8 2008/03/30 19:54:05 miod Exp $ # $NetBSD: Makefile,v 1.27 2002/04/07 07:00:25 matt Exp $ S!= cd ${.CURDIR}/../../../../; pwd @@ -7,7 +7,6 @@ NOMAN= # defined .include <bsd.own.mk> PROG= boot -WARNS?= 1 DEVS= hp.c ctu.c ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c if_ni.c SRCS= srt0.S boot.c devopen.c conf.c autoconf.c netio.c rom.c romread.S \ urem.s udiv.s consio.c consio2.S str.S ${DEVS} findcpu.c @@ -20,9 +19,8 @@ CPPFLAGS+=-DSUPPORT_BOOTPARAMS -DSUPPORT_DHCP -D_STANDALONE \ BINDIR=/usr/mdec -#SA_AS= library -#SAMISCMAKEFLAGS=SA_USE_CREAD=yes SA_INCLUDE_NET=yes SA_USE_LOADFILE=yes SA_ZLIB= yes +USE_LOADFILE= yes SAREL= .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} @@ -43,13 +41,10 @@ machine-links: @rm -f ${MACHINE_ARCH} && ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} .NOPATH: machine ${MACHINE_ARCH} CLEANFILES+= machine ${MACHINE_ARCH} +CPPFLAGS+= -I${.OBJDIR} .endif -#.if ${OBJECT_FMT} == "ELF" -#START=start -#.else START=nisse -#.endif ${PROG}: machine-links ${OBJS} ${LIBSA} ${LIBZ} ${LD} -N -Ttext ${RELOC} -e ${START} -o ${PROG}.sym -Llib/sa -L. ${OBJS} \ diff --git a/sys/arch/vax/boot/boot/boot.c b/sys/arch/vax/boot/boot/boot.c index afc082b5bd3..3ee6054da8f 100644 --- a/sys/arch/vax/boot/boot/boot.c +++ b/sys/arch/vax/boot/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.16 2006/08/30 20:02:13 miod Exp $ */ +/* $OpenBSD: boot.c,v 1.17 2008/03/30 19:54:05 miod Exp $ */ /* $NetBSD: boot.c,v 1.18 2002/05/31 15:58:26 ragge Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. @@ -33,11 +33,10 @@ #include <sys/param.h> #include <sys/reboot.h> -#include "lib/libsa/stand.h" -#ifdef notyet -#include "lib/libsa/loadfile.h" -#include "lib/libkern/libkern.h" -#endif + +#include <lib/libkern/libkern.h> +#include <lib/libsa/stand.h> +#include <lib/libsa/loadfile.h> #define V750UCODE(x) ((x>>8)&255) @@ -88,9 +87,7 @@ Xmain(void) int io; int j, nu; char transition = '\010'; -#ifdef noyet u_long marks[MARK_MAX]; -#endif io = 0; skip = 1; @@ -111,7 +108,7 @@ Xmain(void) transition = ' '; askname = bootrpb.rpb_bootr5 & RB_ASKNAME; - printf("\n\r>> OpenBSD/vax boot [%s] [%s] <<\n", "1.12", __DATE__); + printf("\n\r>> OpenBSD/vax boot [%s] [%s] <<\n", "1.13", __DATE__); printf(">> Press enter to autoboot now, or any other key to abort: "); sluttid = getsecs() + 5; senast = 0; @@ -141,13 +138,10 @@ Xmain(void) /* First try to autoboot */ if (askname == 0) { -#ifdef notyet int err; -#endif + errno = 0; printf("> boot bsd\n"); - exec("bsd", 0, 0); -#ifdef notyet marks[MARK_START] = 0; err = loadfile("bsd", marks, LOAD_KERNEL|COUNT_KERNEL); @@ -158,7 +152,6 @@ Xmain(void) (void *)marks[MARK_SYM], (void *)marks[MARK_END]); } -#endif printf("bsd: boot failed: %s\n", strerror(errno)); } @@ -203,9 +196,7 @@ boot(char *arg) { char *fn = "bsd"; int howto, fl, err; -#ifdef notyet u_long marks[MARK_MAX]; -#endif if (arg) { while (*arg == ' ') @@ -242,18 +233,15 @@ fail: printf("usage: boot [filename] [-acsd]\n"); bootrpb.rpb_bootr5 = howto; } load: - exec(fn, 0, 0); -#ifdef notyet marks[MARK_START] = 0; err = loadfile(fn, marks, LOAD_KERNEL|COUNT_KERNEL); if (err == 0) { machdep_start((char *)marks[MARK_ENTRY], - marks[MARK_NSYM], + marks[MARK_NSYM], (void *)marks[MARK_START], - (void *)marks[MARK_SYM], - (void *)marks[MARK_END]); + (void *)marks[MARK_SYM], + (void *)marks[MARK_END]); } -#endif printf("Boot failed: %s\n", strerror(errno)); } diff --git a/sys/arch/vax/boot/boot/version b/sys/arch/vax/boot/boot/version index 443b36fcdcd..8aaeca812aa 100644 --- a/sys/arch/vax/boot/boot/version +++ b/sys/arch/vax/boot/boot/version @@ -1,4 +1,4 @@ -$OpenBSD: version,v 1.4 2007/04/10 17:47:55 miod Exp $ +$OpenBSD: version,v 1.5 2008/03/30 19:54:05 miod Exp $ $NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this @@ -25,7 +25,7 @@ is taken as the current. address if possible. Cleanup use of u_int/size_t. 1.8: Switch to loadfile instead of exec. Now we can load a.out or ELF - kernels. + kernels. (disabled in OpenBSD) 1.9: Support verbose/quiet boot. 1.10: Remove the 11/750 pcs code and the list of kernels to try to boot in order. @@ -33,3 +33,4 @@ is taken as the current. to behave as expected. 1.11: Better VXT2000{,+} support. 1.12: Glass console support on VXT2000{,+}. +1.13: Enable the loadfile code added in revision 1.8. |