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