on uba reset remap already allocated pages
[unix-history] / usr / src / sys / vax / stand / boot.c
index 0b362c5..a287bf1 100644 (file)
@@ -1,14 +1,12 @@
-/*     boot.c  4.3     81/03/16        */
+/*     boot.c  4.7     82/03/07        */
 
 #include "../h/param.h"
 
 #include "../h/param.h"
-#include "../h/ino.h"
 #include "../h/inode.h"
 #include "../h/inode.h"
-#include "../h/filsys.h"
-#include "../h/dir.h"
+#include "../h/fs.h"
 #include "../h/vm.h"
 #include <a.out.h>
 #include "saio.h"
 #include "../h/vm.h"
 #include <a.out.h>
 #include "saio.h"
-#include <sys/reboot.h>
+#include "../h/reboot.h"
 
 /*
  * Boot program... arguments passed in r10 and r11 determine
 
 /*
  * Boot program... arguments passed in r10 and r11 determine
@@ -22,14 +20,23 @@ char        devname[][2] = {
        0,0,            /* 1 = ht */
        'u','p',        /* 2 = up */
        'h','k',        /* 3 = hk */
        0,0,            /* 1 = ht */
        'u','p',        /* 2 = up */
        'h','k',        /* 3 = hk */
+       0,0,            /* 4 = sw */
+       0,0,            /* 5 = tm */
+       0,0,            /* 6 = ts */
+       0,0,            /* 7 = mt */
+       0,0,            /* 8 = tu */
+       'r','a',        /* 9 = ra */
+       'u', 't',       /* 10 = ut */
 };
 
 char line[100] = "xx(0,0)vmunix";
 
 };
 
 char line[100] = "xx(0,0)vmunix";
 
+int    retry = 0;
+
 main()
 {
        register howto, devtype;        /* howto=r11, devtype=r10 */
 main()
 {
        register howto, devtype;        /* howto=r11, devtype=r10 */
-       int io, retry;
+       int io;
 
 #ifdef lint
        howto = 0; devtype = 0;
 
 #ifdef lint
        howto = 0; devtype = 0;
@@ -47,7 +54,6 @@ main()
                        howto = RB_SINGLE|RB_ASKNAME;
        }
 #endif
                        howto = RB_SINGLE|RB_ASKNAME;
        }
 #endif
-       retry = 0;
        for (;;) {
                if (howto & RB_ASKNAME) {
                        printf(": ");
        for (;;) {
                if (howto & RB_ASKNAME) {
                        printf(": ");
@@ -56,28 +62,34 @@ main()
                        printf(": %s\n", line);
                io = open(line, 0);
                if (io >= 0)
                        printf(": %s\n", line);
                io = open(line, 0);
                if (io >= 0)
-                       copyunix(io);
+                       copyunix(howto, io);
                if (++retry > 2)
                        howto = RB_SINGLE|RB_ASKNAME;
        }
 }
 
                if (++retry > 2)
                        howto = RB_SINGLE|RB_ASKNAME;
        }
 }
 
-copyunix(io)
-       register io;
+/*ARGSUSED*/
+copyunix(howto, io)
+       register howto, io;
 {
        struct exec x;
        register int i;
        char *addr;
 
        i = read(io, (char *)&x, sizeof x);
 {
        struct exec x;
        register int i;
        char *addr;
 
        i = read(io, (char *)&x, sizeof x);
-       if (i != sizeof x || x.a_magic != 0410)
+       if (i != sizeof x ||
+           (x.a_magic != 0407 && x.a_magic != 0413 && x.a_magic != 0410))
                _stop("Bad format\n");
        printf("%d", x.a_text);
                _stop("Bad format\n");
        printf("%d", x.a_text);
+       if ((x.a_magic == 0413 || x.a_magic == 0410) &&
+           lseek(io, 0x400, 0) == -1)
+               goto shread;
        if (read(io, (char *)0, x.a_text) != x.a_text)
                goto shread;
        addr = (char *)x.a_text;
        if (read(io, (char *)0, x.a_text) != x.a_text)
                goto shread;
        addr = (char *)x.a_text;
-       while ((int)addr & CLOFSET)
-               *addr++ = 0;
+       if (x.a_magic == 0413 || x.a_magic == 0410)
+               while ((int)addr & CLOFSET)
+                       *addr++ = 0;
        printf("+%d", x.a_data);
        if (read(io, addr, x.a_data) != x.a_data)
                goto shread;
        printf("+%d", x.a_data);
        if (read(io, addr, x.a_data) != x.a_data)
                goto shread;