X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/c3fca4549d60b1ffd525188111f5c2946e0228f1..a16d7bdb55e4b2245cd54322eab07024fcfd26c6:/usr/src/sys/vax/stand/boot.c diff --git a/usr/src/sys/vax/stand/boot.c b/usr/src/sys/vax/stand/boot.c index 5f1beaeca7..6daced5b87 100644 --- a/usr/src/sys/vax/stand/boot.c +++ b/usr/src/sys/vax/stand/boot.c @@ -3,16 +3,15 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)boot.c 7.5 (Berkeley) %G% + * @(#)boot.c 7.13 (Berkeley) %G% */ #include "param.h" -#include "inode.h" -#include "fs.h" #include "vm.h" +#include "reboot.h" + #include #include "saio.h" -#include "reboot.h" /* * Boot program... arguments passed in r10 and r11 determine @@ -20,33 +19,32 @@ * boot comes from. */ -#define UNIX "/vmunix" char line[100]; -int retry = 0; extern unsigned opendev; main() { register unsigned howto, devtype; /* howto=r11, devtype=r10 */ - int io, type; + int io = 0, retry, type; #ifdef lint howto = 0; devtype = 0; #endif - printf("\nBoot\n"); #ifdef JUSTASK howto = RB_ASKNAME|RB_SINGLE; #else if ((howto & RB_ASKNAME) == 0) { type = (devtype >> B_TYPESHIFT) & B_TYPEMASK; - if ((unsigned)type < ndevs && devsw[type].dv_name[0]) + if ((unsigned)type < ndevs && devsw[type].dv_name) strcpy(line, UNIX); else howto |= RB_SINGLE|RB_ASKNAME; } #endif - for (;;) { + for (retry = 0;;) { + if (io >= 0) + printf("\nBoot\n"); if (howto & RB_ASKNAME) { printf(": "); gets(line); @@ -58,7 +56,9 @@ main() printf(": %s\n", line); io = open(line, 0); if (io >= 0) { +#ifdef VAX750 loadpcs(); +#endif copyunix(howto, opendev, io); close(io); howto |= RB_SINGLE|RB_ASKNAME; @@ -78,19 +78,17 @@ copyunix(howto, devtype, aio) register int io = aio, i; char *addr; - i = read(io, (char *)&x, sizeof x); - if (i != sizeof x || - (x.a_magic != 0407 && x.a_magic != 0413 && x.a_magic != 0410)) { + if (read(io, (char *)&x, sizeof(x)) != sizeof(x) || N_BADMAG(x)) { printf("Bad format\n"); return; } printf("%d", x.a_text); - if (x.a_magic == 0413 && lseek(io, 0x400, 0) == -1) + if (x.a_magic == ZMAGIC && lseek(io, 0x400, L_SET) == -1) goto shread; if (read(io, (char *)0, x.a_text) != x.a_text) goto shread; addr = (char *)x.a_text; - if (x.a_magic == 0413 || x.a_magic == 0410) + if (x.a_magic == ZMAGIC || x.a_magic == NMAGIC) while ((int)addr & CLOFSET) *addr++ = 0; printf("+%d", x.a_data); @@ -130,6 +128,7 @@ shread: return; } +#ifdef VAX750 /* 750 Patchable Control Store magic */ #include "../vax/mtpr.h" @@ -151,7 +150,6 @@ loadpcs() union cpusid sid; char pcs[100]; char *cp; - char *index(); sid.cpusid = mfpr(SID); if (sid.cpuany.cp_type!=VAX_750 || sid.cpu750.cp_urev<95 || pcsdone) @@ -215,3 +213,4 @@ loadpcs() printf("new rev level=%d\n", sid.cpu750.cp_urev); pcsdone = 1; } +#endif