BSD 4_3 release
[unix-history] / usr / src / sys / mdec / raboot.s
index e536353..de6a1ab 100644 (file)
@@ -1,8 +1,18 @@
-/*     raboot.s        6.1     83/07/29        */
+/*
+ * Copyright (c) 1980,1986 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+/* "@(#)raboot.s       7.1 (Berkeley) 6/5/86" */
+
+       .set    MAJOR,9                 /* major("/dev/ra0a") */
 
 /*
 
 /*
- * UDA50 1st level boot program: loads next 7.5Kbytes from
+ * 1st level boot program: loads next 7.5Kbytes from
  * boot sector of file system and sets it up to run.
  * boot sector of file system and sets it up to run.
+ * Except for MAJOR definition above, should work
+ * with any disk using 750 boot rom.
  */
        .set    RELOC,0x50000
        .set    BOOTLAST,15             /* last boot sector */
  */
        .set    RELOC,0x50000
        .set    BOOTLAST,15             /* last boot sector */
@@ -13,16 +23,24 @@ init:
        nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
        nop;nop;
 start:
        nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
        nop;nop;
 start:
-       movl    r1,r7                   /* UNIBUS I/O page address */
-       movl    r2,r8                   /* boot device CSR */
-       movl    r3,r9                   /* unit number */
+       movl    $MAJOR,r10              /* major("/dev/xx0a") */
+       extzv   $18,$1,r1,r4            /* get UBA number from R1 */
+       xorb2   $0x01,r4                /* complement bit */
+       insv    r4,$24,$8,r10           /* set UBA number */
+       insv    r3,$16,$8,r10           /* drive number */
+       extzv   $12,$4,r5,r4            /* get partition from r5 */
+       bicw2   $0xf000,r5              /* remove from r5 */
+       insv    r4,$8,$8,r10            /* set partition */
        movl    r5,r11                  /* boot flags */
        movl    r5,r11                  /* boot flags */
+       movl    r1,r9                   /* UNIBUS I/O page address */
+       movl    r2,r8                   /* boot device CSR */
+       movl    r3,r7                   /* unit number */
        movl    $RELOC,sp
        movl    $RELOC,sp
-       moval   init,r10
-       movc3   $end,(r10),(sp)
-       movl    r7,r1                   /* UNIBUS I/O page address */
+       moval   init,r4
+       movc3   $end,(r4),(sp)
+       movl    r9,r1                   /* UNIBUS I/O page address */
        movl    r8,r2                   /* boot device CSR */
        movl    r8,r2                   /* boot device CSR */
-       movl    r9,r3                   /* unit number */
+       movl    r7,r3                   /* unit number */
        jmp     *$RELOC+start2
 /* now running relocated */
 /* bring in the boot program */
        jmp     *$RELOC+start2
 /* now running relocated */
 /* bring in the boot program */
@@ -41,16 +59,15 @@ start2:                                     /* running relocated */
        movl    r5,(sp)
        aobleq  $BOOTLAST,r4,1b
 
        movl    r5,(sp)
        aobleq  $BOOTLAST,r4,1b
 
-       .set    PROGSIZE,((BOOTLAST-1)*RABPSECT)
+       .set    PROGSIZE,(BOOTLAST*RABPSECT)
 done:
        tstl    (sp)+                   /* pop address */
        popr    $0xffff                 /* END FIREWALL */
 done:
        tstl    (sp)+                   /* pop address */
        popr    $0xffff                 /* END FIREWALL */
-       movl    $PROGSIZE,r3
+       movl    $PROGSIZE,r4
 clrcor:
 clrcor:
-       clrq    (r3)
-       acbl    $RELOC,$8,r3,clrcor
+       clrq    (r4)
+       acbl    $RELOC,$8,r4,clrcor
 /* start loaded program */
 /* start loaded program */
-       movl    $9,r10                  /* major("/dev/ra0a") */
        calls   $0,*$0
        brw     start2
 end:
        calls   $0,*$0
        brw     start2
 end: