📄 usrlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/usrLib.html - generated by refgen from usrLib.c --> <title> usrLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>usrLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>usrLib</strong> - user interface subroutine library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./usrLib.html#help">help</a></i>( )</b> - print a synopsis of selected routines<br><b><i><a href="./usrLib.html#netHelp">netHelp</a></i>( )</b> - print a synopsis of network routines<br><b><i><a href="./usrLib.html#bootChange">bootChange</a></i>( )</b> - change the boot line<br><b><i><a href="./usrLib.html#periodRun">periodRun</a></i>( )</b> - call a function periodically<br><b><i><a href="./usrLib.html#period">period</a></i>( )</b> - spawn a task to call a function periodically<br><b><i><a href="./usrLib.html#repeatRun">repeatRun</a></i>( )</b> - call a function repeatedly<br><b><i><a href="./usrLib.html#repeat">repeat</a></i>( )</b> - spawn a task to call a function repeatedly<br><b><i><a href="./usrLib.html#sp">sp</a></i>( )</b> - spawn a task with default parameters<br><b><i><a href="./usrLib.html#checkStack">checkStack</a></i>( )</b> - print a summary of each task's stack usage<br><b><i><a href="./usrLib.html#i">i</a></i>( )</b> - print a summary of each task's TCB<br><b><i><a href="./usrLib.html#ti">ti</a></i>( )</b> - print complete information from a task's TCB<br><b><i><a href="./usrLib.html#show">show</a></i>( )</b> - print information on a specified object<br><b><i><a href="./usrLib.html#ts">ts</a></i>( )</b> - suspend a task<br><b><i><a href="./usrLib.html#tr">tr</a></i>( )</b> - resume a task<br><b><i><a href="./usrLib.html#td">td</a></i>( )</b> - delete a task<br><b><i><a href="./usrLib.html#version">version</a></i>( )</b> - print VxWorks version information<br><b><i><a href="./usrLib.html#m">m</a></i>( )</b> - modify memory<br><b><i><a href="./usrLib.html#d">d</a></i>( )</b> - display memory<br><b><i><a href="./usrLib.html#cd">cd</a></i>( )</b> - change the default directory<br><b><i><a href="./usrLib.html#pwd">pwd</a></i>( )</b> - print the current default directory<br><b><i><a href="./usrLib.html#copy">copy</a></i>( )</b> - copy <i>in</i> (or stdin) to <i>out</i> (or stdout)<br><b><i><a href="./usrLib.html#copyStreams">copyStreams</a></i>( )</b> - copy from/to specified streams<br><b><i><a href="./usrLib.html#diskFormat">diskFormat</a></i>( )</b> - format a disk<br><b><i><a href="./usrLib.html#diskInit">diskInit</a></i>( )</b> - initialize a file system on a block device<br><b><i><a href="./usrLib.html#squeeze">squeeze</a></i>( )</b> - reclaim fragmented free space on an RT-11 volume<br><b><i><a href="./usrLib.html#ld">ld</a></i>( )</b> - load an object module into memory<br><b><i><a href="./usrLib.html#ls">ls</a></i>( )</b> - list the contents of a directory<br><b><i><a href="./usrLib.html#ll">ll</a></i>( )</b> - do a long listing of directory contents<br><b><i><a href="./usrLib.html#lsOld">lsOld</a></i>( )</b> - list the contents of an RT-11 directory<br><b><i><a href="./usrLib.html#mkdir">mkdir</a></i>( )</b> - make a directory<br><b><i><a href="./usrLib.html#rmdir">rmdir</a></i>( )</b> - remove a directory<br><b><i><a href="./usrLib.html#rm">rm</a></i>( )</b> - remove a file<br><b><i><a href="./usrLib.html#devs">devs</a></i>( )</b> - list all system-known devices<br><b><i><a href="./usrLib.html#lkup">lkup</a></i>( )</b> - list symbols<br><b><i><a href="./usrLib.html#lkAddr">lkAddr</a></i>( )</b> - list symbols whose values are near a specified value<br><b><i><a href="./usrLib.html#mRegs">mRegs</a></i>( )</b> - modify registers<br><b><i><a href="./usrLib.html#pc">pc</a></i>( )</b> - return the contents of the program counter<br><b><i><a href="./usrLib.html#printErrno">printErrno</a></i>( )</b> - print the definition of a specified error status value<br><b><i><a href="./usrLib.html#printLogo">printLogo</a></i>( )</b> - print the VxWorks logo<br><b><i><a href="./usrLib.html#logout">logout</a></i>( )</b> - log out of the VxWorks system<br><b><i><a href="./usrLib.html#h">h</a></i>( )</b> - display or set the size of shell history<br><b><i><a href="./usrLib.html#spyReport">spyReport</a></i>( )</b> - display task activity data<br><b><i><a href="./usrLib.html#spyTask">spyTask</a></i>( )</b> - run periodic task activity reports<br><b><i><a href="./usrLib.html#spy">spy</a></i>( )</b> - begin periodic task activity reports<br><b><i><a href="./usrLib.html#spyClkStart">spyClkStart</a></i>( )</b> - start collecting task activity data<br><b><i><a href="./usrLib.html#spyClkStop">spyClkStop</a></i>( )</b> - stop collecting task activity data<br><b><i><a href="./usrLib.html#spyStop">spyStop</a></i>( )</b> - stop spying and reporting<br><b><i><a href="./usrLib.html#spyHelp">spyHelp</a></i>( )</b> - display task monitoring help menu<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library consists of routines meant to be executed from the VxWorksshell. It provides useful utilities for task monitoring and execution,system information, symbol table management, etc.<p>Many of the routines here are simply command-oriented interfaces to moregeneral routines contained elsewhere in VxWorks. Users should feel freeto modify or extend this library, and may find it preferable to customizecapabilities by creating a new private library, using this one as a model,and appropriately linking the new one into the system.<p>Some routines here have optional parameters. If those parameters are zero,which is what the shell supplies if no argument is typed, defaultvalues are typically assumed.<p>A number of the routines in this module take an optional task name or IDas an argument. If this argument is omitted or zero, the "current" taskis used. The current task (or "default" task) is the last taskreferenced. The <b><a href="./usrLib.html#top">usrLib</a></b> library uses <b><i><a href="./taskInfo.html#taskIdDefault">taskIdDefault</a></i>( )</b> to set and get thelast-referenced task ID, as do many other VxWorks routines.<p></blockquote><h4>NOTE</h4><blockquote><p>This library uses a small number of undocumented VxWorks internal routines.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>usrLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><a href="./spyLib.html#top">spyLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell, </i>windsh, <i>Tornado User's Guide: Shell</i><hr><a name="help"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>help</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>help</i>( )</strong> - print a synopsis of selected routines</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void help (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command prints the following list of the calling sequences forcommonly used routines, mostly contained in usrLib.<pre>help Print this listdbgHelp Print debug help infonfsHelp Print nfs help infonetHelp Print network help infospyHelp Print task histogrammer help infotimexHelp Print execution timer help infoh [n] Print (or set) shell historyi [task] Summary of tasks' TCBsti task Complete info on TCB for tasksp adr,args... Spawn a task, pri=100, opt=0, stk=20000taskSpawn name,pri,opt,stk,adr,args... Spawn a tasktd task Delete a taskts task Suspend a tasktr task Resume a taskd [adr[,nunits[,width]]] Display memorym adr[,width] Modify memorymRegs [reg[,task]] Modify a task's registers interactivelypc [task] Return task's program counterversion Print VxWorks version info, and boot lineiam "user"[,"passwd"] Set user name and passwdwhoami Print user namecd "path" Set current working pathpwd Print working pathdevs List devicesls ["path"[,long]] List contents of directoryll ["path"] List contents of directory - long formatrename "old","new" Change name of filecopy ["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 tablelkAddr address List symbol table entries near addresscheckStack [task] List task stack sizes and usageprintErrno value Print the name of a status valueperiod secs,adr,args... Spawn task to call function periodicallyrepeat n,adr,args... Spawn task to call function n times (0=forever)diskFormat "device" Format diskdiskInit "device" Initialize file system on disksqueeze "device" Squeeze free space on RT-11 deviceNOTE: Arguments specifying <task> can be either task ID or name.</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell</i>windsh, <i>Tornado User's Guide: Shell</i><hr><a name="netHelp"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>netHelp</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>netHelp</i>( )</strong> - print a synopsis of network routines</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void netHelp (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command prints a brief synopsis of network facilities that aretypically called from the shell.<pre>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 tablenetDevCreate "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 tablerouteDelete "destaddr","gateaddr" - delete route from route tablerouteShow - print current route tableiam "usr"[,"passwd"] - specify the user name by which you will be known to remote hosts (and optional password)whoami - print the current remote IDrlogin "host" - log in to a remote host; "host" can be inet address or host name in remote host tableifShow ["ifname"] - show info about network interfacesinetstatShow - show all Internet protocol socketstcpstatShow - show statistics for TCPudpstatShow - show statistics for UDPipstatShow - show statistics for IPicmpstatShow - show statistics for ICMParptabShow - show a list of known ARP entriesmbufShow - show mbuf statisticsEXAMPLE: -> 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" */</pre></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="bootChange"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>bootChange</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bootChange</i>( )</strong> - change the boot line</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void bootChange (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command changes the boot line used in the boot ROMs. This is usefulduring a remote login session. After changing the boot parameters, youcan reboot the target with the <b><i><a href="./rebootLib.html#reboot">reboot</a></i>( )</b> command, and then terminate yourlogin ( ~. ) and remotely log in again. As soon as the system hasrebooted, you will be logged in again.<p>This command stores the new boot line in non-volatile RAM, if the targethas it.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, windsh, <i>Tornado User's Guide: Shell</i><hr><a name="periodRun"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>periodRun</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>periodRun</i>( )</strong> - call a function periodically</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>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 )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command repeatedly calls a specified function, with up to eight of itsarguments, delaying the specified number of seconds between calls.<p>Normally, this routine is called only by <b><i><a href="./usrLib.html#period">period</a></i>( )</b>, which spawnsit as a task.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./usrLib.html#top">usrLib</a></b>, <b><i><a href="./usrLib.html#period">period</a></i>( )</b>, <i>VxWorks Programmer's Guide: Target Shell</i><hr><a name="period"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>period</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>period</i>( )</strong> - spawn a task to call a function periodically</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>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 )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This command spawns a task that repeatedly calls a specified function,with up to eight of its arguments, delaying the specified number ofseconds between calls.<p>For example, to have <b><i><a href="./usrLib.html#i">i</a></i>( )</b> display task information every 5 seconds,just type:<pre> -> period 5, i</pre></blockquote><h4>NOTE</h4><blockquote><p>The task is spawned using the <b><i><a href="./usrLib.html#sp">sp</a></i>( )</b> routine. See the descriptionof <b><i><a href="./usrLib.html#sp">sp</a></i>( )</b> for details about priority, options, stack size, and task ID.<p></blockquote><h4>RETURNS</h4><blockquote><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -