|
|
1.1 ! root 1: /* ! 2: * @(#)bootxx.c 1.1 86/02/03 Copyright (c) 1985 by Sun Microsystems, Inc. ! 3: */ ! 4: ! 5: #include "saio.h" ! 6: #include <a.out.h> ! 7: #include "../h/vm.h" ! 8: #include "../h/reboot.h" ! 9: #include "../mon/sunromvec.h" ! 10: ! 11: int (*readfile()) (); ! 12: ! 13: /* ! 14: * Reads in the "real" boot program and jumps ! 15: * to it. If this attempt fails, prints "boot failed" and returns to its ! 16: * caller. ! 17: */ ! 18: main() ! 19: { ! 20: register struct bootparam *bp; ! 21: register char *s, c; ! 22: register int io; ! 23: int (*addr)(); ! 24: ! 25: extern struct boottab *(devsw[]); ! 26: ! 27: if (romp->v_bootparam == 0) ! 28: bp = (struct bootparam *)0x2000; /* Old Sun-1 address */ ! 29: else ! 30: bp = *(romp->v_bootparam); /* S-2: via romvec */ ! 31: ! 32: /* If we were linked with a driver, use it in preference to PROM */ ! 33: if (*devsw) ! 34: bp->bp_boottab = *devsw; ! 35: ! 36: s = bp->bp_argv[0]; ! 37: while (*s && *s != ')') s++; ! 38: ! 39: c = *s; *s = '\0'; ! 40: printf("Load: %s)boot\n", bp->bp_argv[0]); ! 41: *s = c; ! 42: ! 43: io = physopen(bp, "boot", 0); ! 44: ! 45: if (io >= 0) { ! 46: addr = readfile(io, 0); /* Read silently */ ! 47: if ((int)addr != -1) ! 48: _exitto(addr); ! 49: } ! 50: printf("boot failed\n"); ! 51: return; ! 52: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.