# This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # frc21 # This archive created: Wed Jul 18 07:20:15 1990 echo shar: creating directory frc21 mkdir frc21 cd frc21 echo shar: extracting Makefile '(9616 characters)' sed 's/^X//' << \SHAR_EOF > Makefile X# Makefile X# CREATED BY mkmk X# FROM ./MakeSkel X# ON Fri Aug 19 02:48:59 PDT 1988 X X## makefile for config/frc21 and frc29 X# Modified 23-Jan-89 to make boot ROMs, JWT X# Modified 24-Jan-89 to add sio1Drv.c for SIO-1, JWT X XRAM_START_ADRS = 00001000 # entry adrs in RAM version XROM_TEXT_ADRS = ff000008 # adrs in ROM of start of text in ROM version XROM_DATA_ADRS = 00060000 # adrs in RAM of start of data in ROM version XROM_START_ADRS = $(ROM_TEXT_ADRS) # entry adrs in ROM version X XRELSEG_FLAGS = -t $(ROM_TEXT_ADRS) -d $(ROM_DATA_ADRS) X X X X X X X X# makeHost.bsd - BSD UNIX rules, defs & flags for makefile skeletons X X## rules X X.SUFFIXES : .lint .s .c X X.c.lint: X @rm -f $@ X - lint $(LINTFLAGS) $*.c $(LIB_LINT)$(VX_LN) | \ X sed -e '/copyright/d' \ X -e '/^[^ ]*:$$/d' >$@ X X.s.o : X @rm -f $@ X $(ASM_P1) $< >tmp.c X $(CC) $(CASFLAGS) tmp.c >tmp.i X $(ASM_P2) tmp.i >tmp.s X $(AS) -o $@ tmp.s X @rm -f tmp.c tmp.i tmp.s X X.c.o : X @rm -f $@ X $(CC) $(CFLAGS) -c $< X X X## files and directories X XVW = ../../ XH1 = $(VW)h/ XH2 = $(VW)h/net/ XH3 = $(VW)h/rpc/ XBIN = $(VW)bin/ XSRC = $(VW)src/ XSRCALL = $(VW)src/all/ XSRCNET = $(VW)src/net/ XSRCRPC = $(VW)src/rpc/ XSRCBIN = $(VW)src/bin/ XVRTX = $(VW)src/vrtx/ XPSOS = $(VW)src/psos/ XWIND = $(VW)src/wind/ XLIB = $(VW)lib/ XLIB_MC68000 = $(VW)lib/68000/ XLIB_MC68010 = $(VW)lib/68010/ XLIB_MC68020 = $(VW)lib/68020/ XLIB_HOST = $(VW)lib/host/ XLIB_LINT = $(VW)lib/lint/ XCONFIG = $(VW)config/ XALL = $(VW)config/all/ XDY4 = $(VW)config/dy4/ XHKV2F = $(VW)config/hkv2f/ XIS20 = $(VW)config/is20/ XIV24 = $(VW)config/iv24/ XMV131 = $(VW)config/mv131/ XMV133 = $(VW)config/mv133/ XUBAR = $(VW)config/ubar/ X XVX_LIB = vxWorks.a XVRTX_LIB = vrtx.a XPSOS_LIB = psos.a XWIND_LIB = wind.a XNET_LIB = network.a XRPC_LIB = rpclib.a XCONFIG_LIB = vxConfig.a XFORT_LIB = vxFort.a X XVX_LN = llib-lvw.ln XVRTX_LN = llib-lvrtx.ln XPSOS_LN = llib-lpsos.ln XWIND_LN = llib-lwind.ln XNET_LN = llib-lnet.ln XRPC_LN = llib-lrpc.ln XCONFIG_LN = llib-lcfg.ln X XYACCOUT = y.tab.c XLEXOUT = lex.yy.c X X## tools X XRANLIB = ranlib X X X# makeHost.sun - host specific rules, defs & flags for makefile skeletons X XEVEN = X X## tools X XTAGS = ctags -w -t XASM_P1 = cat XASM_P2 = cat X XCC_MC68000 = cc XCC_MC68010 = cc XCC_MC68020 = cc XCC_HOST = cc X XAS_MC68000 = /usr/arch/sun3/sun2/bin/as XAS_MC68010 = /usr/arch/sun3/sun2/bin/as XAS_MC68020 = as XAS_HOST = as X XLD_MC68000 = /usr/arch/sun3/sun2/bin/ld XLD_MC68010 = /usr/arch/sun3/sun2/bin/ld XLD_MC68020 = ld XLD_HOST = ld X X## flags X XHOST_TYPE = HOST_SUN X XHOST_CFLAGS_MC68000 = -O -sun2 XHOST_CFLAGS_MC68010 = -O -sun2 XHOST_CFLAGS_MC68020 = -O XHOST_CFLAGS_HOST = -O X X## libraries X XHOST_LIB_MC68000 = /usr/arch/sun3/sun2/lib/libc.a XHOST_LIB_MC68010 = /usr/arch/sun3/sun2/lib/libc.a XHOST_LIB_MC68020 = /lib/libc.a XHOST_LIB_HOST = /lib/libc.a X X X## common portion of makefile for config/ X X## Extra modules to be included in VxWorks. These modules are not referred X## in the VxWorks code, so they will not be automatically linked in X## unless they are defined here explicitly. Each -u pulls in one X## extra library module. X## X## _ls usrLib user library routines X## _setjmp cALib C support routines X XEXTRA_MODULES = -u _ls -u _setjmp X X## tools X XCC = $(CC_MC68020) XAS = $(AS_MC68020) XLD = $(LD_MC68020) X XLN = ln -s XRM = rm -f XCP = cp -p XMV = mv X X## flags X X## alternate file directory X XH0 = $(ALL) X X## flags and defines X XINCLUDES = -I. -I$(H0) -I$(H1) -I$(H2) XCFLAGS = $(HOST_CFLAGS_MC68020) $(INCLUDES) XCASFLAGS = -E $(INCLUDES) $(EVEN) XLINTFLAGS = -bun $(INCLUDES) X X## files X X# NOTE: sysALib.o must come first! XMACH_DEP = sysALib.o sysLib.o tyCoDrv.o $(MACH_EXTRA) XMACH_EXTRA = sio1Drv.o X XHOST_LIB = $(HOST_LIB_MC68020) XLIB_CPU = $(LIB_MC68020) XLIBS = $(LIB_CPU)$(VX_LIB) $(LIB_CPU)$(CONFIG_LIB) $(LIB_CPU)$(NET_LIB) \ X $(LIB_CPU)$(RPC_LIB) $(LIB_CPU)$(VX_LIB) $(LIB_CPU)$(WIND_LIB) \ X $(HOST_LIB) X XLINT_LIBS = $(LIB_LINT)$(VX_LN) $(LIB_LINT)$(NET_LN) $(LIB_LINT)$(WIND_LN) X X Xdefault : vxWorks Xaux : tags lint.wind Xlint : lib.lint Xtags : *.c $(H1)*.h X @ $(RM) $@ X $(TAGS) *.c $(H1)*.h X X X####################### machine dependent modules ########################## X XromInit.o : romInit.s config.h $(H0)configAll.h frc21.h $(H1)if_bp.h \ X $(H1)iv68k.h $(H1)m68153.h $(H1)m68230.h $(H1)sysLib.h $(H1)vme.h \ X $(H1)vxWorks.h XsysLib.o : sysLib.c config.h $(H0)configAll.h frc21.h $(H1)if_bp.h \ X $(H1)ioLib.h $(H1)iv68k.h $(H1)lstLib.h $(H1)m68153.h $(H1)m68230.h \ X $(H1)memLib.h $(H1)semLib.h $(H1)sysLib.h $(H1)vme.h $(H1)vxWorks.h XsysALib.o : sysALib.s config.h $(H0)configAll.h frc21.h $(H1)if_bp.h \ X $(H1)iv68k.h $(H1)m68153.h $(H1)m68230.h $(H1)sysLib.h $(H1)vme.h \ X $(H1)vxWorks.h XtyCoDrv.o : tyCoDrv.c frc21.h $(H1)ioLib.h $(H1)iosLib.h $(H1)iv68k.h \ X $(H1)lstLib.h $(H1)m68153.h $(H1)m68230.h $(H1)r68561.h $(H1)rngLib.h \ X $(H1)semLib.h $(H1)tyLib.h $(H1)vxWorks.h $(H1)wdLib.h X Xsio1Drv.o : sio1Drv.c frc21.h $(H1)sio1.h $(H1)ioLib.h $(H1)iosLib.h \ X $(H1)iv68k.h $(H1)lstLib.h $(H1)m68153.h $(H1)m68230.h $(H1)r68561.h \ X $(H1)rngLib.h $(H1)semLib.h $(H1)tyLib.h $(H1)vxWorks.h $(H1)wdLib.h X XconfigVrtx.o : $(H0)configVrtx.c config.h $(H0)configAll.h $(H1)excLib.h \ X frc21.h $(H1)if_bp.h $(H1)iv68k.h $(H1)lstLib.h $(H1)m68153.h \ X $(H1)m68230.h $(H1)semLib.h $(H1)sigLib.h $(H1)taskLib.h \ X $(H1)taskVarLib.h $(H1)vme.h $(H1)vrtx.h $(H1)vrtx32.h $(H1)vxWorks.h X @ $(RM) $@ X $(CC) -c $(CFLAGS) $(ALL)configVrtx.c X XconfigPsos.o : $(H0)configPsos.c config.h $(H0)configAll.h $(H1)excLib.h \ X frc21.h $(H1)if_bp.h $(H1)iv68k.h $(H1)lstLib.h $(H1)m68153.h \ X $(H1)m68230.h $(H1)psos.h $(H1)semLib.h $(H1)sigLib.h $(H1)taskLib.h \ X $(H1)taskVarLib.h $(H1)vme.h $(H1)vxWorks.h X @ $(RM) $@ X $(CC) -c $(CFLAGS) $(ALL)configPsos.c X XusrConfig.o : $(H0)usrConfig.c config.h $(H0)configAll.h $(H1)ctype.h \ X $(H1)excLib.h frc21.h $(H1)if_bp.h $(H1)inetLib.h $(H1)ioLib.h \ X $(H1)iv68k.h $(H1)loadLib.h $(H1)lstLib.h $(H1)m68153.h $(H1)m68230.h \ X $(H1)semLib.h $(H1)sigLib.h $(H1)socket.h $(H1)strLib.h $(H1)symLib.h \ X $(H1)sysLib.h $(H1)sysSymTbl.h $(H1)taskLib.h $(H1)taskVarLib.h \ X $(H1)types.h $(H1)version.h $(H1)vme.h $(H1)vxWorks.h X @ $(RM) $@ X $(CC) -c $(CFLAGS) $(ALL)usrConfig.c X XusrConfig_st.o : $(H0)usrConfig.c config.h $(H0)configAll.h $(H1)ctype.h \ X $(H1)excLib.h frc21.h $(H1)if_bp.h $(H1)inetLib.h $(H1)ioLib.h \ X $(H1)iv68k.h $(H1)loadLib.h $(H1)lstLib.h $(H1)m68153.h $(H1)m68230.h \ X $(H1)semLib.h $(H1)sigLib.h $(H1)socket.h $(H1)strLib.h $(H1)symLib.h \ X $(H1)sysLib.h $(H1)sysSymTbl.h $(H1)taskLib.h $(H1)taskVarLib.h \ X $(H1)types.h $(H1)version.h $(H1)vme.h $(H1)vxWorks.h X @ $(RM) $@ X $(CC) -c -o $@ $(CFLAGS) -DSTANDALONE $(ALL)usrConfig.c X XbootConfig.o : $(H0)bootConfig.c $(H1)a_out.h config.h $(H0)configAll.h \ X $(H1)ctype.h $(H1)excLib.h frc21.h $(H1)ftpLib.h $(H1)if_bp.h \ X $(H1)ioLib.h $(H1)iv68k.h $(H1)loadLib.h $(H1)lstLib.h $(H1)m68153.h \ X $(H1)m68230.h $(H1)semLib.h $(H1)sigLib.h $(H1)socket.h $(H1)strLib.h \ X $(H1)symLib.h $(H1)sysLib.h $(H1)sysSymTbl.h $(H1)taskLib.h \ X $(H1)taskVarLib.h $(H1)types.h $(H1)version.h $(H1)vme.h \ X $(H1)vxWorks.h X @ $(RM) $@ X $(CC) -c $(CFLAGS) $(ALL)bootConfig.c X Xlib.lint : $(ALL)bootConfig.c $(ALL)usrConfig.c sysLib.c tyCoDrv.c X @ $(RM) lib.lint X - lint $(LINTFLAGS) $(ALL)bootConfig.c $(ALL)usrConfig.c \ X sysLib.c tyCoDrv.c $(LINT_LIBS) | \ X sed -e '/copyright/d' \ X -e '/^[^ ]*:$$/d' \ X -e '/slex\.c.*: warning: statement not reached/d' > \ X lib.lint X X####################### vxWorks ########################################### X X# vxWorks - normal vxWorks system X# vxWorks.sym - symbol table of vxWorks X# vxWorks.st - standalone vxWorks w/symbol table linked-in X XvxWorks vxWorks.sym : usrConfig.o $(MACH_DEP) $(LIBS) X @ $(RM) version.c version.o vxWorks vxWorks.sym X sh $(BIN)makeVersion >version.c X $(CC) -c $(CFLAGS) version.c X $(LD) -o vxWorks -N -X -T $(RAM_START_ADRS) $(EXTRA_MODULES) \ X -e _sysInit $(MACH_DEP) usrConfig.o version.o $(LIBS) X $(BIN)xsym vxWorks.sym X @ $(RM) version.c version.o X XvxWorks.st : usrConfig_st.o $(MACH_DEP) $(LIBS) X @ $(RM) vxWorks.st version.c version.o symTbl.c symTbl.o X sh $(BIN)makeVersion > version.c X $(CC) -c $(CFLAGS) version.c X $(LD) -o tmp.o -X -r $(EXTRA_MODULES) \ X $(MACH_DEP) usrConfig_st.o version.o $(LIBS) X sh $(BIN)makeSymTbl tmp.o >symTbl.c X $(CC) -c $(CFLAGS) symTbl.c X $(LD) -o vxWorks.st -N -X -T $(RAM_START_ADRS) -e _sysInit \ X tmp.o symTbl.o X @ $(RM) tmp.o version.c version.o X X####################### bootrom ########################################### X X# bootrom - relocatable bootrom module X# bootrom.hex - absolute hex format bootrom X Xbootrom : romInit.o bootConfig.o $(MACH_DEP) $(LIBS) X @ $(RM) $@ version.c version.o X sh $(BIN)makeVersion >version.c X $(CC) -c $(CFLAGS) version.c X# $(LD) -o bootrom -X -rd -e _romInit \ X# Added echo command - could not find bootrom X echo $(LD) X $(LD) -o bootrom -X -N -T $(ROM_TEXT_ADRS) -e _romInit \ X romInit.o bootConfig.o version.o \ X $(MACH_DEP) $(LIBS) X @ $(RM) version.c version.o X size bootrom X Xbootrom.hex : bootrom X @ $(RM) $@ X $(BIN)relseg $(RELSEG_FLAGS) bootrom X $(BIN)hex -v -p $(ROM_START_ADRS) -a 8 rel.out >bootrom.hex X @ $(RM) rel.out X X SHAR_EOF if test 9616 -ne "`wc -c Makefile`" then echo shar: error transmitting Makefile '(should have been 9616 characters)' fi echo shar: extracting usrConfig.c '(24040 characters)' sed 's/^X//' << \SHAR_EOF > usrConfig.c X/* usrConfig.c - user defined system configuration module */ X Xstatic char *copyright = "Copyright 1984-1988, Wind River Systems, Inc."; Xstatic char *Force_Copyright = "Copyright 1989, Force Computers, Inc."; X X/* Xmodification history X-------------------- X10s,24Jan89,JWT Added SIO-1 drivers to usrRoot X10r,20aug88,gae documentation. X10q,09aug88,gae cleaned up lnattach() and LANCE/NFS problems. X10p,26jul88,rdc+ added mv147 LANCE ethernet chip support. X dfm fixed reference to INT_VEC_PARITY_ERROR from number to offset. X10o,29jun88,jcf made kernel independent. X signals are not optional, so removed INCLUDE_SIGNALS. X10n,22jun88,dnw name tweaks. X added "localhost" == "127.0.0.1". X10m,07jun88,gae added call to sysClkEnable(). X10l,16jun88,llk changed to automatically mount an nfs disk (disk name is X extracted from the boot file's name) and set the current X directory to the nfs disk. Used when NFS is compiled in, X and the boot file starts with a '/'. X10k,05jun88,dnw changed timLib to timexLib. X added INCLUDE_{SIGNALS,DEBUG,RLOGIN,TELNET}. X changed ldLib to loadLib. X changed taskSpawn/taskCreate args. X10j,04jun88,llk changed usage of setAuthUnixUser to nfsAuthUnixSet. X10i,30may88,dnw changed to v4 names. X10h,29may88,jcf added tickSet (0) to initiallize time. X10g,29may88,dnw changed to spawn idle task unbreakable. X10f,28may88,dnw moved printLogo() to usrLib. X renamed netInit() to usrNetInit(). X changed fioSet...() to ioSetGlobalStd (...). X changed call to ldLoadAt() to ldLoadModule(). X10e,26may88,gae added sigInit() call. X10d,29apr88,gae added INCLUDE_{RT11,RAMDRV,STDIO,SPY,TIMLIB}. X10c,24mar88,ecs added conditional include of configVrtx32.h. X changed printLogo to include vxWorks version. X10b,19apr88,llk starts up nfs driver if RPC is compiled in. X nfs user permissions are hardwired at the setAuthUnixUser() X call. Change these if they are not adequate. X10a,22feb88,jcf made kernel independent (phase 1). X09u,19feb88,dnw added subnet mask options to boot parameters. X09t,12feb88,rdc added call to clnt_tcpInit to pull in RPC tcp client module. X09s,22jan88,gae added remLibInit(). X09r,23nov87,jcf documentation. X09q,19nov87,ecs lint. X & added include of strLib.h. X dnw added include of sysLib.h. X fixed cracking of bp anchor in boot line. X09p,14nov87,dnw changed to conditionally compile for standalone version X if STANDALONE is defined. This allowed removal of redundant X declaration of sysSymTbl which caused problems with non-Unix X linkers. X changed netInit() to call bpInit() if cpu 0. X changed parameters to bpattach(). X added mathInit() to 68881 initialization. X09o,01nov87,llk deleted call to addNetRoute(). Extract network address from X host address with inet_netof_string() and use routeAdd(). X rdc added ieEnetAddr for 3e. X09n,26oct87,jcf added SUN IE ethernet controller conditionals X changed call to bpattach to not take the interrupt vector X changed to load symbol table with all symbols if SYSFLG_DEBUG X set in sysFlags. X09m,22oct87,dnw added flags field to boot line. X changed to not require boot line to be terminated with 2 NULLs X for non-ISI targets. X changed usrRoot to call shellInit instead of spawning shell. X changed to call rpcInit instead of spawning portmapd. X deleted initialization of pseudo-terminal devices X (calls to ptyDrv and ptyDevCreate) now done in rlogInit X and telnetInit. X added optional initialization of remote dbx support. X09l,21oct87,jcf made vxTdelete hook parm. in configuration table 0. X deleted call to vxDeallocateStack. X09k,13oct87,rdc usrRoot now conditionally spawns the rpc portmap daemon. X09j,09oct87,jlf changes for isi boot daemon. X09i,28apr87,dnw removed call to ifinit() now done in netStart(). X added attach/config of loopback net interface for performance. X removed references to printStatus(). X improved net driver init error reporting. X added proc num arg to vbattach() call. X changed to call sysClkConnect() instead of direct intConnect(). X added zeroing of VRTX workspace required by VRTX despite X VRTX documentation claims to the contrary. X changed args to bpattach() as required by new bp driver. X added breakpoint interrupt vector arg to dbgInit. X moved ISR_STACK_SIZE here from config.h X moved interrupt vector definitions from here to config.h X changed to get vrtx config tbl vector from definition in vrtx. X removed call to sysSetLowAdrs(). X added initialization of floating point i/o support if X INCLUDE_FLOATING_POINT is defined. X added initialization of 68881 co-processor support if X INCLUDE_MC68881 is defined. X added initialization of ex, enp, nw, pn, bp, and vb net drivers X if INCLUDE_{EX,ENP,NW,PN,BP,VB} respectively are defined. X removed initialization of sysToMon trap (obsolete). X removed code that handled moving data segment of rom code X since this now a port specific problem. X09h,08apr87,dnw clean-up. X09g,07apr87,dnw removed unused param on call sysHwInit(). X09f,04apr87,dnw changed to not add usrRoot's stack to memory pool until X & just before end of usrRoot. X rdc added additional memory to pool for Ironics 1624 only. X09e,25mar87,jlf changed bootLib routine names to meet naming conventions. X documentation. X09d,25mar87,rdc modifications for new backplane network driver. X gateway initialization now calls addNetRoute. X09c,26feb87,rdc moved ISR_STACK_SIZE to config.h X09b,17feb87,dnw changed parameters to work with new vrtx (3.2). X removed unnecessary ftp kludges. X added call to sysSetLowAdrs(). X changed call to exattach(). X09a,10jan87,dnw added ftp option. X changed to not get include files from default directories. X08f,08jan87,rdc changed exattach to use level 2 interrupts for excelan. X*/ X X/* XDESCRIPTION XThis is the WRS-supplied configuration module for VxWorks. XIt contains the root task, the primary system Xinitialization routine, the network initialization routine, and the clock Xinterrupt routine. X XThe include file "config.h" includes a number of system-dependent paramters Xused in this file. X XINCLUDE FILE: config.h X XSEE ALSO: "Cross-Development", "Getting Started" X*/ X X/* LINTLIBRARY */ X X#include "vxWorks.h" X#include "ctype.h" X#include "inetLib.h" X#include "ioLib.h" X#include "iv68k.h" X#include "loadLib.h" X#include "socket.h" X#include "strLib.h" X#include "sysLib.h" X#include "sysSymTbl.h" X#include "taskLib.h" X#include "version.h" X X#include "config.h" X XIMPORT VOID sysVwTrapRtn (); /* vxWorks trap handler entry */ XIMPORT VOID sysMemParityError();/* memory parity err handling routine */ XIMPORT char *bootStringToParams ();/* interpret boot line */ XIMPORT char *sysModel (); /* model name of system CPU */ XIMPORT char *kernelVersion (); /* get kernel version string */ XIMPORT VOID logMsg (); /* log error message */ XIMPORT ULONG tickGet (); /* get current time in ticks */ X XIMPORT char edata; /* automatically defined by the loader */ XIMPORT char etext; /* automatically defined by the loader */ XIMPORT char end; /* automatically defined by the loader */ XIMPORT int remLastResvPort; /* last port num used (from bootroms) */ XIMPORT SYMTAB_ID standAloneSymTbl; /* ptr to linked in symbol table - X * STANDALONE versions only */ X X/* global variables */ X XSYMTAB_ID sysSymTbl; /* system symbol table id */ Xint idleTaskId; /* task id of idle task */ X X#ifdef INCLUDE_IE Xchar ieEnetAddr[6] = IE_ENET_ADDR; /* ethernet adrs for sun ie board */ X#endif INCLUDE_IE X X/* forward declarations */ X XVOID usrClock (); XVOID usrRoot (); XLOCAL STATUS loadSymTbl (); X X/* check include dependencies */ X X#if defined(INCLUDE_DBX) || defined(INCLUDE_NFS) X#define INCLUDE_RPC /* rpc required by dbx and nfs */ X#endif X X#ifdef INCLUDE_DBX X#define INCLUDE_DEBUG /* native debugging required by dbx */ X#endif X X#ifdef INCLUDE_RAMDRV X#define INCLUDE_RT11 /* rt11 required by ramDrv */ X#endif X X/* implicit includes */ X X#if defined(INCLUDE_DBX) X#define INCLUDE_MC68881 /* gets dragged in by DBX */ X#endif X X/******************************************************************************* X* X* usrInit - user defined system initialization routine X* X* THIS IS THE FIRST C CODE EXECUTED AFTER BOOT UP. This routine is X* called by the assembly language start-up routine sysInit which is X* in the sysALib file of the target specific directory. It simply X* puts us in system mode, with the interrupts locked out. The kernel is X* not multi-tasking at this point. X* X* This routine starts by clearing BSS, so all variables are initialized to 0 as X* per the C specification. Then it initializes the hardware by calling X* sysHwInit, sets up the 68K interrupt/exception vectors, spawns usrRoot X* to do the bulk of the initialization, and starts the kernel. X* The root task, usrRoot, will start up AFTER the kernelInit (2) call. X* X* SEE ALSO: kernelLib (1) X*/ X XVOID usrInit () X X { X X#if (CPU==MC68020) X sysCacheEnable (TRUE); /* enable cache memory */ X#endif X X bzero (&edata, &end - &edata); /* clear bss */ X X /* set the vector base register (except on 68000); X * initialize exception/interrupt vectors */ X X#if ((CPU==MC68010) || (CPU==MC68020)) X intVecBaseSet ((FUNCPTR *) VEC_BASE_ADRS); X#endif X X excVecInit (); X intVecSet (TRAPNUM_TO_IVEC (TRAP_VXWORKS), sysVwTrapRtn); /* vxWks trap */ X X X /* do system dependent hardware initialization */ X X sysHwInit (); X X /* start the kernel specifying usrRoot as the root task */ X X kernelInit (TRAP_KERNEL, usrRoot, (ULONG) ROOT_STACK_SIZE, X (ULONG) FREE_RAM_ADRS, (ULONG) sysMemTop (), X (ULONG) ISR_STACK_SIZE, (ULONG) INT_LOCK_LEVEL); X } X/******************************************************************************* X* X* usrRoot - root task X* X* The root task must perform any initialization that cannot be X* done before the kernelInit (2) call. X* X* It initializes the I/O system, install drivers, create devices, X* sets up the network, etc., as necessary for the particular configuration. X* It may also create the system symbol table if one is to be included. X* It may then load and/or spawn additional tasks as needed. X*/ X XVOID usrRoot () X { X int fd; X X /* set up parity error interrupt routine, if interrupt vector is defined */ X X#ifdef INT_VEC_PARITY_ERROR X intConnect (INUM_TO_IVEC (INT_VEC_PARITY_ERROR), sysMemParityError, 0); X#endif X X /* set up system timer */ X X wdLibInit (); /* init watchdog lib */ X X sysClkConnect (usrClock, 0); /* connect clock interrupt routine */ X sysClkRateSet (60); /* set sys clock rate */ X sysClkEnable (); /* start it */ X X tickSet ((ULONG) 0); /* set initial time to zero */ X X /* initialize i/o system */ X X iosInit (NUM_DRIVERS, NUM_FILES, "/null"); /* init i/o system */ X X /* install driver for on-board ports and make devices */ X X tyCoDrv (); X X tyCoDevCreate ("/tyCo/0", 0, 512, 512); X tyCoDevCreate ("/tyCo/1", 1, 512, 512); /* connect second serial port * X * if there is one. */ X X /* make specified console device be standard in/out */ X X fd = open (CONSOLE_DEVICE, UPDATE, 0); /* open console device */ X ioctl (fd, FIOBAUDRATE, 9600); /* set to 9600 baud */ X ioctl (fd, FIOOPTIONS, OPT_TERMINAL); /* set normal terminal opts */ X ioGlobalStdSet (STD_IN, fd); /* set as std in */ X ioGlobalStdSet (STD_OUT, fd); /* set as std out */ X ioGlobalStdSet (STD_ERR, fd); /* set as std error */ X X X /* Install drivers for SIO-1 board */ X/* sio1Drv(); X/* sio1DevCreate("/sio1/1", 0, 512, 512); X/* sio1DevCreate("/sio1/2", 1, 512, 512); X/* sio1DevCreate("/sio1/3", 2, 512, 512); X/* sio1DevCreate("/sio1/4", 3, 512, 512); X/* sio1DevCreate("/sio1/5", 4, 512, 512); X/* sio1DevCreate("/sio1/6", 5, 512, 512); X X/* fd = open("/sio1/1", UPDATE, 0); /* SIO-1 Port 1 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X X/* fd = open("/sio1/2", UPDATE, 0); /* SIO-1 Port 2 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X X/* fd = open("/sio1/3", UPDATE, 0); /* SIO-1 Port 3 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X X/* fd = open("/sio1/4", UPDATE, 0); /* SIO-1 Port 4 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X X/* fd = open("/sio1/5", UPDATE, 0); /* SIO-1 Port 5 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X X/* fd = open("/sio1/6", UPDATE, 0); /* SIO-1 Port 6 */ X/* ioctl(fd, FIOBAUDRATE, 9600); X/* ioctl(fd, FIOOPTIONS, OPT_TERMINAL); X*/ X X /* install pipe driver and initialize exception reporting, X * debugging, and logging */ X idleTaskId = taskSpawn ("idle", 254, VX_SUPERVISOR_MODE | VX_UNBREAKABLE, X 1000, idle); X pipeDrv (); /* init pipe driver */ X excInit (); /* init exception reporting/handling */ X logInit (fd, 500); /* init logging */ X sigInit (); /* initialize signals */ X X#ifdef INCLUDE_DEBUG X dbgInit (TRAP_DEBUG); /* init debugging */ X#endif X X#ifdef INCLUDE_RT11 X rt11Init (NUM_RT_FILES); /* init RT-11 file system */ X#endif X X#ifdef INCLUDE_RAMDRV X ramDrv (); /* initialize ram disk driver */ X#endif X X#ifdef INCLUDE_FLOATING_POINT X floatInit (); /* initialize floating point i/o support */ X#endif X X#ifdef INCLUDE_MC68881 X fppInit (); /* initialize 68881 support */ X mathInit (); /* get 68881 math functions (trig, log, etc) */ X#endif X X#ifdef INCLUDE_STDIO X stdioInit (); /* intialize standard I/O library */ X#endif X X#ifdef INCLUDE_SPY X spyStop (); /* harmless call to drag in spyLib */ X#endif X X#ifdef INCLUDE_TIMEX X timexInit (); /* harmless call to drag in timexLib */ X#endif X X X /* create system symbol table; X * used compiled-in symbol definitions if STANDALONE, X * otherwise load across net */ X X#ifdef STANDALONE X sysSymTbl = standAloneSymTbl; X#else X /* X * Create system symbol table and load across the network. X * The name of the symbol table file is constructed as: X * :.sym X * X * First initialize the network. X */ X X if (usrNetInit (BOOT_LINE_ADRS) == OK) X { X char symTblFile [BOOT_FIELD_LEN]; /* name of symbol table file */ X X sysSymTbl = symTblCreate (MAX_SYS_SYMBOLS, MAX_SYS_SYM_LEN); X X sprintf (symTblFile, "%s:%s.sym", sysBootHost, sysBootFile); X printf ("\nLoading symbol table from %s ...\n", symTblFile); X loadSymTbl (symTblFile); X } X#endif STANDALONE X X /* print logo and spawn the shell. */ X X printLogo (); /* print out id message */ X X shellInit (SHELL_STACK_SIZE, TRUE); X } X/******************************************************************************* X* X* usrClock - user defined system clock interrupt routine X* X* This routine is called at interrupt level on each clock interrupt. X* It is installed by usrRoot with a sysClkConnect (2) call. X* It calls all the other packages that need to know about clock ticks, X* including the kernel itself. X* X* If the application needs anything to happen at clock interrupt level, X* it should be added to this routine. X*/ X XVOID usrClock () X X { X wdTick (); /* check watchdog timers */ X tickAnnounce (); /* announce system tick to kernel */ X } X/******************************************************************************* X* X* usrNetInit - system dependent network initialization X* X* This routine initializes the network. X* The ethernet and backplane drivers and the TCP/IP software are configured. X* It also adds hosts (analogous to the etc/hosts file in UNIX), X* and sets up our access rights on the host system (with iam (2)). X* The boot string parameter is normally left behind by the boot ROMs, X* at address BOOT_LINE_ADRS. X* X* RETURNS X* OK, or X* ERROR if a problem in the boot string, or initializing network X* X* SEE ALSO: "Network" X*/ X XSTATUS usrNetInit (bootString) X char *bootString; /* boot parameter string */ X X { X char devName [MAX_FILENAME_LENGTH]; /* device name */ X char bootDev [BOOT_FIELD_LEN]; /* boot device code */ X char ead [BOOT_FIELD_LEN]; /* ethernet internet addr */ X char bad [BOOT_FIELD_LEN]; /* backplane internet addr */ X char had [BOOT_FIELD_LEN]; /* host internet addr */ X char gad [BOOT_FIELD_LEN]; /* gateway internet addr */ X char usr [BOOT_FIELD_LEN]; /* user id */ X char passwd [BOOT_FIELD_LEN]; /* password */ X int procNum; /* processor number */ X char nad [BOOT_FIELD_LEN]; /* host's network internet addr */ X int protocol; X char nfsDisk [MAX_FILENAME_LENGTH]; X char *p; X FAST char *pS; X char ifname [20]; X STATUS status; X int eNetmask; X int bNetmask; X int gid; /* group id for nfs */ X X X#ifdef TARGET_ISI_VME68K20 X /* for compatibility with ISI boot roms, turn single EOS into spaces; X * boot line MUST be terminated with TWO EOS! */ X X for (pS = bootString; (pS[0] != EOS) || (pS[1] != EOS); ++pS) X { X if (pS[0] == EOS) X pS[0] = ' '; X } X#endif X X /* interpret boot command */ X X pS = bootStringToParams (bootString, bootDev, sysBootHost, sysBootFile, X ead, bad, had, gad, usr, passwd, &procNum, &sysFlags); X if (*pS != EOS) X { X /* print error msg with '^' where parse failed */ X X printf ("Error in boot command:\n%s\n%*c\n", bootString, X pS - bootString + 1, '^'); X return (ERROR); X } X X eNetmask = bootNetmaskExtract (ead); X bNetmask = bootNetmaskExtract (bad); X X /* set processor number: may establish vme bus access, etc. */ X X sysProcNumSet (procNum); X X hostTblInit (); /* initialize remote command library */ X X /* attach and configure the network interfaces */ X X remLastResvPort = 1010; /* pick an unused port number so we don't * X * have to wait for the one used by the * X * by the bootroms to time out */ X netLibInit (); X X X /* if enet address specified, initialize enet boot device */ X X if (ead[0] != NULL) X { X if (FALSE) /* so INCLUDEs will work with 'else if's */ X ; X#ifdef INCLUDE_EX X else if (strcmp (bootDev, "ex") == 0) X status = exattach (0, IO_ADRS_EX, INT_VEC_EX, INT_LVL_EX); X#endif X#ifdef INCLUDE_ENP X else if (strcmp (bootDev, "enp") == 0) X status = enpattach (0, IO_ADRS_ENP, INT_VEC_ENP, INT_LVL_ENP); X#endif X#ifdef INCLUDE_IE X else if (strcmp (bootDev, "ie") == 0) X status = ieattach (0, IO_ADRS_IE, INT_VEC_IE, INT_LVL_IE); X#endif X#ifdef INCLUDE_NW X else if (strcmp (bootDev, "nw") == 0) X status = nwattach (0, IO_ADRS_NW, INT_VEC_NW, INT_LVL_NW); X#endif X#ifdef INCLUDE_PN X else if (strcmp (bootDev, "pn") == 0) X status = pnattach (0, IO_ADRS_PN, INT_VEC_PN, INT_LVL_PN); X#endif X#ifdef INCLUDE_LN X else if (strcmp (bootDev, "ln") == 0) X status = lnattach (0, IO_ADRS_LN, INT_VEC_LN, INT_LVL_LN); X#endif X X X else X { X printf ("Boot device \"%s\" unknown.\n", bootDev); X return (ERROR); X } X X if (status != OK) X { X printf ("Error attaching \"%s\" device: status = 0x%x.\n", bootDev, X errnoGet ()); X return (ERROR); X } X X /* configure ethernet interface with specified inet adrs and net mask */ X X strcpy (ifname, bootDev); X strcat (ifname, "0"); X X if (eNetmask != 0) X ifMaskSet (ifname, eNetmask); X X ifAddrSet (ifname, ead); X } X X X /* if bp net address specified, initialize bp device */ X X if (bad[0] != NULL) X { X char *bpDev = NULL; X X /* NOTE: INCLUDE_BP and INCLUDE_VB cannot BOTH be defined! */ X X#ifdef INCLUDE_BP X char *bpAnchor = BP_ANCHOR_ADRS; X X sscanf (bootDev, "bp=%x", &bpAnchor); /* modify anchor if specified */ X X if (sysProcNum == 0) X bpInit (bpAnchor, (char *)BP_MEM_ADRS, (int) BP_MEM_SIZE); X X bpDev = "bp"; X status = bpattach (0, bpAnchor, sysProcNum, X BP_INT_TYPE, BP_INT_ARG1, BP_INT_ARG2, BP_INT_ARG3); X#endif X X#ifdef INCLUDE_VB X /* If the ISI cluster-compatible backplane driver is required X * (for use with ISI Unix-to-vxWorks backplane communications), X * use the "vb" driver instead of the "bp" driver. X */ X X bpDev = "vb"; X status = vbattach (0, (char *) VB_SHARED_MEM, sysProcNum); X#endif X X if (bpDev == NULL) X printf ( X "Error: backplane address specified but no driver included.\n"); X X else if (status != OK) X printf ("Error attaching \"%s\" device: status = 0x%x.\n", X bpDev, errnoGet ()); X X else X { X /* configure backplane interface with specified inet adrs */ X X strcpy (ifname, bpDev); X strcat (ifname, "0"); X X if (bNetmask != 0) X ifMaskSet (ifname, bNetmask); X X ifAddrSet (ifname, bad); X } X } X X X /* add loop-back interface */ X X loattach (); X ifAddrSet ("lo0", "127.0.0.1"); X hostAdd ("localhost", "127.0.0.1"); X X /* if a gateway was specified, extract the network part of the host's X address and add a route to this network */ X X if (gad[0] != EOS) X { X inet_netof_string (had, nad); X routeAdd (nad, gad); X } X X X /* associate host name with the specified host address */ X X hostAdd (sysBootHost, had); X X X /* create transparent remote file access device; X * device name is sysBootHost with ':' appended. X * protocol is rcmd if no password, or ftp if password specified */ X X netDrv (); /* init remote file driver */ X strcpy (devName, sysBootHost); /* create device name */ X strcat (devName, ":"); X protocol = (passwd[0] == EOS) ? 0 : 1; /* pick protocol based on pw */ X netDevCreate (devName, sysBootHost, protocol); /* create remote file dev */ X X X /* set the user id, and current directory */ X X iam (usr, passwd); X ioDefPathSet (devName); X X taskDelay (15); X X X /* start the rlogin or telnet daemon, X * again based on whether or not password was specified */ X X#ifdef INCLUDE_RLOGIN X if (passwd[0] == EOS) X rlogInit (); X#endif X X#ifdef INCLUDE_TELNET X if (passwd[0] != EOS) X telnetInit (); X#endif X X /* initialize rpc and dbx daemon if specified */ X X#ifdef INCLUDE_RPC X rpcInit (); X clnt_tcpInit (); /* pulls in tcp client module */ X#endif X X#ifdef INCLUDE_DBX X dbxInit (); X#endif X X#ifdef INCLUDE_NFS X gid = NFS_GROUP_ID; /* initialize nfs unix authorization */ X nfsAuthUnixSet (sysBootHost, NFS_USER_ID, gid, 1, &gid); X X if (nfsDrv () == ERROR) /* initialize nfs driver */ X { X printf ("NFS driver did not start up\n"); X } X else X { X /* strip the nfs disk name from the boot file's name */ X X strcpy (nfsDisk, sysBootFile); X if (*nfsDisk != '/') X printf ("no NFS disk specified\n"); X else X { X /* boot file name begins with '/' */ X X if ((p = index (&nfsDisk [1], '/')) != NULL) X { X /* there's a second '/' in path, X * mount first directory in path name */ X X *p = EOS; X strcat (nfsDisk, "/"); X } X else X { X /* mount '/' */ X X nfsDisk [1] = EOS; X } X X /* mount the disk */ X X if (nfsMount (sysBootHost, nfsDisk, nfsDisk) == ERROR) X printf ("NFS mount of %s from host %s failed \n", nfsDisk, X sysBootHost); X else X { X printf ("NFS disk %s mounted\n", nfsDisk); X X /* reset the current directory to be the nfs disk */ X X ioDefPathSet (nfsDisk); X } X } X } X X#endif X X X#ifdef INCLUDE_VB X { X IMPORT VOID vbPoll (); X X taskSpawn ("vbPoll", 255, 0, 0x5000, vbPoll); X isiBootInit (); /* start the boot daemon */ X } X#endif X X return (OK); X } X/******************************************************************************* X* X* loadSymTbl - load system symbol table X* X* This routine loads the system symbol table. X*/ X XLOCAL STATUS loadSymTbl (symTblName) X char *symTblName; X X { X int symfd; X char *loadAddr; X X /* open symbol table file */ X X symfd = open (symTblName, READ, 0); X if (symfd == ERROR) X { X printf ("\nError opening %s: status = 0x%x\n", symTblName, errnoGet()); X return (ERROR); X } X X /* load system symbol table */ X X loadAddr = 0; /* to prevent symbols from being relocated */ X if (loadModuleAt (symfd, X (sysFlags & SYSFLG_DEBUG) ? ALL_SYMBOLS : GLOBAL_SYMBOLS, X &loadAddr, (char **) NULL, (char **) NULL) == ERROR) X { X printf ("Error loading symbol table: status = 0x%x\n", errnoGet ()); X close (symfd); X return (ERROR); X } X X close (symfd); X X return (OK); X } SHAR_EOF if test 24040 -ne "`wc -c usrConfig.c`" then echo shar: error transmitting usrConfig.c '(should have been 24040 characters)' fi echo shar: extracting frc21.h '(4122 characters)' sed 's/^X//' << \SHAR_EOF > frc21.h X/* frc21.h - Force SYS68K/CPU-21/29/32 CPU board header file */ X X/* Xmodification history X-------------------- X02b,01aug88,gae added frc32 stuff. X02a,11jul88,gae updated with tja's merged frc21/9 port. X01d,29jun88,gae added include of m68230.h. X01c,29apr88,gae added BUS and CPU constants. X01b,22feb88,dnw removed MPCC and PIT defines to their own header files. X01a,28may87,tja written X*/ X X/* XThis file contains I/O address and related constants for XVxWorks on the Force SYS68K/CPU-21, SYS68K/CPU-29 and SYS68K/CPU-32. X*/ X X#ifndef INCfrc21h X#define INCfrc21h X X#include "m68230.h" X#include "m68153.h" X X#define TARGET_FRC_21 X X#define BUS VME_BUS X#define CPU MC68020 X X/* Force CPU Models */ X X#define FRC_CPU_21 1 X#define FRC_CPU_29 2 X#define FRC_CPU_32 3 X X/* XInterrupt vectors. Two Bus Interruptor Module (BIM) chips controls Xon-board interrupts. The local interrupt assignment is organized Xas follows: X X interrupt BIM X source channel X ----------------------- X ABORT switch INT0 X MPCC 1 INT1 X PI/T Timer INT2 X ----------------------- X SYSFAIL INT3 X IRQVMX INT3 X ACFAIL INT3 X MPCC 2/3 INT3 X ----------------------- X X interrupt BIM 1 BIM 2 X source channel channel X ------------------------------------------- X ABORT switch INT0 X MPCC 1 INT1 X PI/T 1 Timer INT2 X PI/T 1 Port INT3 X XCPU-29 (& 32) only: X RTC INT0 X MPCC 2 (optional) INT1 X PI/T 2 Timer INT2 X PI/T 2 Port INT3 X X XAll local interrupts are routed through the BIMs to program the XIRQ level and the IRQ vector and have higher priority than a XVMEBus interrupt of equal interrupt level. X*/ X X/* interrupt vectors */ X X#define INT_VEC_ABORT 64 /* ABORT */ X#define INT_VEC_CO_MPCC 65 /* console MPCC */ X#define INT_VEC_PIT1_TIMER 66 /* PI/T 1 TIMER */ X#define INT_VEC_PIT1_PORT 67 /* PI/T 1 PORT */ X X/* CPU-29 only */ X X#define INT_VEC_RTC 68 /* Real Time Clock */ X#define INT_VEC_PIT2_TIMER 69 /* PI/T 2 TIMER */ X#define INT_VEC_PIT2_PORT 70 /* PI/T 2 PORT */ X X/* interrupt levels */ X X#define INT_LVL_ABORT 7 X#define INT_LVL_PIT1_TIMER 6 X#define INT_LVL_PIT1_PORT 4 X#define INT_LVL_CO_MPCC 4 X#define INT_LVL_RTC 5 X#define INT_LVL_PIT2_TIMER 2 X#define INT_LVL_PIT2_PORT 2 X X X#define TY_XTAL_FREQ 8064000 /* freq of MPCC clock input */ X#define CLOCK_FREQ 8064000 /* freq of PI/T clock input */ X X#define N_MPCCS 2 /* no. of MPCC channels */ X X/* The base address for all on-board I/O devices is fixed */ X X#define IO_BASE ((char *) 0xff800000) X X#define PIT_BASE_1 (IO_BASE + 0xc00) /* parallel if/timer chip 1 */ X#define PIT_BASE_2 (IO_BASE + 0xe00) /* parallel if/timer chip 2 */ X X#define MPCC_BASE_1 (IO_BASE) /* console serial port */ X#define MPCC_BASE_2 (IO_BASE + 0x0200) /* 2nd serial port */ X#define MPCC_BASE_3 (IO_BASE + 0x0600) /* optional 3rd serial port */ X X/* port addresses for BIM */ X#define BIM_BASE_1 (IO_BASE + 0x800) /* BIM chip 1 */ X#define BIM_BASE_2 (IO_BASE + 0xa00) /* BIM chip 2 */ X X#define RTC_BASE (IO_BASE + 0X1000) /* real-time clock */ X X/* RTC 62421 register addresses */ X X#define RTC_1_SEC (IO_BASE + 0x1000) /* 1 sec. digit */ X#define RTC_10_SEC (IO_BASE + 0x1001) /* 10 sec. digit */ X#define RTC_1_MIN (IO_BASE + 0x1002) /* 1 min. digit */ X#define RTC_10_MIN (IO_BASE + 0x1003) /* 10 min. digit */ X#define RTC_1_HR (IO_BASE + 0x1004) /* 1 hour digit */ X#define RTC_10_HR (IO_BASE + 0x1005) /* pm/am + 10 hour digit */ X#define RTC_1_DAY (IO_BASE + 0x1006) /* 1 day digit */ X#define RTC_10_DAY (IO_BASE + 0x1007) /* 10 day digit */ X#define RTC_1_MON (IO_BASE + 0x1008) /* 1 month digit */ X#define RTC_10_MON (IO_BASE + 0x1009) /* 10 month digit */ X#define RTC_1_YR (IO_BASE + 0x100a) /* 1 year digit */ X#define RTC_10_YR (IO_BASE + 0x100b) /* 10 year digit */ X#define RTC_WEEK (IO_BASE + 0x100c) /* week */ X#define RTC_CTR_D (IO_BASE + 0x100d) /* control d */ X#define RTC_CTR_E (IO_BASE + 0x100e) /* control e */ X#define RTC_CTR_F (IO_BASE + 0x100f) /* control f */ X X#endif INCfrc21h SHAR_EOF if test 4122 -ne "`wc -c frc21.h`" then echo shar: error transmitting frc21.h '(should have been 4122 characters)' fi echo shar: done with directory frc21 cd .. # End of shell archive exit 0