BSD 4_3 release
[unix-history] / usr / src / sys / mdec / upboot.s
index 26494ae..2bbe1d0 100644 (file)
@@ -1,4 +1,12 @@
-/*     upboot.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.
+ */
+
+/* "@(#)upboot.s       7.1 (Berkeley) 6/5/86" */
+
+       .set    MAJOR,2                 /* major("/dev/up0a") */
 
 /*
  * UP 1st level boot program: loads next 7.5Kbytes from
 
 /*
  * UP 1st level boot program: loads next 7.5Kbytes from
        .set    BOOTSIZE,15             /* size of boot in sectors */
        .set    RELOC,0x50000
        .set    UPBPSECT,512            /* bytes per sector */
        .set    BOOTSIZE,15             /* size of boot in sectors */
        .set    RELOC,0x50000
        .set    UPBPSECT,512            /* bytes per sector */
-       .set    SID,62                  /* system ID register */
 /* UBA registers */
        .set    UBA_CNFGR,0             /* UBA configuration register */
        .set    UBA_CR,4                /* UBA control register offset */
        .set    UBA_MAP,0x800           /* UBA offset to map reg's */
 /* UBA registers */
        .set    UBA_CNFGR,0             /* UBA configuration register */
        .set    UBA_CR,4                /* UBA control register offset */
        .set    UBA_MAP,0x800           /* UBA offset to map reg's */
-       .set    UBAinit,1               /* UBA init bit in UBA control reg */
-       .set    pUBIC,16                /* Unibus init complete */
 /* UP registers and bits */
 /* UP registers and bits */
-       .set    UP,0176700-0160000      /* address of UP controller */
-       .set    UP_cs1,UP+0             /* control and status */
-       .set    UP_wc,UP+2              /* word count */
-       .set    UP_ba,UP+4              /* bus address */
-       .set    UP_da,UP+6              /* disk address */
-       .set    UP_cs2,UP+010           /* cs2 register */
-       .set    UP_of,UP+032            /* offset register */
-       .set    UP_dc,UP+034            /* desired cylinder */
-       .set    UP_hr,UP+036            /* holding register */
+       .set    UP_cs1,0                /* control and status */
+       .set    UP_wc,2                 /* word count */
+       .set    UP_ba,4                 /* bus address */
+       .set    UP_da,6                 /* disk address */
+       .set    UP_cs2,010              /* cs2 register */
+       .set    UP_of,032               /* offset register */
+       .set    UP_dc,034               /* desired cylinder */
+       .set    UP_hr,036               /* holding register */
        .set    UP_GO,1                 /* go bit */
        .set    UP_PACK,022             /* pack acknowledge */
        .set    UP_DCLR,010             /* drive clear */
        .set    UP_GO,1                 /* go bit */
        .set    UP_PACK,022             /* pack acknowledge */
        .set    UP_DCLR,010             /* drive clear */
        .set    UP_FMT22,010000
 
 init:
        .set    UP_FMT22,010000
 
 init:
+/* r9   UBA address */
+/* r8  UP addr */
        .word   0                       /* entry mask for dec monitor */
        nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
        nop;nop;
        .word   0                       /* entry mask for dec monitor */
        nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
        nop;nop;
