install copy, drtest, pcs750.bin
[unix-history] / usr / src / sys / vax / stand / bootxx.c
index 6f99c1e..2036427 100644 (file)
@@ -3,7 +3,7 @@
  * 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.
  *
- *     @(#)bootxx.c    6.3 (Berkeley) %G%
+ *     @(#)bootxx.c    6.4 (Berkeley) %G%
  */
 
 #include "../h/param.h"
  */
 
 #include "../h/param.h"
@@ -14,7 +14,7 @@
 #include "saio.h"
 #include "../h/reboot.h"
 
 #include "saio.h"
 #include "../h/reboot.h"
 
-char bootprog[] = "xx(0,0)boot";
+char bootprog[20] = "xx(0,0)boot";
 
 /*
  * Boot program... arguments passed in r10 and r11
 
 /*
  * Boot program... arguments passed in r10 and r11
@@ -23,12 +23,25 @@ char bootprog[] = "xx(0,0)boot";
 
 main()
 {
 
 main()
 {
-       register howto, devtype;        /* howto=r11, devtype=r10 */
-       int io;
+       register unsigned howto, devtype;       /* howto=r11, devtype=r10 */
+       int io, unit, partition;
+       register char *cp;
 
 #ifdef lint
        howto = 0; devtype = 0;
 #endif
 
 #ifdef lint
        howto = 0; devtype = 0;
 #endif
+       unit = (devtype >> B_UNITSHIFT) & B_UNITMASK;
+       unit += 8 * ((devtype >> B_ADAPTORSHIFT) & B_ADAPTORMASK);
+       partition = (devtype >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
+       cp = bootprog + 3;
+       if (unit >= 10)
+               *cp++ = unit / 10 + '0';
+       *cp++ = unit % 10 + '0';
+       *cp++ = ',';
+       if (partition >= 10)
+               *cp++ = partition / 10 + '0';
+       *cp++ = partition % 10 + '0';
+       bcopy((caddr_t) ")boot", cp, 6);
        printf("loading %s\n", bootprog);
        io = open(bootprog, 0);
        if (io >= 0)
        printf("loading %s\n", bootprog);
        io = open(bootprog, 0);
        if (io >= 0)