📄 vaxstart.c
字号:
#define BISPACE (1024*1024)/2 ashl $9,r9,*$MEMSIZEADDR # convert from pages /* * check if >511.5Mb of memory present. If yes, back off to 511.5Mb to * prevent trashing of common data. */ cmpl INFO_MEMSIZ(r8),$MAXMEMSIZE-BISPACE blssu 1f # is mem size less than or eq to 511.5? movl $MAXMEMSIZE-BISPACE,INFO_MEMSIZ(r8) # reload total memory movl $MAXMEMSIZE-BISPACE,*$MEMSIZEADDR # ditto. /* * set the info stack pointer (isp) to the top of memory. */1: movl INFO_MEMSIZ(r8),isp # set isp to the top of memory /* * save the BOOT DRIVER */ pushl RPB$L_IOVEC(r11) # push the address of the boot driver pushl RPB$L_IOVECSZ(r11) # push its size calls $2,move_info # move it movl r0,INFO_BTDRBAS(r8) # save its address movl RPB$L_IOVECSZ(r11),INFO_BTDRSIZ(r8) # save its size /* * save the RPB */ pushl r11 # push the address of the RPB pushl $RPBSIZ # push its size calls $2,move_info # move it movl r0,INFO_RPBBAS(r8) # save its address movl $RPBSIZ,INFO_RPBSIZ(r8) # save its size movl INFO_RPBBAS(r8),r11 # point to the moved RPB movl INFO_BTDRBAS(r8),RPB$L_IOVEC(r11) # reset new RPB$L_IOVEC /* * Save the Arg list */ movl 12(ap),r9 # get the address passed mull3 $4,(r9),r10 # make arg count a bytecount addl3 $4,r10,r10 # Add 4 to include arg count itself pushl r9 # push address of VMB ARGLIST pushl r10 # push its size calls $2,move_info # move it movl r0,INFO_VMBARGBAS(r8) # save its address movl r0,r9 # update r9 as a pointer to the # new location movl r10,INFO_VMBARGSIZ(r8) # save its size /* * save VMB's version number */ movl RPB$L_IOVEC(r11),r10 # point to the boot driver movzwl BQO$W_VERSION(r10),INFO_VMBVERS(r8) # save VMB's version number /* * When booting a CI, a system page table is built after the * end of the ucode, so space must be reserved. */ cmpb $BTD$K_HSCCI,RPB$B_DEVTYP(r11) # are we booting a CI/HSC? beql 1f # if so, allow for SPT cmpb $BTD$K_BVPSSP,RPB$B_DEVTYP(r11) # are we booting an AIO? beql 1f # if so, allow for SPT cmpb $BTD$K_AIE_TK50,RPB$B_DEVTYP(r11) # are we booting an AIE/TK50? beql 1f # if so, allow for SPT brb 2f # if neither, then skip ahead1: mull3 $4,VMB$L_HI_PFN(r9),r0 # How many bytes subl2 r0,isp # adjust the info stack pointer movl isp,VMB$L_BVP_PGTBL(r9) # BVP init routines look here2: /* * Save the ucode - check the VMBARG List */ tstl VMB$Q_UCODE+4(r9) # is there any ucode? beql 3f # if not, skip ahead pushl VMB$Q_UCODE+4(r9) # push its address pushl VMB$Q_UCODE(r9) # push its size calls $2,move_info # move it movl r0,INFO_CIUCODBAS(r8) # save its address movl VMB$Q_UCODE(r9),INFO_CIUCODSIZ(r8) # save its size movl r0,BQO$L_UCODE(r10) # update the driver ucode pointer movl INFO_VMBARGBAS(r8),r9 # get the new address of the arg list movl r0,VMB$Q_UCODE+4(r9) # point the vmbarglst at the ucode3: /* * The vmb information list is built, now move it in front of * all the stuff saved. */ clrl -(sp) # request 1k align (by passing 3 args) pushal tmpinfo # push the address pushl $INFO_SIZE # push its size calls $3,move_info # move it movl r0,_vmbinfo # save address in the global location pushl $vmb_continue # push the restart address calls $1,_reloc # relocate to higher memoryvmb_continue: /* * Re-INIT the boot driver after moving it */ cmpb $BTD$K_KA640_NI,RPB$B_DEVTYP(r11) # is this is a VAXstar NI? bneq 1f # if not, continue, otherwise calls $0,_disconnect # disconnect the boot driver blbc r0,2f # I would hope not.1: calls $0,_drvinit # reinit the boot driver blbc r0,2f # go halt on error calls $0,_main # startup is done, call the # main routine2: halt # We should never return .datatmpinfo: # used to build vmb info list .space INFO_SIZE # a tmp work area needted to # build the vmbinfo list before # saving it too./* * Functional Discription: * This routine builds a stack of information to be passed * through to the kernel. The stack is built at the top of * the contiguous portion of main memory. * * The final call to move_info must force alignment on a 1k * boundary for consistency with kernel cmap structuring. * Intermediate calls need only force page alignment. * * Inputs: * 4(ap) = size to be saved * 8(ap) = starting address of info to be saved * [12(ap)] optional, forces 1k boundary alignment * * Outputs: * address where information was stored * */ .textmove_info: .word 0x1e # save r1 - r5 subl2 4(ap),isp # move the info stack down as needed movzwl $0x1ff,r0 # assume page alignment cmpb $3,(ap) # third arg present, 1k align requested bneq 1f # if not, skip ahead movzwl $0x3ff,r0 # 1k alignment requested1: bicl2 r0,isp # align accordingly movc3 4(ap),*8(ap),*isp # move information movl isp,r0 # address it was moved to ret # return .dataisp: # information stack pointer .long 0/* * Functional Discription: * This routine is called when ROM_BOOT is active and after * VMB.EXE has beed loaded. It restores the registers at boot * time. Bit 3 and Bit 16 get set R5 to force bootblock mode boot by * VMB and to tell VMB not to drop out pages with CRD's. * Assumes good memory was found. * * Inputs: * none * * Outputs: * none * */ .text .globl _start_vmb_start_vmb: .word 0 # don't care at this point movl _ROM_r0,r0 # restore R0 for VMB movl _ROM_r1,r1 # restore R1 for VMB movl _ROM_r2,r2 # restore R2 for VMB bicl2 $0xfffc0000,r2 # Reduce 32-bit CSR to 18-bit # CSR that VMB expects movl _ROM_r3,r3 # restore R3 for VMB movl _ROM_r7,r7 # needed for calypso. this # restore the CCA addr into r7. clrl r4 # force bootblock 0 movl _ROM_r5,r5 # restore R5 for VMB bisl2 $0x10008,r5 # set bootblock mode bit 3 for VMB # and don't discard CRD pages movl $0x200,sp # restore sp for VMB jmp *$0x200 # startup VMB halt # can't get here
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -