📄 usrconfig_st.c
字号:
}
#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 ();
#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 */
/* 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 ();
#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 */
#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 */
/* 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);
printf ("\nAdding %ld symbols for standalone.\n", standTblSize);
for (ix = 0; ix < standTblSize; ix++) /* fill in from built in table*/
symTblAdd (sysSymTbl, &(standTbl[ix]));
#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; ix < statTblSize; ix ++) /* fill in from built in 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 ();
#endif
#ifdef INCLUDE_CPLUS_MIN /* minimal C++ runtime support */
cplusLibMinInit ();
#endif
/* initialize windview support */
#ifdef INCLUDE_INSTRUMENTATION
/* initialize timer support for windview */
#ifdef INCLUDE_TIMESTAMP
#ifdef INCLUDE_USER_TIMESTAMP
wvTmrRegister ((UINTFUNCPTR) USER_TIMESTAMP,
(UINTFUNCPTR) USER_TIMESTAMPLOCK,
(FUNCPTR) USER_TIMEENABLE,
(FUNCPTR) USER_TIMEDISABLE,
(FUNCPTR) USER_TIMECONNECT,
(UINTFUNCPTR) USER_TIMEPERIOD,
(UINTFUNCPTR) USER_TIMEFREQ);
#else /* INCLUDE_USER_TIMESTAMP */
wvTmrRegister (sysTimestamp,
sysTimestampLock,
sysTimestampEnable,
sysTimestampDisable,
sysTimestampConnect,
sysTimestampPeriod,
sysTimestampFreq);
#endif /* INCLUDE_USER_TIMESTAMP */
#else /* INCLUDE_TIMESTAMP */
wvTmrRegister (seqStamp,
seqStampLock,
seqEnable,
seqDisable,
seqConnect,
seqPeriod,
seqFreq);
#endif /* INCLUDE_TIMESTAMP */
/* initialize WindView host target connection */
connRtnSet (evtSockInit, evtSockClose, evtSockError, evtSockDataTransfer);
/* set the characteristics of the event task - tEvtTask */
wvEvtTaskInit (WV_EVT_STACK, WV_EVT_PRIORITY);
/* initialize windview instrumentation buffers and tasks */
bufferAddress = wvInstInit (EVTBUFFER_ADDRESS, EVTBUFFER_SIZE, WV_MODE);
/* initialize WindView command server */
#ifdef INCLUDE_WINDVIEW
wvServerInit (WV_SERVER_STACK, WV_SERVER_PRIORITY);
#endif /* INCLUDE_WINDVIEW */
#endif /* INCLUDE_INSTRUMENTATION */
/* 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-1996 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_USER_APPL
/* Startup the user's application */
USER_APPL_INIT; /* must be a valid C statement or block */
#endif
#ifdef INCLUDE_FRAME
FrameRlyInit();
#endif
#ifdef INCLUDE_7375
Sys_Init();
#endif
/*
if(usrNetIfAttach("ene","202.195.114.125")!=OK)
printf("ene attach fail!\n");
if(usrNetIfConfig("ene","202.195.114.125",NULL,0)!=OK)
printf("ene config fail!\n");
*/
/* ********************************modified by shihong in 1999.8.12********************************************** */
loginInit();
loginUserAdd("12345678","zQdceQbRe");
/*
usrTffsConfig(0,0,"tffs");
*/
/* ************************************************************************************************************** */
}
/*******************************************************************************
*
* 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 + -