Vxworks Command Cheat Sheet

VxWorks is a premier real-time operating system (RTOS) used in everything from Mars rovers to industrial controllers. Navigating its shell is a fundamental skill for any embedded engineer. This cheat sheet serves as a comprehensive reference for the most essential VxWorks commands, ranging from basic task management to advanced system debugging. The VxWorks Shell Environment

The VxWorks shell (typically the C-style interpreter) has unique syntax rules:

Strings must be quoted: Commands like cd "/ata0" require double quotes.

Arguments are comma-separated: Use sp myFunc, arg1, arg2 instead of spaces. Case Sensitivity: Most commands are case-sensitive. 1. Task Management & Information

Tasks are the "threads" of VxWorks. These commands help you spawn, monitor, and control them. VxWorks Command Cheat Sheet | PDF | Booting - Scribd

VxWorks is a real-time operating system (RTOS) that provides a powerful command-line interface, typically accessed via the Kernel Shell (windsh or the target-resident shell) or the User-Mode Shell (cmd) for Real-Time Processes (RTPs). Core Shell Basics

C-Interpreter Syntax: In the standard kernel shell, commands are C-function calls.

Strings must be enclosed in double quotes (e.g., cd "temp").

Arguments are separated by commas (e.g., sp functionName, arg1, arg2).

Switching Shells: In modern versions like VxWorks 7, use the cmd command to switch from the C-interpreter to a more traditional Unix-like command shell. Task Management VxWorks Command Cheat Sheet | PDF | Booting - Scribd

Managing a real-time operating system (RTOS) like VxWorks requires a specialized set of commands, primarily executed through its Kernel Shell

. Unlike standard Linux or Windows prompts, the VxWorks shell often allows you to call C functions directly as commands, meaning syntax usually requires parentheses and quoted strings. Stack Overflow Essential Task Management

These commands allow you to control and monitor individual processes (tasks) in the system.

: Displays a summary of all active tasks, including their IDs and status. sp(entryPt, arg1, ...) : Spawns a new task starting at the specified function. td(taskId) : Deletes a task by its ID or name. ts(taskId) : Suspends a task, pausing its execution. tr(taskId) : Resumes a suspended task. ti(taskId)

: Displays detailed information from the Task Control Block (TCB), including register values. tt(taskId) : Shows a task's stack trace, useful for debugging crashes. Google Groups System & Memory Diagnostics

Use these to inspect the target hardware's state and memory contents. d(address, units, width)

: Dumps memory contents starting at a specific hexadecimal address. m(address, width) : Modifies memory at a given address interactively.

: Displays overall system memory usage, including free and allocated blocks.

: Lists all hardware devices currently recognized by the system. lkup "string"

: Searches the system symbol table for functions or variables containing that string. printErrno(value)

: Decodes a numeric error code into a human-readable description. Stack Overflow Networking Commands For troubleshooting connectivity and protocol stacks: VxWorks Command Cheat Sheet | PDF | Booting - Scribd vxworks command cheat sheet

Essential VxWorks Shell Command Cheat Sheet Navigating the VxWorks RTOS environment requires familiarity with its command-line interfaces. Whether you are using the Kernel Shell (resident on the target) or the Host Shell

(running on your development station), these commands are essential for debugging, task management, and system interrogation. 1. Task Management & Information Manage the lifecycle and execution of real-time tasks. : Displays a synopsis of all running tasks in the system. sp (entryPt, args) : Spawns a task with default parameters. sps (entryPt, args) : Spawns a task and leaves it in a suspended state. td (taskId) : Deletes a specific task. ts (taskId) : Suspends a task. tr (taskId) : Resumes a suspended task. ti (taskId)

: Shows detailed information from the Task Control Block (TCB). tt (taskId) : Displays a stack trace for the specified task. checkStack (taskId) : Prints a summary of a task's stack usage. 2. System Interrogation & Diagnostics

Gather data about the hardware environment and system status. : Lists all devices currently known on the target. lkup "string"

