📄 usrconfig.c
字号:
{ printf ("sysScsiInit() Failed, SCSI system not initialized\n"); }#endif /* INCLUDE_SCSI */#ifdef INCLUDE_FD fdDrv (FD_INT_VEC, FD_INT_LVL); /* initialize floppy disk driver */#endif /* INCLUDE_FD */#ifdef INCLUDE_IDE ideDrv (IDE_INT_VEC, IDE_INT_LVL, IDE_CONFIG); /* init IDE disk driver */#endif /* INCLUDE_IDE */#ifdef INCLUDE_ATA { /* initialize hard disk driver */ IMPORT ATA_RESOURCE ataResources[]; ATA_RESOURCE *pAtaResource; for (ix = 0; ix < ATA_MAX_CTRLS; ix++) { pAtaResource = &ataResources[ix]; if (pAtaResource->ctrlType == IDE_LOCAL) ataDrv (ix, pAtaResource->drives, pAtaResource->intVector, pAtaResource->intLevel, pAtaResource->configType, pAtaResource->semTimeout, pAtaResource->wdgTimeout); } }#ifdef INCLUDE_SHOW_ROUTINES ataShowInit (); /* install ATA/IDE show routine */#endif /* INCLUDE_SHOW_ROUTINES */#endif /* INCLUDE_ATA */#ifdef INCLUDE_LPT { IMPORT LPT_RESOURCE lptResources[]; lptDrv (LPT_CHANNELS, &lptResources[0]); /* init LPT parallel driver */ }#endif /* INCLUDE_LPT */#ifdef INCLUDE_PCMCIA#ifdef INCLUDE_SHOW_ROUTINES pcmciaShowInit (); /* install PCMCIA show routines */#endif /* INCLUDE_SHOW_ROUTINES */ pcmciaInit (); /* init PCMCIA Lib */#endif /* INCLUDE_PCMCIA */#ifdef INCLUDE_TFFS tffsDrv (); /* it should be after pcmciaInit() */#endif /* INCLUDE_TFFS */#ifdef INCLUDE_FORMATTED_IO fioLibInit (); /* initialize formatted I/O */#endif /* INCLUDE_FORMATTED_IO */ /* initialize floating point facilities */#ifdef INCLUDE_FLOATING_POINT floatInit (); /* initialize floating point I/O */#endif /* INCLUDE_FLOATING_POINT */ /* install software floating point emulation (if applicable) */#ifdef INCLUDE_SW_FP mathSoftInit (); /* use software emulation for fp math */#endif /* INCLUDE_SW_FP */ /* install hardware floating point support (if applicable) */#ifdef INCLUDE_HW_FP mathHardInit (); /* do fppInit() & install hw fp math */#ifdef INCLUDE_SHOW_ROUTINES fppShowInit (); /* install hardware fp show routine */#endif /* INCLUDE_SHOW_ROUTINES */#endif /* INCLUDE_HW_FP */ /* initialize performance monitoring tools */#ifdef INCLUDE_SPY spyLibInit (); /* install task cpu utilization tool */#endif /* INCLUDE_SPY */#ifdef INCLUDE_TIMEX timexInit (); /* install function timing tool */#endif /* INCLUDE_TIMEX */#ifdef INCLUDE_ENV_VARS envLibInit (ENV_VAR_USE_HOOKS); /* initialize environment variable */#endif /* INCLUDE_ENV_VARS */#ifdef INCLUDE_NTPASSFS { extern int ntPassFsInit(); extern int ntPassFsDevInit(); ntPassFsInit(1); ntPassFsDevInit("host:"); }#endif /* INCLUDE_NTPASSFS */ /* initialize object module loader */#ifdef INCLUDE_LOADER moduleLibInit (); /* initialize module manager */#if defined(INCLUDE_AOUT) loadAoutInit (); /* use a.out format */#else /* coff or ecoff */#if defined(INCLUDE_ECOFF) loadEcoffInit (); /* use ecoff format */#else /* ecoff */#if defined(INCLUDE_COFF) loadCoffInit (); /* use coff format */#else /* coff */#if defined(INCLUDE_ELF) loadElfInit (); /* use elf format */#else#if defined(INCLUDE_SOM_COFF) loadSomCoffInit ();#else#if defined(INCLUDE_PECOFF) { extern int loadPecoffInit(); loadPecoffInit (); }#endif#endif#endif#endif#endif#endif#endif /* INCLUDE_LOADER */ /* initialize wtx client to synchronize host and target symbol tables */#ifdef INCLUDE_SYM_TBL_SYNC symSyncLibInit ();#endif /* INCLUDE_SYM_TBL_SYNC */ /* initialize network */#ifdef INCLUDE_NET_INIT usrBootLineInit (sysStartType); /* crack the bootline */ usrNetInit (BOOT_LINE_ADRS); /* initialize network support */#if CPU==SIMNT { extern int simProcnum; char ulipIP[] = "90.0.0.1"; ulipIP[7] = '1'+simProcnum; routeAdd("0.0.0.0",ulipIP); }#endif /* CPU==SIMNT */#endif /* INCLUDE_NET_INIT */#ifdef INCLUDE_PASSFS { extern STATUS passFsInit (); extern void *passFsDevInit (); char passName [256]; if (passFsInit (1) == OK) { extern char vxsim_hostname[]; extern char vxsim_cwd[]; sprintf (passName, "%s:", vxsim_hostname); if (passFsDevInit (passName) == NULL) { printf ("passFsDevInit failed for <%s>\n", passName); } else { sprintf (passName, "%s:%s", vxsim_hostname, vxsim_cwd); ioDefPathSet (passName); } } else printf ("passFsInit failed\n"); }#endif /* INCLUDE_PASSFS */#ifdef INCLUDE_DOS_DISK { char unixName [80]; extern void unixDrv (); extern void unixDiskInit (); extern char *u_progname; /* home of executable */ char *pLastSlash; unixDrv (); pLastSlash = strrchr (u_progname, '/'); pLastSlash = (pLastSlash == NULL) ? u_progname : (pLastSlash + 1); sprintf (unixName, "/tmp/%s%d.dos", pLastSlash, sysProcNumGet()); unixDiskInit (unixName, "A:", 0); }#endif /* INCLUDE_DOS_DISK */ /* initialize shared memory objects */#ifdef INCLUDE_SM_OBJ /* unbundled shared memory objects */ usrSmObjInit (BOOT_LINE_ADRS);#endif /* INCLUDE_SM_OBJ */ /* initialize WindMP */#ifdef INCLUDE_VXFUSION /* unbundled VxFusion (distributed objects) */ usrVxFusionInit (BOOT_LINE_ADRS);#ifdef INCLUDE_SHOW_ROUTINES { extern void msgQDistShowInit(); extern void distNameShowInit (); extern void distIfShowInit (); extern void msgQDistGrpShowInit (); msgQDistShowInit(); distNameShowInit (); distIfShowInit (); msgQDistGrpShowInit (); }#endif /* INCLUDE_SHOW_ROUTINES */#endif /* INCLUDE_WINDMP */ /* write protect text segment & vector table only after bpattach () */#ifdef INCLUDE_MMU_FULL /* unbundled mmu product */#ifdef INCLUDE_PROTECT_TEXT if (vmTextProtect () != OK) printf ("\nError protecting text segment. errno = %x\n", errno);#endif /* INCLUDE_PROTECT_TEXT */#ifdef INCLUDE_PROTECT_VEC_TABLE if (intVecTableWriteProtect () != OK) printf ("\nError protecting vector table. errno = %x\n", errno);#endif /* INCLUDE_PROTECT_VEC_TABLE */#endif /* INCLUDE_MMU_FULL */ /* initialize select only after NFS and RPC for proper delete hook order */#ifdef INCLUDE_SELECT selectInit ();#endif /* INCLUDE_SELECT */ /* create system and status symbol tables */#ifdef INCLUDE_STANDALONE_SYM_TBL sysSymTbl = symTblCreate (SYM_TBL_HASH_SIZE_LOG2, TRUE, memSysPartId);#ifdef INCLUDE_SYM_TBL_SYNC /* create a module (group 1) that is not synchronized (SPR# 20301) */ moduleCreate ("vxWorks.sym", #if (defined INCLUDE_AOUT) MODULE_A_OUT,#elif ((defined INCLUDE_COFF) || (defined INCLUDE_ECOFF) || \ (defined INCLUDE_SOMCOFF)) MODULE_ECOFF,#elif (defined INCLUDE_ELF) MODULE_ELF,#endif /* INCLUDE_AOUT */ HIDDEN_MODULE|LOAD_NO_SYMBOLS);#endif /* INCLUDE_SYM_TBL_SYNC */ printf ("\nAdding %ld symbols for standalone.\n", standTblSize); /* fill in from built in table*/ for (ix = 0; (ULONG) ix < standTblSize; ix++)#if (CPU == ARM7TDMI_T) thumbSymTblAdd (sysSymTbl, &(standTbl[ix]));#else symTblAdd (sysSymTbl, &(standTbl[ix]));#endif /* CPU==ARM7TDMI_T `*/#endif /* INCLUDE_STANDALONE_SYM_TBL */#ifdef INCLUDE_NET_SYM_TBL sysSymTbl = symTblCreate (SYM_TBL_HASH_SIZE_LOG2, TRUE, memSysPartId); netLoadSymTbl (); /* fill in table from host */#endif /* INCLUDE_NET_SYM_TBL */#ifdef INCLUDE_STAT_SYM_TBL statSymTbl = symTblCreate (STAT_TBL_HASH_SIZE_LOG2, FALSE, memSysPartId); for (ix = 0; (ULONG)ix < statTblSize; ix ++) /* fill in from builtin table*/ symTblAdd (statSymTbl, &(statTbl [ix]));#endif /* INCLUDE_STAT_SYM_TBL */ /* initialize C++ support library */#if defined (INCLUDE_CPLUS) && defined (INCLUDE_CPLUS_MIN)#error Define only one of INCLUDE_CPLUS or INCLUDE_CPLUS_MIN, not both#endif#ifdef INCLUDE_CPLUS /* all standard C++ runtime support */ cplusLibInit ();#ifdef INCLUDE_LOADER cplusDemanglerInit ();#endif#endif#ifdef INCLUDE_CPLUS_MIN /* minimal C++ runtime support */ cplusLibMinInit ();#ifdef INCLUDE_LOADER cplusDemanglerInit ();#endif#endif /* initialize Wind Web Server */#ifdef INCLUDE_HTTP httpd ();#endif /* INCLUDE_HTTP */#ifdef INCLUDE_RBUFF /* install rBuff support */ rBuffLibInit();#ifdef INCLUDE_SHOW_ROUTINES rBuffShowInit (); /* install rBuff show routine */#endif /* INCLUDE_SHOW_ROUTINES */#endif /* INCLUDE_RBUFF */#ifdef INCLUDE_WINDVIEW windviewConfig ();#endif /* INCLUDE_WINDVIEW */ /* initialize the WDB debug agent */#ifdef INCLUDE_WDB wdbConfig();#ifdef INCLUDE_WDB_BANNER#ifndef INCLUDE_SHELL /* short banner, like the bootPrintLogo banner */ printf ("\n\n"); printf ("%17s%s", "","VxWorks\n\n"); printf ("Copyright 1984-1998 Wind River Systems, Inc.\n\n"); printf (" CPU: %s\n", sysModel ()); printf (" VxWorks: " VXWORKS_VERSION "\n"); printf (" BSP version: " BSP_VERSION BSP_REV "\n"); printf (" Creation date: %s\n", __DATE__); printf (" WDB: %s.\n\n", ((wdbRunsExternal () || wdbRunsTasking ()) ? "Ready" : "Agent configuration failed") );#endif /*INCLUDE_SHELL*/#endif /*INCLUDE_WDB_BANNER*/#endif /* INCLUDE_WDB */ /* initialize interactive shell */#ifdef INCLUDE_SHELL#ifdef INCLUDE_SECURITY /* include shell security */ if ((sysFlags & SYSFLG_NO_SECURITY) == 0) { loginInit (); /* initialize login table */ shellLoginInstall (loginPrompt, NULL); /* install security program */ /* add additional users here as required */ loginUserAdd (LOGIN_USER_NAME, LOGIN_PASSWORD); }#endif /* INCLUDE_SECURITY */ printLogo (); /* print out the banner page */ printf (" "); printf ("CPU: %s. Processor #%d.\n", sysModel (), sysProcNumGet ()); printf (" "); printf ("Memory Size: 0x%x.", (UINT)(sysMemTop () - (char *)LOCAL_MEM_LOCAL_ADRS)); printf (" BSP version " BSP_VERSION BSP_REV ".");#if defined(INCLUDE_WDB) && defined(INCLUDE_WDB_BANNER) printf ("\n "); printf ("WDB: %s.", ((wdbRunsExternal () || wdbRunsTasking ()) ? "Ready" : "Agent configuration failed") );#endif /*INCLUDE_WDB && INCLUDE_WDB_BANNER*/ printf ("\n\n");#ifdef INCLUDE_STARTUP_SCRIPT /* run a startup script */ if (sysBootParams.startupScript [0] != EOS) usrStartupScript (sysBootParams.startupScript);#endif /* INCLUDE_STARTUP_SCRIPT */ shellInit (SHELL_STACK_SIZE, TRUE); /* create the shell */ /* only include the simple demo if the shell is NOT included */#else#if defined(INCLUDE_DEMO) /* create demo w/o shell */ taskSpawn ("demo", 20, 0, 2000, (FUNCPTR)usrDemo, 0,0,0,0,0,0,0,0,0,0);#endif /* mips cpp no elif */#endif /* INCLUDE_SHELL */#ifdef INCLUDE_UGL usrUglInit ();#endif /* INCLUDE_UGL */#if defined(INCLUDE_JAVA) javaConfig ();#endif /* INCLUDE_JAVA */#ifdef INCLUDE_HTML usrHtmlInit ();#endif /* INCLUDE_HTML */#if CPU==SIMNT win_ReleaseMutex(simUpMutex);#endif#ifdef INCLUDE_USER_APPL /* Startup the user's application */ USER_APPL_INIT; /* must be a valid C statement or block */#endif }/********************************************************************************* usrClock - user-defined system clock interrupt routine** This routine is called at interrupt level on each clock interrupt.* It is installed by usrRoot() with a sysClkConnect() call.* It calls all the other packages that need to know about clock ticks,* including the kernel itself.** If the application needs anything to happen at the system clock interrupt* level, it can be added to this routine.** RETURNS: N/A*/void usrClock () { tickAnnounce (); /* announce system tick to kernel */ }#ifdef INCLUDE_DEMO/********************************************************************************* usrDemo - example application without shell** This routine is spawned as a task at the end of usrRoot(), if INCLUDE_DEMO* is defined, and INCLUDE_SHELL is NOT defined in configAll.h or config.h.* It is intended to indicate how a shell-less application can be linked,* loaded, and ROMed.** NOMANUAL*/void usrDemo (void) { char string [40]; printf ("VxWorks (for %s) version %s.\n", sysModel (), vxWorksVersion); printf ("Kernel: %s.\n", kernelVersion ()); printf ("Made on %s.\n", creationDate); FOREVER { printf ("\nThis is a test. Type something: "); fioRdString (STD_IN, string, sizeof (string)); printf ("\nYou typed \"%s\".\n", string); if (strcmp (string, "0") == 0) memShow (0); if (strcmp (string, "1") == 0) memShow (1); } }#endif /* INCLUDE_DEMO */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -