Annotation of 43BSDReno/sys/mdec/hpboot.s.rom, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1980 Regents of the University of California.
                      3:  * All rights reserved.  The Berkeley software License Agreement
                      4:  * specifies the terms and conditions for redistribution.
                      5:  */
                      6: 
                      7: /* "%W% (Berkeley) %G%" */
                      8: 
                      9: #define PARTITION              /* Partition is in bits 12 to 15 of R5
                     10: 
                     11: /*
                     12:  * RP??/RM?? 1st level boot program: loads next 7.5Kbytes from
                     13:  * boot sector of file system and sets it up to run.
                     14:  * Reads from the controller and drive passed in from the boot
                     15:  * rom.
                     16:  *   R1:  address of the boot devices's adapter
                     17:  *   R2:  controller number of the boot device
                     18:  *   R3:  unit number of the boot device
                     19:  *   R5:  software boot control flags
                     20:  *   R6:  address of driver subroutine from ROM
                     21:  *   SP:  base address of usable memory + 0x200
                     22:  */
                     23:        .set    BOOTLAST,15             /* last boot sector */
                     24:        .set    RPBPSECT,512            /* bytes per sector */
                     25:        .set    RELOC,0x70000
                     26: 
                     27: init:
                     28:        .word   0                       /* entry mask for DEC monitor */
                     29:        nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
                     30:        nop;nop;
                     31: start:
                     32:        clrl    r10                     /* major("/dev/hp0a") */
                     33:        extzv   $13,$2,r1,r4            /* get MBA number from R1 */
                     34:        insv    r4,$24,$8,r10           /* set MBA number */
                     35:        insv    r3,$16,$8,r10           /* drive number */
                     36: #ifdef PARTITION
                     37:        extzv   $12,$4,r5,r4            /* get partition from r5 */
                     38:        bicw2   $0xf000,r5              /* remove from r5 */
                     39:        insv    r4,$8,$4,r10            /* set partition */
                     40: #endif
                     41:        movl    r5,r11                  /* Save software boot control flags */
                     42:        movl    $RELOC,sp
                     43:                                        /* Save register during move */
                     44:        movl    r1,r7                   /* MBA adapter address */
                     45:        movl    r2,r8                   /* controller number */
                     46:        movl    r3,r9                   /* unit number */
                     47:        moval   init,r4
                     48:        movc3   $end,(r4),(sp)
                     49:                                        /* Restore registers */
                     50:        movl    r7,r1                   /* MBA adapter address */
                     51:        movl    r8,r2                   /* controller number */
                     52:        movl    r9,r3                   /* unit number */
                     53:        jmp     *$RELOC+start2
                     54: /* now running relocated */
                     55: /* bring in the boot program */
                     56: start2:                                        /* running relocated */
                     57:        pushr   $0xffff                 /* BEGIN FIREWALL */
                     58:        movl    $1,r4                   /* first boot sector */
                     59:        clrl    r5                      /* transfer address */
                     60:        clrl    -(sp)                   /* transfer address */
                     61: 1:
                     62:        movl    r4,r8                   /* requested sector # */
                     63:        jsb     (r6)                    /* call ROM-based driver */
                     64:        blbs    r0,2f
                     65:        halt                            /* read error */
                     66: 2:
                     67:        addl2   $RPBPSECT,r5            /* bump address */
                     68:        movl    r5,(sp)
                     69:        aobleq  $BOOTLAST,r4,1b
                     70: 
                     71:        .set    PROGSIZE,(BOOTLAST*RPBPSECT)
                     72: done:
                     73:        tstl    (sp)+                   /* pop address */
                     74:        popr    $0xffff                 /* END FIREWALL */
                     75: 
                     76: /* clear core and execute program */
                     77:        movl    $PROGSIZE,r4
                     78: clrcor:
                     79:        clrq    (r4)
                     80:        acbl    $RELOC,$8,r4,clrcor
                     81: /* run loaded program */
                     82:        calls   $0,*$0
                     83:        brw     start2
                     84: 
                     85: end:

unix.superglobalmegacorp.com

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