: Searches the system symbol table for symbols matching the string. : Displays a summary of system memory usage and statistics. moduleShow : Lists all downloaded or loaded object modules. printErrno(n) : Describes the specified error status value (use for the latest error). iosDevShow : Shows all loaded I/O devices. 3. Memory & Register Modification Interact directly with memory addresses and CPU registers. d (address, n)

: Displays memory contents starting at a specific hex address. m (address)

: Allows manual modification of memory at the specified address. : Allows modification of CPU registers. : Returns the current contents of the program counter. 4. File System & Navigation

Standard utilities for navigating the target's local or remote file systems. : Displays the current default directory. : Changes the default directory. : Lists files in the current directory. mkdir "name" : Creates a new directory. : Deletes a specified file. 5. Shell Control & Utilities : Displays command history or sets the history buffer size. : Prints a synopsis of available shell routines.

: Resets network devices and transfers control back to the boot ROMs. : Loads an object module into memory from a file. unld "module" : Unloads a previously loaded object module. usrLib - the triumf daq wiki


| Command | Description | |---------|-------------| | tr | Trace tasks (context switch logging) | | trc | Start task tracing | | trcStop | Stop task tracing | | b <funcName> | Set breakpoint | | t <taskId> | Show task stack trace | | d | Dump memory | | printf "format", args | Print to console | | logShow | Show system log | | logFdShow | Show log file descriptors |


Note: This is not an exhaustive list, and some commands may have additional options or arguments. Refer to the VxWorks documentation for more information.

The VxWorks C-Shell (or Kernel Shell) is a powerful tool for real-time debugging and system management. Unlike standard Linux shells, it often interprets commands as direct C function calls, meaning strings must be quoted and arguments are separated by commas. 🛠️ Core System & Navigation

These commands help you navigate the environment and check the overall status of the target. Description i Display synopsis of all tasks (Status, Priority, PC, etc.). h History: Shows recent commands (default size is 20). devs List all devices known on the target. ls List directory contents. pwd Show the present working directory. cd "path" Change directory (path must be in quotes). reboot Reboot the processor. printErrno(0) Describe the most recent error status. VxWorks Command Cheat Sheet | PDF | Booting - Scribd

This cheat sheet covers essential commands for managing tasks, memory, and system information within the VxWorks shell environment (WindSh). Task Management i: Displays a summary of all active tasks in the system.

ti "taskName" or taskID: Shows detailed Information for a specific task, including its TCB (Task Control Block).

sp function, arg1, ...: Spawns a new task starting at the specified function with provided arguments. td "taskName" or taskID: Deletes a specific task. ts "taskName" or taskID: Suspends a task. tr "taskName" or taskID: Resumes a suspended task.

tt "taskName" or taskID: Shows a stack trace for the specified task. Memory & Object Information

d address, [nWords]: Displays memory contents starting at a specific address.

m address: Modifies memory at the given address interactively.

memShow: Displays general memory partition statistics, such as free and allocated space. VxWorks is a premier real-time operating system (RTOS)

moduleShow: Lists all currently loaded object modules and programs.

show semaphoreID: Displays information about a specific semaphore. System & File Operations

devs: Lists all devices currently known to the target system.

ls ["directory"]: Lists the contents of the current or specified directory. pwd: Prints the current working directory path. cd "path": Changes the current directory. reboot: Reboots the processor.

lkup "name": Searches for and lists symbols matching the string in the system symbol table.

h [n]: Displays the command history; default size is typically 20.

printErrno status: Describes the meaning of the most recent error status value. Network & Boot

ifShow: Displays the status and configuration of network interfaces. bootParamsShow: Displays the current boot line parameters.

bootChange: Allows interactive modification of the saved boot parameters.

ping "host", [count]: Sends ICMP echo requests to a network host. Shell Syntax Tips

Quotes: Most commands require string arguments (like task names or file paths) to be enclosed in double quotes (e.g., ti "tRoot").

