delete unneeded header files
[unix-history] / usr / src / sys / vax / stand / boot.c
index e32fd22..6daced5 100644 (file)
@@ -3,12 +3,10 @@
  * 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.6 (Berkeley) %G%
+ *     @(#)boot.c      7.13 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
-#include "inode.h"
-#include "fs.h"
 #include "vm.h"
 #include "reboot.h"
 
 #include "vm.h"
 #include "reboot.h"
 
  * 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
 #ifdef JUSTASK
        howto = RB_ASKNAME|RB_SINGLE;
 #else
@@ -47,7 +42,9 @@ main()
                        howto |= RB_SINGLE|RB_ASKNAME;
        }
 #endif
                        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);
@@ -81,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);