-/* get cpu type and find the first uba */
-       mfpr    $SID,r0
-       extzv   $24,$8,r0,r0            /* get cpu type */
-       ashl    $2,r0,r1
-       movab   physUBA,r2              /* get physUBA[cpu] */
-       addl2   r1,r2
-       movl    (r2),r9
-       movab   physUMEM,r2             /* get physUMEM[cpu] */
-       addl2   r1,r2
-       movl    (r2),r10
-/* if 780, init uba */
-       cmpl    r0,$1
-       bneq    2f
-       movl    $UBAinit,UBA_CR(r9)
-1:
-       bbc     $pUBIC,UBA_CNFGR(r9),1b
-2:
-       movl    $5000000,r0
-1:
-       sobgtr  r0,1b
-/* init up, set vv in drive 0; if any errors, give up */
-       movw    $UPCS2_CLR,UP_cs2(r10)
-       movw    $UP_DCLR+UP_GO,UP_cs1(r10)
-       movw    $UP_PRESET+UP_GO,UP_cs1(r10)
-       movw    $UP_FMT22,UP_of(r10)
+       movl    $MAJOR,r10              /* major("/dev/xx0a") */
+       extzv   $18,$1,r1,r9            /* get UBA number from R1 */
+       xorb2   $0x01,r9                /* complement bit */
+       insv    r9,$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    physUBA[r9],r9          /* UNIBUS adaptor address */
+       movl    r2,r8                   /* boot device CSR */
+       movl    r3,r7                   /* unit number */
+
+       movl    $RELOC,sp
+       moval   init,r4
+       movc3   $end,(r4),(sp)
+       movl    r9,r1                   /* UNIBUS I/O page address */
+       movl    r8,r2                   /* boot device CSR */
+       movl    r7,r3                   /* unit number */
+/* init up, set vv in drive; if any errors, give up */
+       bisw3   r7,$UPCS2_CLR,UP_cs2(r8)
+       movw    $UP_DCLR+UP_GO,UP_cs1(r8)
+       movw    $UP_PRESET+UP_GO,UP_cs1(r8)
+       movw    $UP_FMT22,UP_of(r8)
 1:
 1:
-       movw    UP_cs1(r10),r0
+       movw    UP_cs1(r8),r0
        bbc     $UP_pRDY,r0,1b
 /* relocate to high core */
 start:
        bbc     $UP_pRDY,r0,1b
 /* relocate to high core */
 start:
@@ -77,18 +82,18 @@ start:
 /* now running relocated */
        .set    PROGSIZE,(BOOTSIZE*UPBPSECT)
 start2:
 /* now running relocated */
        .set    PROGSIZE,(BOOTSIZE*UPBPSECT)
 start2:
-       movw    $0,UP_dc(r10)
-       movw    $1,UP_da(r10)
-       movw    $-PROGSIZE/2,UP_wc(r10)
+       movw    $0,UP_dc(r8)
+       movw    $1,UP_da(r8)
+       movw    $-PROGSIZE/2,UP_wc(r8)
        clrl    r0
 1:
        bisl3   $0x80000000,r0,UBA_MAP(r9)
        addl2   $4,r9
        aobleq  $BOOTSIZE,r0,1b
        clrl    r0
 1:
        bisl3   $0x80000000,r0,UBA_MAP(r9)
        addl2   $4,r9
        aobleq  $BOOTSIZE,r0,1b
-       clrw    UP_ba(r10)
-       movw    $UP_RCOM+UP_GO,UP_cs1(r10)
+       clrw    UP_ba(r8)
+       movw    $UP_RCOM+UP_GO,UP_cs1(r8)
 uprdy:
 uprdy:
-       movw    UP_cs1(r10),r0
+       movw    UP_cs1(r8),r0
        bbc     $UP_pRDY,r0,uprdy
 clear:
        movl    $PROGSIZE,r3
        bbc     $UP_pRDY,r0,uprdy
 clear:
        movl    $PROGSIZE,r3
@@ -96,17 +101,9 @@ clrcor:
        clrq    (r3)
        acbl    $RELOC,$8,r3,clrcor
 /* run loaded program */
        clrq    (r3)
        acbl    $RELOC,$8,r3,clrcor
 /* run loaded program */
-       movl    $2,r10                  /* major("/dev/up0a") */
        calls   $0,*$0
        brw     start2
 physUBA:
        calls   $0,*$0
        brw     start2
 physUBA:
-       .long   0
-       .long   0x20006000      /* 11/780 */
-       .long   0xf30000        /* 11/750 */
-       .long   0xf26000        /* 11/730 */
-physUMEM:
-       .long   0
-       .long   0x2013e000      /* 11/780 */
-       .long   0xffe000        /* 11/750 */
-       .long   0xffe000        /* 11/730 */
+       .long   0xf30000                /* uba0 */
+       .long   0xf32000                /* uba1 */
 end:
 end: