VxWorks Reference Manual : Libraries
usrLib - user interface subroutine library
help( ) - print a synopsis of selected routines
netHelp( ) - print a synopsis of network routines
bootChange( ) - change the boot line
periodRun( ) - call a function periodically
period( ) - spawn a task to call a function periodically
repeatRun( ) - call a function repeatedly
repeat( ) - spawn a task to call a function repeatedly
sp( ) - spawn a task with default parameters
checkStack( ) - print a summary of each task's stack usage
i( ) - print a summary of each task's TCB
ti( ) - print complete information from a task's TCB
show( ) - print information on a specified object
ts( ) - suspend a task
tr( ) - resume a task
td( ) - delete a task
version( ) - print VxWorks version information
m( ) - modify memory
d( ) - display memory
cd( ) - change the default directory
pwd( ) - print the current default directory
copy( ) - copy in (or stdin) to out (or stdout)
copyStreams( ) - copy from/to specified streams
diskFormat( ) - format a disk
diskInit( ) - initialize a file system on a block device
squeeze( ) - reclaim fragmented free space on an RT-11 volume
ld( ) - load an object module into memory
ls( ) - list the contents of a directory
ll( ) - do a long listing of directory contents
lsOld( ) - list the contents of an RT-11 directory
mkdir( ) - make a directory
rmdir( ) - remove a directory
rm( ) - remove a file
devs( ) - list all system-known devices
lkup( ) - list symbols
lkAddr( ) - list symbols whose values are near a specified value
mRegs( ) - modify registers
pc( ) - return the contents of the program counter
printErrno( ) - print the definition of a specified error status value
printLogo( ) - print the VxWorks logo
logout( ) - log out of the VxWorks system
h( ) - display or set the size of shell history
spyReport( ) - display task activity data
spyTask( ) - run periodic task activity reports
spy( ) - begin periodic task activity reports
spyClkStart( ) - start collecting task activity data
spyClkStop( ) - stop collecting task activity data
spyStop( ) - stop spying and reporting
spyHelp( ) - display task monitoring help menu
This library consists of routines meant to be executed from the VxWorks shell. It provides useful utilities for task monitoring and execution, system information, symbol table management, etc.
Many of the routines here are simply command-oriented interfaces to more general routines contained elsewhere in VxWorks. Users should feel free to modify or extend this library, and may find it preferable to customize capabilities by creating a new private library, using this one as a model, and appropriately linking the new one into the system.
Some routines here have optional parameters. If those parameters are zero, which is what the shell supplies if no argument is typed, default values are typically assumed.
A number of the routines in this module take an optional task name or ID as an argument. If this argument is omitted or zero, the "current" task is used. The current task (or "default" task) is the last task referenced. The usrLib library uses taskIdDefault( ) to set and get the last-referenced task ID, as do many other VxWorks routines.
This library uses a small number of undocumented VxWorks internal routines.
usrLib.h
usrLib, spyLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
help( ) - print a synopsis of selected routines
void help (void)
This command prints the following list of the calling sequences for commonly used routines, mostly contained in usrLib.
help Print this list dbgHelp Print debug help info nfsHelp Print nfs help info netHelp Print network help info spyHelp Print task histogrammer help info timexHelp Print execution timer help info h [n] Print (or set) shell history i [task] Summary of tasks' TCBs ti task Complete info on TCB for task sp adr,args... Spawn a task, pri=100, opt=0, stk=20000 taskSpawn name,pri,opt,stk,adr,args... Spawn a task td task Delete a task ts task Suspend a task tr task Resume a task d [adr[,nunits[,width]]] Display memory m adr[,width] Modify memory mRegs [reg[,task]] Modify a task's registers interactively pc [task] Return task's program counter version Print VxWorks version info, and boot line iam "user"[,"passwd"] Set user name and passwd whoami Print user name cd "path" Set current working path pwd Print working path devs List devices ls ["path"[,long]] List contents of directory ll ["path"] List contents of directory - long format rename "old","new" Change name of file copy ["in"][,"out"] Copy in file to out file (0 = std in/out) ld [syms[,noAbort][,"name"]] Load std in into memory (syms = add symbols to table: -1 = none, 0 = globals, 1 = all) lkup ["substr"] List symbols in system symbol table lkAddr address List symbol table entries near address checkStack [task] List task stack sizes and usage printErrno value Print the name of a status value period secs,adr,args... Spawn task to call function periodically repeat n,adr,args... Spawn task to call function n times (0=forever) diskFormat "device" Format disk diskInit "device" Initialize file system on disk squeeze "device" Squeeze free space on RT-11 device NOTE: Arguments specifying <task> can be either task ID or name.
N/A
usrLib, VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell
netHelp( ) - print a synopsis of network routines
void netHelp (void)
This command prints a brief synopsis of network facilities that are typically called from the shell.
hostAdd "hostname","inetaddr" - add a host to remote host table; "inetaddr" must be in standard Internet address format e.g. "90.0.0.4" hostShow - print current remote host table netDevCreate "devname","hostname",protocol - create an I/O device to access files on the specified host (protocol 0=rsh, 1=ftp) routeAdd "destaddr","gateaddr" - add route to route table routeDelete "destaddr","gateaddr" - delete route from route table routeShow - print current route table iam "usr"[,"passwd"] - specify the user name by which you will be known to remote hosts (and optional password) whoami - print the current remote ID rlogin "host" - log in to a remote host; "host" can be inet address or host name in remote host table ifShow ["ifname"] - show info about network interfaces inetstatShow - show all Internet protocol sockets tcpstatShow - show statistics for TCP udpstatShow - show statistics for UDP ipstatShow - show statistics for IP icmpstatShow - show statistics for ICMP arptabShow - show a list of known ARP entries mbufShow - show mbuf statistics EXAMPLE: -> hostAdd "wrs", "90.0.0.2" -> netDevCreate "wrs:", "wrs", 0 -> iam "fred" -> copy <wrs:/etc/passwd /* copy file from host "wrs" */ -> rlogin "wrs" /* rlogin to host "wrs" */
N/A
usrLib, VxWorks Programmer's Guide: Target Shell
bootChange( ) - change the boot line
void bootChange (void)
This command changes the boot line used in the boot ROMs. This is useful during a remote login session. After changing the boot parameters, you can reboot the target with the reboot( ) command, and then terminate your login ( ~. ) and remotely log in again. As soon as the system has rebooted, you will be logged in again.
This command stores the new boot line in non-volatile RAM, if the target has it.
N/A
usrLib, windsh, Tornado User's Guide: Shell
periodRun( ) - call a function periodically
void periodRun ( int secs, /* no. of seconds to delay between calls */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command repeatedly calls a specified function, with up to eight of its arguments, delaying the specified number of seconds between calls.
Normally, this routine is called only by period( ), which spawns it as a task.
N/A
usrLib, period( ), VxWorks Programmer's Guide: Target Shell
period( ) - spawn a task to call a function periodically
int period ( int secs, /* period in seconds */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command spawns a task that repeatedly calls a specified function, with up to eight of its arguments, delaying the specified number of seconds between calls.
For example, to have i( ) display task information every 5 seconds, just type:
-> period 5, i
The task is spawned using the sp( ) routine. See the description of sp( ) for details about priority, options, stack size, and task ID.
A task ID, or ERROR if the task cannot be spawned.
usrLib, periodRun( ), sp( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
repeatRun( ) - call a function repeatedly
void repeatRun ( int n, /* no. of times to call func (0=forever) */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command calls a specified function n times, with up to eight of its arguments. If n is 0, the routine is called endlessly.
Normally, this routine is called only by repeat( ), which spawns it as a task.
N/A
usrLib, repeat( ), VxWorks Programmer's Guide: Target Shell
repeat( ) - spawn a task to call a function repeatedly
int repeat ( int n, /* no. of times to call func (0=forever) */ FUNCPTR func, /* function to call repeatedly */ int arg1, /* first of eight args to pass to func */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )
This command spawns a task that calls a specified function n times, with up to eight of its arguments. If n is 0, the routine is called endlessly, or until the spawned task is deleted.
The task is spawned using sp( ). See the description of sp( ) for details about priority, options, stack size, and task ID.
A task ID, or ERROR if the task cannot be spawned.
usrLib, repeatRun( ), sp( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
sp( ) - spawn a task with default parameters
int sp ( FUNCPTR func, /* function to call */ int arg1, /* first of nine args to pass to spawned task */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9 )
This command spawns a specified function as a task with the following defaults:
- priority:
stack size: 20,000 bytes
task ID: highest not currently used
task options: VX_FP_TASK - execute with floating-point coprocessor support.
task name: A name of the form tN where N is an integer which increments as new tasks are spawned, e.g., t1, t2, t3, etc. The task ID is displayed after the task is spawned.
This command is a short form of the underlying taskSpawn( ) routine, convenient for spawning tasks in which the default parameters are satisfactory. If the default parameters are unacceptable, taskSpawn( ) should be called directly.
A task ID, or ERROR if the task cannot be spawned.
usrLib, taskLib, taskSpawn( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
VARARGS1
checkStack( ) - print a summary of each task's stack usage
void checkStack ( int taskNameOrId /* task name or task ID; 0 = summarize all */ )
This command displays a summary of stack usage for a specified task, or for all tasks if no argument is given. The summary includes the total stack size (SIZE), the current number of stack bytes used (CUR), the maximum number of stack bytes used (HIGH), and the number of bytes never used at the top of the stack (MARGIN = SIZE - HIGH). For example:
-> checkStack tShell NAME ENTRY TID SIZE CUR HIGH MARGIN ------------ ------------ -------- ----- ----- ----- ------ tShell _shell 23e1c78 9208 832 3632 5576The maximum stack usage is determined by scanning down from the top of the stack for the first byte whose value is not 0xee. In VxWorks, when a task is spawned, all bytes of a task's stack are initialized to 0xee.
It is possible for a task to write beyond the end of its stack, but not write into the last part of its stack. This will not be detected by checkStack( ).
N/A
usrLib, taskSpawn( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
i( ) - print a summary of each task's TCB
void i ( int taskNameOrId /* task name or task ID, 0 = summarize all */ )
This command displays a synopsis of all the tasks in the system. The ti( ) routine provides more complete information on a specific task.
Both i( ) and ti( ) use taskShow( ); see the documentation for taskShow( ) for a description of the output format.
-> i NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- ---------- -------- --- --------- ------- -------- ----- ----- tExcTask _excTask 20fcb00 0 PEND 200c5fc 20fca6c 0 0 tLogTask _logTask 20fb5b8 0 PEND 200c5fc 20fb520 0 0 tShell _shell 20efcac 1 READY 201dc90 20ef980 0 0 tRlogind _rlogind 20f3f90 2 PEND 2038614 20f3db0 0 0 tTelnetd _telnetd 20f2124 2 PEND 2038614 20f2070 0 0 tNetTask _netTask 20f7398 50 PEND 2038614 20f7340 0 0 value = 57 = 0x39 = '9'
This command should be used only as a debugging aid, since the information is obsolete by the time it is displayed.
N/A
usrLib, ti( ), taskShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
ti( ) - print complete information from a task's TCB
void ti ( int taskNameOrId /* task name or task ID; 0 = use default */ )
This command prints the task control block (TCB) contents, including registers, for a specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed.
The ti( ) routine uses taskShow( ); see the documentation for taskShow( ) for a description of the output format.
The following shows the TCB contents for the shell task:
-> ti NAME ENTRY TID PRI STATUS PC SP ERRNO DELAY ---------- --------- -------- --- --------- -------- -------- ------ ----- tShell _shell 20efcac 1 READY 201dc90 20ef980 0 0 stack: base 0x20efcac end 0x20ed59c size 9532 high 1452 margin 8080 options: 0x1e VX_UNBREAKABLE VX_DEALLOC_STACK VX_FP_TASK VX_STDIO D0 = 0 D4 = 0 A0 = 0 A4 = 0 D1 = 0 D5 = 0 A1 = 0 A5 = 203a084 SR = 3000 D2 = 0 D6 = 0 A2 = 0 A6 = 20ef9a0 PC = 2038614 D3 = 0 D7 = 0 A3 = 0 A7 = 20ef980 value = 34536868 = 0x20efda4
N/A
usrLib, taskShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
show( ) - print information on a specified object
void show ( int objId, /* object ID */ int level /* information level */ )
This command prints information on the specified object. System objects include tasks, local and shared semaphores, local and shared message queues, local and shared memory partitions, watchdogs, and symbol tables. An information level is interpreted by the objects show routine on a class by class basis. Refer to the object's library manual page for more information.
N/A
usrLib, i( ), ti( ), lkup( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
ts( ) - suspend a task
void ts ( int taskNameOrId /* task name or task ID */ )
This command suspends the execution of a specified task. It simply calls taskSuspend( ).
N/A
usrLib, tr( ), taskSuspend( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
tr( ) - resume a task
void tr ( int taskNameOrId /* task name or task ID */ )
This command resumes the execution of a suspended task. It simply calls taskResume( ).
N/A
usrLib, ts( ), taskResume( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
td( ) - delete a task
void td ( int taskNameOrId /* task name or task ID */ )
This command deletes a specified task. It simply calls taskDelete( ).
N/A
usrLib, taskDelete( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
version( ) - print VxWorks version information
void version (void)
This command prints the VxWorks version number, the date this copy of VxWorks was made, and other pertinent information.
-> version VxWorks (for Mizar 7170) version 5.1 Kernel: WIND version 2.1. Made on Tue Jul 27 20:26:23 CDT 1997. Boot line: enp(0,0)host:/usr/wpwr/target/config/mz7170/vxWorks e=90.0.0.50 h=90.0.0.4 u=target value = 1 = 0x1
N/A
usrLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
m( ) - modify memory
void m ( void * adrs, /* address to change */ int width /* width of unit to be modified (1, 2, 4, 8) */ )
This command prompts the user for modifications to memory in byte, short word, or long word specified by width, starting at the specified address. It prints each address and the current contents of that address, in turn. If adrs or width is zero or absent, it defaults to the previous value. The user can respond in one of several ways:
- RETURN
- Do not change this address, but continue, prompting at the next address.
- number
- Set the content of this address to number.
- . (dot)
- Do not change this address, and quit.
- EOF
- Do not change this address, and quit.
All numbers entered and displayed are in hexadecimal.
N/A
usrLib, mRegs( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
d( ) - display memory
void d ( void * adrs, /* address to display (if 0, display next block */ int nunits, /* number of units to print (if 0, use default) */ int width /* width of displaying unit (1, 2, 4, 8) */ )
This command displays the contents of memory, starting at adrs. If adrs is omitted or zero, d( ) displays the next memory block, starting from where the last d( ) command completed.
Memory is displayed in units specified by width. If nunits is omitted or zero, the number of units displayed defaults to last use. If nunits is non-zero, that number of units is displayed and that number then becomes the default. If width is omitted or zero, it defaults to the previous value. If width is an invalid number, it is set to 1. The valid values for width are 1, 2, 4, and 8. The number of units d( ) displays is rounded up to the nearest number of full lines.
N/A
usrLib, m( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
cd( ) - change the default directory
STATUS cd ( char * name /* new directory name */ )
This command sets the default directory to name. The default directory is a device name, optionally followed by a directory local to that device.
To change to a different directory, specify one of the following:
- an entire path name with a device name, possibly followed by a directory name. The entire path name will be changed.
- a directory name starting with a ~ or / or $. The directory part of the path, immediately after the device name, will be replaced with the new directory name.
- a directory name to be appended to the current default directory. The directory name will be appended to the current default directory.
An instance of ".." indicates one level up in the directory tree.
Note that when accessing a remote file system via RSH or FTP, the VxWorks network device must already have been created using netDevCreate( ).
The cd( ) command does very little checking that name represents a valid path. If the path is invalid, cd( ) may return OK, but subsequent calls that depend on the default path will fail.
The following example changes the directory to device /fd0/:
-> cd "/fd0/"This example changes the directory to device wrs: with the local directory ~leslie/target:-> cd "wrs:~leslie/target"After the previous command, the following changes the directory to wrs:~leslie/target/config:-> cd "config"After the previous command, the following changes the directory to wrs:~leslie/target/demo:-> cd "../demo"After the previous command, the following changes the directory to wrs:/etc.-> cd "/etc"Note that ~ can be used only on network devices (RSH or FTP).
OK or ERROR.
usrLib, pwd( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell
pwd( ) - print the current default directory
void pwd (void)
This command displays the current working device/directory.
N/A
usrLib, cd( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
copy( ) - copy in (or stdin) to out (or stdout)
STATUS copy ( char * in, /* name of file to read (if NULL assume stdin) */ char * out /* name of file to write (if NULL assume stdout) */ )
This command copies from the input file to the output file, until an end-of-file is reached.
The following example displays the file dog, found on the default file device:
-> copy <dogThis example copies from the console to the file dog, on device /ct0/, until an EOF (default CTRL-D) is typed:-> copy >/ct0/dogThis example copies the file dog, found on the default file device, to device /ct0/:-> copy <dog >/ct0/dogThis example makes a conventional copy from the file named file1 to the file named file2:-> copy "file1", "file2"Remember that standard input and output are global; therefore, spawning the first three constructs will not work as expected.
OK, or ERROR if in or out cannot be opened/created, or if there is an error copying from in to out.
usrLib, copyStreams( ), tyEOFSet( ), VxWorks Programmer's Guide: Target Shell
copyStreams( ) - copy from/to specified streams
STATUS copyStreams ( int inFd, /* file descriptor of stream to copy from */ int outFd /* file descriptor of stream to copy to */ )
This command copies from the stream identified by inFd to the stream identified by outFd until an end of file is reached in inFd. This command is used by copy( ).
OK, or ERROR if there is an error reading from inFd or writing to outFd.
usrLib, copy( ), VxWorks Programmer's Guide: Target Shell
diskFormat( ) - format a disk
STATUS diskFormat ( char * devName /* name of the device to initialize */ )
This command formats a disk and creates a file system on it. The device must already have been created by the device driver and initialized for use with a particular file system, via dosFsDevInit( ) or rt11FsDevInit( ).
This command calls ioctl( ) to perform the FIODISKFORMAT function.
-> diskFormat "/fd0/"
OK, or ERROR if the device cannot be opened or formatted.
usrLib, dosFsLib, rt11FsLib, VxWorks Programmer's Guide: Target Shell
diskInit( ) - initialize a file system on a block device
STATUS diskInit ( char * devName /* name of the device to initialize */ )
This command creates a new, blank file system on a block device. The device must already have been created by the device driver and initialized for use with a particular file system, via dosFsDevInit( ) or rt11FsDevInit( ).
This command calls ioctl( ) to perform the FIODISKINIT function.
-> diskInit "/fd0/"
OK, or ERROR if the device cannot be opened or initialized.
usrLib, dosFsLib, rt11FsLib, VxWorks Programmer's Guide: Target Shell
squeeze( ) - reclaim fragmented free space on an RT-11 volume
STATUS squeeze ( char * devName /* RT-11 device to squeeze, e.g., "/fd0/" */ )
This command moves data around on an RT-11 volume so that any areas of free space are merged.
No device files should be open when this procedure is called. The subsequent condition of such files would be unknown and writing to them could corrupt the entire disk.
OK, or ERROR if the device cannot be opened or squeezed.
usrLib, VxWorks Programmer's Guide: Target Shell
ld( ) - load an object module into memory
MODULE_ID ld ( int syms, /* -1, 0, or 1 */ BOOL noAbort, /* TRUE = don't abort script on error */ char * name /* name of object module, NULL = standard input */ )
This command loads an object module from a file or from standard input. The object module must be in UNIX a.out format. External references in the module are resolved during loading. The syms parameter determines how symbols are loaded; possible values are:
0 - Add global symbols to the system symbol table.
1 - Add global and local symbols to the system symbol table.
-1 - Add no symbols to the system symbol table.If there is an error during loading (e.g., externals undefined, too many symbols, etc.), then shellScriptAbort( ) is called to stop any script that this routine was called from. If noAbort is TRUE, errors are noted but ignored.
The normal way of using ld( ) is to load all symbols (syms = 1) during debugging and to load only global symbols later.
The following example loads the a.out file module from the default file device into memory, and adds any global symbols to the symbol table:
-> ld <moduleThis example loads test.o with all symbols:-> ld 1,0,"test.o"
MODULE_ID, or NULL if there are too many symbols, the object file format is invalid, or there is an error reading the file.
usrLib, loadLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
ls( ) - list the contents of a directory
STATUS ls ( char * dirName, /* name of dir to list */ BOOL doLong /* if TRUE, do long listing */ )
This command is similar to UNIX ls. It lists the contents of a directory in one of two formats. If doLong is FALSE, only the names of the files (or subdirectories) in the specified directory are displayed. If doLong is TRUE, then the file name, size, date, and time are displayed. For a long listing, any entries that describe subdirectories are also flagged with the label "DIR".
The dirName parameter specifies which directory to list. If dirName is omitted or NULL, the current working directory is listed.
Empty directory entries and dosFs volume label entries are not reported.
When used with netDrv devices (FTP or RSH), doLong has no effect.
OK or ERROR.
OK
usrLib, ll( ), lsOld( ), stat( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell
ll( ) - do a long listing of directory contents
STATUS ll ( char * dirName /* name of directory to list */ )
This command causes a long listing of a directory's contents to be displayed. It is equivalent to:
-> ls dirName, TRUE
When used with netDrv devices (FTP or RSH), ll( ) does not give directory information. It is equivalent to an ls( ) call with no long-listing option.
OK or ERROR.
usrLib, ls( ), stat( ), VxWorks Programmer's Guide: Target Shell
lsOld( ) - list the contents of an RT-11 directory
STATUS lsOld ( char * dirName /* device to list */ )
This command is the old version of ls( ), which used the old-style ioctl( ) function FIODIRENTRY to get information about entries in a directory. Since VxWorks 5.0, a new version of ls( ), which uses POSIX directory and file functions, has replaced the older routine.
This version remains in the system to support certain drivers that do not currently support the POSIX directory and file functions. This includes netDrv, which provides the Remote Shell (RSH) and File Transfer Protocol (FTP) mode remote file access (although nfsDrv, which uses NFS, does support the directory calls). Also, the new ls( ) no longer reports empty directory entries on RT-11 disks (i.e., the entries that describe unallocated sections of an RT-11 disk).
If no directory name is specified, the current working directory is listed.
OK, or ERROR if the directory cannot be opened.
usrLib, ls( ), VxWorks Programmer's Guide: Target Shell
mkdir( ) - make a directory
STATUS mkdir ( char * dirName /* directory name */ )
This command creates a new directory in a hierarchical file system. The dirName string specifies the name to be used for the new directory, and can be either a full or relative pathname.
This call is supported by the VxWorks NFS and dosFs file systems.
OK, or ERROR if the directory cannot be created.
usrLib, rmdir( ), VxWorks Programmer's Guide: Target Shell
rmdir( ) - remove a directory
STATUS rmdir ( char * dirName /* name of directory to remove */ )
This command removes an existing directory from a hierarchical file system. The dirName string specifies the name of the directory to be removed, and may be either a full or relative pathname.
This call is supported by the VxWorks NFS and dosFs file systems.
OK, or ERROR if the directory cannot be removed.
usrLib, mkdir( ), VxWorks Programmer's Guide: Target Shell
rm( ) - remove a file
STATUS rm ( char * fileName /* name of file to remove */ )
This command is provided for UNIX similarity. It simply calls remove( ).
OK, or ERROR if the file cannot be removed.
usrLib, remove( ), VxWorks Programmer's Guide: Target Shell
devs( ) - list all system-known devices
void devs (void)
This command displays a list of all devices known to the I/O system.
N/A
usrLib, iosDevShow( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
lkup( ) - list symbols
void lkup ( char * substr /* substring to match */ )
This command lists all symbols in the system symbol table whose names contain the string substr. If substr is omitted or is 0, a short summary of symbol table statistics is printed. If substr is the empty string (""), all symbols in the table are listed.
This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).
By default, lkup( ) displays 22 symbols at a time. This can be changed by modifying the global variable symLkupPgSz. If this variable is set to 0, lkup( ) displays all the symbols without interruption.
N/A
usrLib, symLib, symEach( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
lkAddr( ) - list symbols whose values are near a specified value
void lkAddr ( unsigned int addr /* address around which to look */ )
This command lists the symbols in the system symbol table that are near a specified value. The symbols that are displayed include:
- symbols whose values are immediately less than the specified value
- symbols with the specified value
- succeeding symbols, until at least 12 symbols have been displayed
This command also displays symbols that are local, i.e., symbols found in the system symbol table only because their module was loaded by ld( ).
N/A
usrLib, symLib, symEach( ), VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
mRegs( ) - modify registers
STATUS mRegs ( char * regName, /* register name, NULL for all */ int taskNameOrId /* task name or task ID, 0 = default task */ )
This command modifies the specified register for the specified task. If taskNameOrId is omitted or zero, the last task referenced is assumed. If the specified register is not found, it prints out the valid register list and returns ERROR. If no register is specified, it sequentially prompts the user for new values for a task's registers. It displays each register and the current contents of that register, in turn. The user can respond in one of several ways:
- RETURN
- Do not change this register, but continue, prompting at the next register.
- number
- Set this register to number.
- . (dot)
- Do not change this register, and quit.
- EOF
- Do not change this register, and quit.
All numbers are entered and displayed in hexadecimal, except floating-point values, which may be entered in double precision.
OK, or ERROR if the task or register does not exist.
usrLib, m( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell
pc( ) - return the contents of the program counter
int pc ( int task /* task ID */ )
This command extracts the contents of the program counter for a specified task from the task's TCB. If task is omitted or 0, the current task is used.
The contents of the program counter.
usrLib, ti( ), VxWorks Programmer's Guide: Target Shell
printErrno( ) - print the definition of a specified error status value
void printErrno ( int errNo /* status code whose name is to be printed */ )
This command displays the error-status string, corresponding to a specified error-status value. It is only useful if the error-status symbol table has been built and included in the system. If errNo is zero, then the current task status is used by calling errnoGet( ).
This facility is described in errnoLib.
N/A
usrLib, errnoLib, errnoGet( ), VxWorks Programmer's Guide: Target Shell windsh, Tornado User's Guide: Shell
printLogo( ) - print the VxWorks logo
void printLogo (void)
This command displays the VxWorks banner seen at boot time. It also displays the VxWorks version number and kernel version number.
N/A
usrLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
logout( ) - log out of the VxWorks system
void logout (void)
This command logs out of the VxWorks shell. If a remote login is active (via rlogin or telnet), it is stopped, and standard I/O is restored to the console.
usrLib, rlogin( ), telnet( ), shellLogout( ), VxWorks Programmer's Guide: Target Shell
h( ) - display or set the size of shell history
void h ( int size /* 0 = display, >0 = set history to new size */ )
This command displays or sets the size of VxWorks shell history. If no argument is specified, shell history is displayed. If size is specified, that number of the most recent commands is saved for display. The value of size is initially 20.
N/A
usrLib, shellHistory( ), ledLib, VxWorks Programmer's Guide: Target Shell, windsh, Tornado User's Guide: Shell
spyReport( ) - display task activity data
void spyReport (void)
This routine reports on data gathered at interrupt level for the amount of CPU time utilized by each task, the amount of time spent at interrupt level, the amount of time spent in the kernel, and the amount of idle time. Time is displayed in ticks and as a percentage, and the data is shown since both the last call to spyClkStart( ) and the last spyReport( ). If no interrupts have occurred since the last spyReport( ), nothing is displayed.
N/A
usrLib, spyLib, spyClkStart( ), VxWorks Programmer's Guide: Target Shell
spyTask( ) - run periodic task activity reports
void spyTask ( int freq /* reporting frequency, in seconds */ )
This routine is spawned as a task by spy( ) to provide periodic task activity reports. It prints a report, delays for the specified number of seconds, and repeats.
N/A
usrLib, spyLib, spy( ), VxWorks Programmer's Guide: Target Shell
spy( ) - begin periodic task activity reports
void spy ( int freq, /* reporting freq in sec, 0 = default of 5 */ int ticksPerSec /* interrupt clock freq, 0 = default of 100 */ )
This routine collects task activity data and periodically runs spyReport( ). Data is gathered ticksPerSec times per second, and a report is made every freq seconds. If freq is zero, it defaults to 5 seconds. If ticksPerSec is omitted or zero, it defaults to 100.
This routine spawns spyTask( ) to do the actual reporting.
It is not necessary to call spyClkStart( ) before running spy( ).
N/A
usrLib, spyLib, spyClkStart( ), spyTask( ), VxWorks Programmer's Guide: Target Shell
spyClkStart( ) - start collecting task activity data
STATUS spyClkStart ( int intsPerSec /* timer interrupt freq, 0 = default of 100 */ )
This routine begins data collection by enabling the auxiliary clock interrupts at a frequency of intsPerSec interrupts per second. If intsPerSec is omitted or zero, the frequency will be 100. Data from previous collections is cleared.
OK, or ERROR if the CPU has no auxiliary clock, or if task create and delete hooks cannot be installed.
usrLib, spyLib, sysAuxClkConnect( ), VxWorks Programmer's Guide: Target Shell
spyClkStop( ) - stop collecting task activity data
void spyClkStop (void)
This routine disables the auxiliary clock interrupts. Data collected remains valid until the next spyClkStart( ) call.
N/A
usrLib, spyLib, spyClkStart( ), VxWorks Programmer's Guide: Target Shell
spyStop( ) - stop spying and reporting
void spyStop (void)
This routine calls spyClkStop( ). Any periodic reporting by spyTask( ) is terminated.
N/A
usrLib, spyLib, spyClkStop( ), spyTask( ), VxWorks Programmer's Guide: Target Shell
spyHelp( ) - display task monitoring help menu
void spyHelp (void)
This routine displays a summary of spyLib utilities:
spyHelp Print this list spyClkStart [ticksPerSec] Start task activity monitor running at ticksPerSec ticks per second spyClkStop Stop collecting data spyReport Prints display of task activity statistics spyStop Stop collecting data and reports spy [freq[,ticksPerSec]] Start spyClkStart and do a report every freq seconds ticksPerSec defaults to 100. freq defaults to 5 seconds.
N/A