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/stand/boot/boot.c | |
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/stand/boot/boot.c')
-rw-r--r-- | sys/arch/vax/stand/boot/boot.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/sys/arch/vax/stand/boot/boot.c b/sys/arch/vax/stand/boot/boot.c index afc082b5bd3..3ee6054da8f 100644 --- a/sys/arch/vax/stand/boot/boot.c +++ b/sys/arch/vax/stand/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)); } |