delete unneeded header files
[unix-history] / usr / src / sys / vax / stand / boot.c
index 5f1beae..6daced5 100644 (file)
@@ -3,16 +3,15 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * 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 "param.h"
-#include "inode.h"
-#include "fs.h"
 #include "vm.h"
 #include "vm.h"
+#include "reboot.h"
+
 #include <a.out.h>
 #include "saio.h"
 #include <a.out.h>
 #include "saio.h"
-#include "reboot.h"
 
 /*
  * Boot program... arguments passed in r10 and r11 determine
 
 /*
  * Boot program... arguments passed in r10 and r11 determine
  * boot comes from.
  */
 
  * boot comes from.
  */
 
-#define        UNIX    "/vmunix"
 char line[100];
 
 char line[100];
 
-int    retry = 0;
 extern unsigned opendev;
 
 main()
 {
        register unsigned howto, devtype;       /* howto=r11, devtype=r10 */
 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
 
 #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;
 #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
                        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);
                if (howto & RB_ASKNAME) {
                        printf(": ");
                        gets(line);
@@ -58,7 +56,9 @@ main()
                        printf(": %s\n", line);
                io = open(line, 0);
                if (io >= 0) {
                        printf(": %s\n", line);
                io = open(line, 0);
                if (io >= 0) {
+#ifdef VAX750
                        loadpcs();
                        loadpcs();
+#endif
                        copyunix(howto, opendev, io);
                        close(io);
                        howto |= RB_SINGLE|RB_ASKNAME;
                        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;
 
        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);
                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;
                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);
                while ((int)addr & CLOFSET)
                        *addr++ = 0;
        printf("+%d", x.a_data);
@@ -130,6 +128,7 @@ shread:
        return;
 }
 
        return;
 }
 
+#ifdef VAX750
 /* 750 Patchable Control Store magic */
 
 #include "../vax/mtpr.h"
 /* 750 Patchable Control Store magic */
 
 #include "../vax/mtpr.h"
@@ -151,7 +150,6 @@ loadpcs()
        union cpusid sid;
        char pcs[100];
        char *cp;
        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)
 
        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;
 }
        printf("new rev level=%d\n", sid.cpu750.cp_urev);
        pcsdone = 1;
 }
+#endif