📄 vaxstart.c
字号:
/* * vaxstart.c *//* * @(#)vaxstart.c 4.2 (ULTRIX) 1/31/91 *//************************************************************************ * * * Copyright (c) 1985 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * This software is derived from software received from the * * University of California, Berkeley, and from Bell * * Laboratories. Use, duplication, or disclosure is subject to * * restrictions under license agreements with University of * * California and with AT&T. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************/ /* * Revision History: * * 31-Jan-91 jas * VAX6000 wouldn't install from tk50 if 512Mb of memory present. * To fix, back of pointer to 511.5Mb if more than 511.5Mb present * (if more, then 512Mb.) */#include "../../machine/vax/mtpr.h"#define LOCORE#include "vmb.h" .globl _end .globl _edata .globl _entry/* * Functional Discription: * This is the entry point for the boot and loader paths. It is * called is called from the bootblock, except for a network boot. * * STANDARD BOOT PATH, * * The bootblock calls _entry with: * * Inputs: * 4(ap) = mode of boot, VMB_BOOT, ROM_BOOT, TK50_BOOT * * The next two args only if VMB mode boot: * 8(ap) = Address of VMB's RPB * 12(ap) = Address of VMB's argument list * * NETWORK BOOT PATH, * * VMB jumps directly to _entry with: * * Inputs: * ap = VMB argument list * R11 = RPB * * The inputs are pushed out onto the stack with _mode * and a call frame built before preoceding normally with * a VMB style boot. This replaces the normal function * of the bootblock. * * Outputs: * none * */_entry: brw net_entry # entry mask for normal boot path halt # filler /* * entry point when called from a bootblock * MUST BE POSITIONED 4 BYTES FROM _entry */entry_bblk: .word 0 # entry mask mtpr $HIGH,$IPL # just in case movl 4(ap),_mode # save the boot mode bitl $ROM_BOOT,_mode # were we booted via system ROMs bneq rom_mode # if so, proceed with ROM mode boot brw vmb_mode # handle a VMB mode bootnet_entry: mtpr $HIGH,$IPL # just in case /* * The following few instructions emulate the function normally * done by a boot block. They place the information on the * stack required to make the rest of the startup code operate * consistently. A stack frame is established as if this * routine were calls'ed. When booting the network, VMB jumps * in to this module, where as it is normally called from the * bootblock code. */ pushl ap # Push the VMBARG list out pushl r11 # Push the RPB address xorl2 $VMB_BOOT,_mode # Booting using VMB xorl2 $NET_BOOT,_mode # Booting via the network pushl _mode # Push the mode out, too pushl $3 # set up the arg count movl sp,ap # plug in the arg count /* * Proceed normally now. */ movl 4(ap),_mode # save the boot mode brw vmb_mode # handle a VMB mode boot/* * Branch here when booted via 750/8200 style boot ROMs. Save the contents * of the GPR's as given to the bootblock. They will eventually be * passed on to VMB.EXE. */rom_mode: /* * Save original ROM input parameters */ movl 8(ap),_SAVE_fp # pushed on by bootblk. This # is need by calypso rom. movl r0,_ROM_r0 # Save R0 for VMB movl r1,_ROM_r1 # Save R1 for VMB movl r2,_ROM_r2 # Save R2 for VMB movl r3,_ROM_r3 # Save R3 for VMB movl r4,_ROM_r4 # Save R4 for VMB movl r5,_ROM_r5 # Save R5 for VMB movl r6,_ROM_r6 # Save R6 for VMB movl r7,_ROM_r7 # Save R7 for VMB. This contains # the CCA address for calypso. movl sp,_ROM_sp # Save SP for VMB addl2 $8,_ROM_sp # Adjust to original for VMB /* * Because of a bug in the 750 ROM UDA driver. It is necessary * to point to a page aligned 512 byte buffer. The driver can'T * do unaligned transfers. The ROM driver also cannot deal with * relocaion above 256K. This buffer is alway the transfer * address for all I/O by ROM drivers. Data is then copied back * to the desired and presumeably unaligned buffer. The buffer * is set at location 0 which will be safe for loading VMB a * block at a time. */ clrl _ROM_buffer # set ROM read buffer address calls $0,_setup # now, go do some setup /* * Go relocate to higher memory */ pushl $rom_continue # push the restart address calls $1,_reloc # relocate to higher memoryrom_continue: calls $0,_main # call the main program/* * Branch here when booted via VMB.EXE. Much initialization occurs here. * Information is save at the top of memory on an information stack. * A vmbinfo list is build which is passed through to main and * eventually to the kernel. */vmb_mode: calls $0,_setup # first, go do some setup movl 8(ap),r11 # get the address of the RPB clrb RPB$T_FILE(r11) # clear the file name byte count # so the DIAG SUPER knows it's Ultrix moval tmpinfo,r8 # initialize pointer /* * Size memory */ movl 12(ap),r9 # get VMB's arg list cmpw $VMB$Q_PFNMAP/4,VMB$L_ARGBYTCNT(r9) # is the extended map arg present? bgtr 1f # Branch if not movq VMB$Q_PFNMAP(r9),RPB$Q_PFNMAP(r11) # otherwise, update the RPB1: movl RPB$Q_PFNMAP+4(r11),r6 # get the address of the PFNMAP movl RPB$Q_PFNMAP(r11),r7 # get its size clrl r9 # init good page counter3: cmpb (r6)+,$0xff # is it 8 good pages ? bneq 1f # if not we're done addl2 $8,r9 # 8 more good pages sobgtr r7,3b # is this the end?1: ashl $9,r9,INFO_MEMSIZ(r8) # convert from pages and save#define MEMSIZEADDR 0xf0000 /* Backward compatability on MVAX */#define MAXMEMSIZE 1024*1024*512
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -