Annotation of 42BSD/sys/mdec/rlboot.s, revision 1.1.1.1

1.1       root        1: /*     rlboot.s        6.1     83/07/29        */
                      2: 
                      3: /*
                      4:  * RL02 1st level boot program: loads next 7.5Kbytes from
                      5:  * boot sector of file system and sets it up to run.
                      6:  * Always reads from drive 0.
                      7:  *     UNTESTED
                      8:  */
                      9:        .set    BOOTSIZE,15             /* 15 ``sectors'' */
                     10:         .set    RELOC,0x50000
                     11:         .set    SID,62                 /* system ID register */
                     12: /* UBA registers */
                     13:         .set    UBA_CNFGR,0            /* UBA configuration register */
                     14:         .set    UBA_CR,4               /* UBA control register offset */
                     15:         .set    UBA_MAP,0x800          /* UBA offset to map reg's */
                     16:         .set    UBAinit,1              /* UBA init bit in UBA control reg */
                     17:         .set    pUBIC,16               /* Unibus init complete */
                     18: /* RL11 registers and bits */
                     19:         .set    HL,0174400-0160000     /* address of RL11 */
                     20:         .set    HLBPSECT,512           /* sector size in bytes (kludge) */
                     21:         .set    HL_cs,HL+0             /* control and status */
                     22:         .set    HL_ba,HL+2             /* bus address */
                     23:         .set    HL_da,HL+4             /* disk address */
                     24:         .set    HL_wc,HL+6             /* word count */
                     25:         .set    HL_GO,0                        /* go bit */
                     26:         .set    HL_RCOM,014            /* read command */
                     27:         .set    HL_SEEK,06             /* seek */
                     28:         .set    HL_RESET,013           /* reset drive */
                     29:         .set    HL_GSTAT,04            /* get status command */
                     30:         .set    HL_pRDY,7              /* position of ready bit */
                     31:         .set    HL_pERR,15             /* position of error bit */
                     32: 
                     33: init:
                     34: /* r9   UBA address */
                     35: /* r10  umem addr */
                     36:         .word   0                      /* entry mask for dec monitor */
                     37:         nop;nop;nop;nop;nop;nop;nop;nop        /* some no-ops for 750 boot to skip */
                     38:        nop;nop;
                     39: /* get cpu type and find the first uba */
                     40:         mfpr    $SID,r0
                     41:         extzv   $24,$8,r0,r0           /* get cpu type */
                     42:         ashl    $2,r0,r1
                     43:         movab   physUBA,r2             /* get physUBA[cpu] */
                     44:         addl2   r1,r2
                     45:         movl    (r2),r9
                     46:         movab   physUMEM,r2            /* get physUMEM[cpu] */
                     47:         addl2   r1,r2
                     48:         movl    (r2),r10
                     49: /* if 780, init uba */
                     50:         cmpl    r0,$1
                     51:         bneq    2f
                     52:         movl    $UBAinit,UBA_CR(r9)
                     53: 1:
                     54:         bbc     $pUBIC,UBA_CNFGR(r9),1b
                     55: 2:
                     56: /* init rl11, and drive 0, don't check for any errors now */
                     57:         movw    $HL_RESET,HL_da(r10)
                     58:         movw    $HL_GSTAT+HL_GO,HL_cs(r10)
                     59: /* relocate to high core */
                     60: start:
                     61:         movl    r5,r11                 /* save boot flags */
                     62:         movl    $RELOC,sp
                     63:         moval   init,r6
                     64:         movc3   $end,(r6),(sp)
                     65:         jmp     *$RELOC+start2
                     66: /* now running relocated */
                     67: /* read in the boot program */
                     68:        .set    PROGSIZE,(BOOTSIZE*HLBPSECT)
                     69: start2:
                     70:        movw    $1,HL_da(r10)                   /* seek to cylinder 0 */
                     71:        movw    $HL_SEEK+HL_GO,HL_cs(r10)
                     72: 1:
                     73:         movw    HL_cs(r10),r0
                     74:         bbc     $HL_pRDY,r0,1b
                     75:         bbs     $HL_pERR,r0,hlerr
                     76:        /* Rl has 256 byte sectors */
                     77:        movw    $2,HL_da(r10)                   /* read program */
                     78:        movw    $-PROGSIZE/2,HL_wc(r10)
                     79:        clrl    r0
                     80: 1:
                     81:        bisl3   $0x80000000,r0,UBA_MAP(r9)
                     82:        addl2   $4,r9
                     83:        aobleq  $BOOTSIZE,r0,1b
                     84:        clrw    HL_ba(r10)
                     85:        movw    $HL_RCOM+HL_GO,HL_cs(r10)
                     86: 1:
                     87:         movw    HL_cs(r10),r0
                     88:         bbc     $HL_pRDY,r0,1b
                     89:         bbs     $HL_pERR,r0,hlerr
                     90:        brw     done
                     91: hlerr:
                     92:         halt                           /* ungraceful */
                     93: done:
                     94:         movl    $PROGSIZE,r3
                     95: clrcor:
                     96:         clrq    (r3)
                     97:         acbl    $RELOC,$8,r3,clrcor
                     98: /* run loaded program */
                     99:         movl    $14,r10                        /* major("/dev/hl0a") */
                    100:         calls   $0,*$0
                    101:         brw     start2
                    102: physUBA:
                    103:         .long   0
                    104:         .long   0x20006000             /* 11/780 */
                    105:         .long   0xf30000               /* 11/750 */
                    106:         .long   0xf26000               /* 11/730 */
                    107: physUMEM:
                    108:         .long   0
                    109:         .long   0x2013e000             /* 11/780 */
                    110:         .long   0xffe000               /* 11/750 */
                    111:         .long   0xffe000               /* 11/730 */
                    112: end:

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.