Arguments: Multiple arguments for functions or commands are separated by commas.

VxWorks is a real-time operating system (RTOS) used extensively in embedded systems. Interacting with it often requires the use of its target shell, which supports a variety of commands for task management, memory manipulation, and system diagnostics. Core Shell Commands

These commands are the fundamental tools for navigating and managing the VxWorks environment.

i: Displays a list of all active tasks, including their ID, priority, and current state.

h [n]: Shows a history of the last n commands entered in the shell. If n is 0, it displays the most recent 20 commands.

lkup "string": Searches the system symbol table for functions or variables containing the specified string. This is invaluable for finding "Show" routines.

checkStack: Verifies if any tasks have exceeded their allocated stack space.

version: Displays the current VxWorks kernel version and build date. Task Management

Managing execution flow is critical in an RTOS environment. Use these commands to control tasks. | Command | Description | |---------|-------------| | tr

sp function, [arg1], ..., [arg9]: Spawns a new task. It accepts up to 9 arguments with a default priority of 100. ts taskId: Suspends a specific task by its ID. tr taskId: Resumes a suspended task. td taskId: Deletes a task immediately.

period n, function, [arg1]: Creates a task that runs the specified function cyclically every n seconds.

repeat m, function, [arg1]: Repeats a function m times. Setting m to 0 makes it run indefinitely. Memory and Object Inspection

These commands allow developers to peek into the system's memory and object states.

d [address, [count, [width]]]: Displays memory contents starting at a specific address. You can specify the number of units and the width (1, 2, 4, or 8 bytes).

m address: Allows you to modify memory at a specific address interactively.

memShow: Provides a summary of system memory usage, including free and allocated blocks.

taskShow taskId: Displays detailed information about a specific task, such as its stack usage and registers.

moduleShow: Lists all loaded object modules and their base addresses. Filesystem and Navigation

Standard filesystem operations are supported within the shell for target-based storage.

ls: Lists files and directories in the current working directory.

cd "path": Changes the current directory. Note that strings must often be quoted in the VxWorks shell. pwd: Prints the current working directory. devs: Lists all initialized devices on the system.

copy "source", "dest": Copies a file from one location to another. Network Diagnostics

VxWorks includes tools for monitoring and configuring network interfaces.

ifShow: Displays information about the network interfaces, including IP addresses and packet statistics.

ping "host": Standard utility to test connectivity to another network host. routeShow: Displays the system's current routing table.

For detailed API references and advanced development, you can consult the VxWorks Kernel API Reference or the Wind River Labs documentation. [VxW] VxWorks basic command - Google Groups

  • Debug a stack overflow:

  • Flash or update image:

  • i                     // See all tasks. Look for one with 'PEND' or 'READY'
    ti "myHighTask"       // Inspect stack and PC
    taskSuspend "myHighTask" // Pause it. See if system recovers.
    taskResume "myHighTask"  // Resume.
    taskPrioritySet "myHighTask", 150 // Bump it lower.
    

    | Command | Description | |---------|-------------| | ifconfig | Show network interface config | | ifAddrSet <ifname>, <ip> | Set IP address (e.g., ifAddrSet "fei0", 192.168.1.10) | | routeShow | Show routing table | | ping <ip> | Send ICMP echo | | inetStatShow | Show all TCP/UDP connections | | arpShow | Show ARP cache | | tftpGet <host>, <filename>, <dest> | TFTP download | | tftpPut <host>, <src>, <filename> | TFTP upload |


    Since the shell is a C interpreter, you can declare and print variables:

    int x = 42;               // Declare
    char * msg = "Hello";     // Declare string
    printVal x;               // Print value
    printf("Msg: %s\n", msg); // Use stdio functions
    

    | Command | Description | |---------|-------------| | msgQShow | Show message queues | | msgQSend <qId> <msg> <size> <timeout> | Send a message | | msgQReceive <qId> <buffer> <maxSize> <timeout> | Receive a message |