(using taskOpen( ) with the VX_TASK_NOACTIVATE option also achieves the latter purpose).
6.3 VxWorks System Tasks
Depending on its configuration, VxWorks starts a variety of system tasks at boot time, some of which are always running. The set of tasks associated with a basic configuration of VxWorks, and a few of the tasks associated with commonly used optional components, are described below.
Figure 6-1 Basic Task State Transitions
suspended pended
taskCreate( )
ready delayed
ready pended
ready delayed
ready suspended
pended ready
pended suspended
delayed ready
delayed suspended
suspended ready
suspended pended
suspended delayed
semTake( ) / msgQReceive( ) taskDelay( )
taskSuspend( )
semGive( ) / msgQSend( ) taskSuspend( )
expired delay taskSuspend( )
taskResume( ) / taskActivate( ) taskResume( )
taskResume( ) taskSpawn( )
ready taskSpawn( )
suspended taskCreate( )
! CAUTION: Do not suspend, delete, or change the priority of any of these tasks.
Doing so will result in unpredictable system behavior.
Basic VxWorks Tasks
Root Task
Logging Task
Exception Task
Task Name tRootTask
Priority 0
Triggering Event System startup.
Component N/A
Description The root task is the first task executed by the kernel. The entry point of the root task is usrRoot( ), which initializes most VxWorks facilities. It spawns such tasks as the logging task, the exception task, the network task, and the tRlogind daemon. Normally, the root task terminates after all initialization has completed.
References VxWorks BSP Developer’s Guide.
Task Name tLogTask
Priority 0
Triggering Event A logMsg( ) call from either an ISR context or task context.
Component INCLUDE_LOGGING
Description The log task is used by VxWorks modules to log system messages and messages from an ISR without having to perform I/O in the current task context.
References 11.9 Asynchronous Input/Output, p.279 and the logLib API reference.
Task Name tExcTask
Priority 0
Triggering Event An excJobAdd( ) call from ISR context.
Component INCLUDE_EXC_TASK
Description The exception task executes jobs—that is, function calls—on the behalf of ISRs, as they cannot be performed at interrupt level. It must have the highest priority in the system.
References The excLib API reference entry.
6 Multitasking 6.3 VxWorks System Tasks
Job Task
SMP ISR Task
Network Task
Task Name tJobTask
Priority 0 while waiting for a request.
Triggering Event N/A. All jobs are queued by VxWorks system facilities.
Component INCLUDE_JOB_TASK
Description The job task executes jobs—that is, function calls—on the behalf of tasks. It runs at priority 0 while waiting for a request, and dynamically adjusts its priority to match that of the task that requests job execution. One of its primary purposes is to handle suicidal task deletion (that is, self-deletion of a task).
References 6.5.7 Task Deletion and Deletion Safety, p.101.
Task Name tIsrN
Priority 0
Triggering Event A device interrupt that calls isrDeferJobAdd( ).
Component INCLUDE_ISR_DEFER
Description The tIsrN task (or tasks) execute function calls on behalf of device drivers when those drivers execute
isrDeferJobAdd( ). The N in the task name refers to the index of the CPU on which the deferral task is running. Separate tIsrN tasks are created as needed, each with CPU affinity to CPU N. SMP-aware device drivers defer interrupt-level processing to the tIsrN task that is executing on the local CPU, to avoid the overhead of cross-processor
communication to schedule the deferral task.
References The isrDeferLib API reference entry.
Task Name tNet0
Priority 50 (default).
Triggering Event Packet arrival, transmit completion, network protocol timer expiration, socket application request, and so on.
Component INCLUDE_NET_DAEMON
WDB Target Agent Task
WDB Target Agent Proxy Task
Tasks for Optional Components
The following tasks are examples of some of the additional tasks found in common configurations of VxWorks.
Kernel Shell Task
Task Name tWdbTask
Priority 3 (default).
Triggering Event N/A.
Component INCLUDE_WDB
Description The WDB target agent task is created if the target agent is set to run in task mode. It services requests from the host tools by way of the target server.
References E. WDB Target Agent.
Task Name tWdbProxyTask
Priority 55 (default).
Triggering Event N/A.
Component INCLUDE_WDB_PROXY
Description The proxy allows for communication with the WDB agent when VxWorks is not configured with the network stack. The proxy communicates over TCP/IP with host tools, and supports UDP/IP, TIPC, and MIPC communications with the WDB agent.
References E. WDB Target Agent.
Task Name tShellN
Priority 1 (configurable) Triggering Event System boot (default).
Component INCLUDE_SHELL
6 Multitasking 6.3 VxWorks System Tasks
Kernel Shell Login Task
Kernel Shell Telnet Task
Description The kernel shell is spawned as a task. Any routine or task that is invoked from the kernel shell, rather than spawned, runs in the tShellnum context. The task name for a shell on the console is tShell0. The kernel shell is re-entrant, and more than one shell task can run at a time (hence the number suffix). In addition, if a user logs in remotely (using rlogin or telnet) to a VxWorks target, the name reflects that fact as well. For example, tShellRem1. The tShell basename is configurable, see the VxWorks Kernel Shell User’s Guide.
References VxWorks Kernel Shell User’s Guide.
Task Name tRlogind
Priority 55
Triggering Event New rlogin connection.
Component INCLUDE_RLOGIN
Description The kernel shell login daemon allows remote users to log in to VxWorks. It accepts a remote login request from another VxWorks or host system and spawns tRlogInTask_hexNum and tRlogOutTask_hexNum (where hexNum is a hexadecimal number identifying the connection). These tasks exist as long as the remote user is logged on. In addition, unless the shell is configured in VxWorks 5.5 compatibility mode, the server spawns a remote shell task tShellRemdecNum (where decNum is a decimal number specific to the particular remote shell session).
References The rlogLib API reference entry, the Wind River Network Stack Programmer’s Guide, and the VxWorks Kernel Shell User’s Guide.
Task Name ipcom_telnetd
Priority 50
Triggering Event New telnet connection.
Component INCLUDE_IPTELNETS
RPC Task