static void Initialize( void ) { const char *err; _DBG(("About to remote link in initialize.\n" )); err = RemoteLinkX( "\0", TRUE ); _DBG(( "Back from PM remote link\n" )); if( err != NULL ) { _DBG(( "ERROR! '%s'\n", err )); } if( err != NULL ) { #ifdef ACAD for( ;; ) ads_link( RSERR ); #else StartupErr( err ); #endif } RWBuff[0] = '\0'; _DBG(( "No Remote link error. About to TrapInit." )); TrapVer = TrapInit( "", RWBuff, FALSE ); if( RWBuff[0] != '\0' ) { // NO, NO, NO! RemoteUnLinkX(); StartupErr( RWBuff ); } _DBG(( "No TrapInit error. Initialize complete" )); Out[0].len = sizeof( RWBuff ); Out[0].ptr = RWBuff; }
static void InitProgram( void ) { ExtnSw = 0; OpenSymTab(); // VAX/VMS version of TrapInit() goes back 2 stack frames to set // exception bits for the whole compile. // If the sequence of calls "CompProg()/InitProgram()/TrapInit()" // changes, TrapInit() will have to be modified. TrapInit(); ISNNumber = 0; ITHead = NULL; InitCSList(); IFInit(); TDProgInit(); BIInit(); // Initialize Browser Info Generator }
//---------------------------------------------------------------------------------------------------------------------------- // // ÄÚºËÖ÷Èë¿Ú // //---------------------------------------------------------------------------------------------------------------------------- void k_main(void) { unsigned long base_mm; PageDirInit(); KernelGraphicInit(); ConsoleInit(0,0xFFFFFF); ConsolePrintf("Enable The Page"); ConsolePrintOK(); ConsoleMsg(" The Kernel Page Dir at %08x The Page0 at %08x\n",PG_DIR_ADDR,PG_TABLE_ADDR); ConsoleMsg(" The VESA Mapping Page at %08x\n",VESA_PTE); ConsolePrintf("Load The boot Infomation"); ConsolePrintOK(); GetGrubVersion(GrubBootInfo); GetGrubBoot(GrubBootInfo,(int*)&BootParameters.bp_bootdev); GetGrubMemInfo(GrubBootInfo,&base_mm,&BootParameters.bp_ramsize); GetGrubAPM(GrubBootInfo); BootMemInit(); KnlMesQueInit(); PageManagerInit(BootParameters.bp_ramsize); VMemInit(BootParameters.bp_ramsize,0xC0000000-BootParameters.bp_ramsize); TrapInit(); TimerInit(); KeyboardInit(); MouseInit(); //FloppyInit(); HardDiskInit(); //Fat12_Init(); Fat32_Init(); ProcessInit(); SystemCallInit(); __asm__("sti"); ExecInitProc("SHELLER "); SetSwitching(0); while(1); }
char *LoadTrap( char *trapbuff, char *buff, trap_version *trap_ver ) { char *ptr; if( trapbuff == NULL ) trapbuff = "std"; for( ptr = trapbuff; *ptr != '\0' && *ptr != ';'; ++ptr ) ; ptr = (*ptr != '\0') ? ptr + 1 : ptr; *trap_ver = TrapInit( ptr, buff, trap_ver->remote ); if( buff[0] != '\0' ) { return( buff ); } if( !TrapVersionOK( *trap_ver ) ) { KillTrap(); return( TC_ERR_WRONG_TRAP_VERSION ); } TrapVer = *trap_ver; ReqFunc = TrapRequest; return( NULL ); }
char *LoadTrap( const char *parms, char *buff, trap_version *trap_ver ) { char chr; if( parms == NULL || *parms == '\0' ) parms = DEFAULT_TRP_NAME; for( ; (chr = *parms) != '\0'; parms++ ) { if( chr == TRAP_PARM_SEPARATOR ) { parms++; break; } } *trap_ver = TrapInit( parms, buff, trap_ver->remote ); if( buff[0] == '\0' ) { if( TrapVersionOK( *trap_ver ) ) { TrapVer = *trap_ver; ReqFunc = TrapRequest; return( NULL ); } strcpy( buff, TC_ERR_WRONG_TRAP_VERSION ); } KillTrap(); return( buff ); }