Annotation of researchv10no/sys/ml/start.s, revision 1.1

1.1     ! root        1: #
        !             2: # initialization
        !             3: #
        !             4: # ipl 0x1f; mapen 0
        !             5: # nothing much set up
        !             6: #
        !             7: 
        !             8:        .data
        !             9:        .globl  eintstack
        !            10: intstack:
        !            11:        .space  NISP*NBPG
        !            12: eintstack:
        !            13: 
        !            14:        .text
        !            15: 
        !            16:        .globl  start
        !            17: start:
        !            18:        .word   0
        !            19:        movl    r11,bootflags   # save boot flags; wrong, should be r5
        !            20:        mtpr    $0,$ICCS        # stop the clock
        !            21:        subl3   $KA,$scb,r0     # init system control block
        !            22:        mtpr    r0,$SCBB
        !            23:        moval   *$eintstack,sp  # absolute addr so kernel bit is set
        !            24: #
        !            25: # miscellaneous hacks:
        !            26: # fix up rpb, esp checksum
        !            27: # silly speed hacks
        !            28: #
        !            29:        movab   _rpb,r0
        !            30:        bbcc    $31,4(r0),0f    # make restart addr physical (sigh)
        !            31:        movl    4(r0),r1
        !            32: 0:     movl    $0x1f,r2
        !            33:        clrl    r3
        !            34: 1:     addl2   (r1)+,r3
        !            35:        sobgtr  r2,1b
        !            36:        movl    r3,8(r0)
        !            37:        clrl    12(r0)          # so a restart can happen
        !            38:        bisw2   $0x0fff,_trap           # speed hack, known in trap
        !            39:        bisw2   $0x0fff,_syscall        # speed hack, known in syscall
        !            40: #
        !            41: # clear bss
        !            42: #
        !            43:        movab   _edata,r1
        !            44:        movab   _end,r2
        !            45: 1:     clrq    (r1)+
        !            46:        cmpl    r1,r2
        !            47:        blss    1b
        !            48: #
        !            49: # count up memory into r0
        !            50: #
        !            51:        movab   9f,_nofault
        !            52:        clrl    r0
        !            53: 1:     tstl    (r0)
        !            54:        acbl    $MAXPHMEM-1,$64*1024,r0,1b
        !            55: 9:     clrl    _nofault
        !            56: #
        !            57: # write the system page table, set SBR and SLR
        !            58: #
        !            59:        pushl   r0
        !            60:        calls   $1,_machmem     # some vaxes have ideas about top of mem
        !            61:        pushl   r0
        !            62:        calls   $1,_mmapinit
        !            63: #
        !            64: # hand-craft the bare bones of proc[0]
        !            65: # set up page table, initial pcb, allocate user block
        !            66: #
        !            67:        pushab  *$1f            # first kernel pc; abs addr so kernel bit set
        !            68:        calls   $1,_uctinit
        !            69: #
        !            70: # turn on memory mapping
        !            71: # P0BR dance gives us time to change the pc
        !            72: #
        !            73:        mtpr    _Sysmap,$P0BR
        !            74:        mfpr    $SLR,r0
        !            75:        mtpr    r0,$P0LR
        !            76:        mtpr    $0,$TBIA
        !            77:        mtpr    $1,$MAPEN
        !            78:        jmp     *$0f; 0:        # load kernel address into pc
        !            79: #
        !            80: # use the pcb: go to kernel mode, kernel stack
        !            81: #
        !            82:        ldpctx
        !            83:        rei
        !            84: 1:
        !            85: #
        !            86: # any other hardware-dependent initialization
        !            87: #
        !            88:        calls   $0,_machinit
        !            89: #
        !            90: # start unix
        !            91: #
        !            92:        calls   $0,_main
        !            93: #
        !            94: # return here as process 1: run icode
        !            95: #
        !            96:        pushl   $0x03c00000     # mode (user,user)
        !            97:        pushl   $0              # pc 0
        !            98:        rei

unix.superglobalmegacorp.com

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