Vxworks Command Cheat Sheet !!top!! (2024)

Vxworks Command Cheat Sheet !!top!! (2024)

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

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.

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 vxworks command cheat sheet

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.

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 Essential VxWorks Shell Command Cheat Sheet Navigating the

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

VxWorks is a real-time operating system (RTOS) used in everything from Mars rovers to industrial controllers. Navigating the VxWorks shell (C-Shell or Kernel Shell) is essential for debugging and system management.

Below is a comprehensive cheat sheet for the most essential VxWorks commands. 🛠️ Task and Process Management Manage and monitor tasks running on the kernel.

i: Displays a list of all tasks (Status, Priority, PC, etc.).

ti : Shows detailed information about a specific task.

taskSpawn "", , , , : Spawns a new task. taskSuspend : Pauses a running task. taskResume : Resumes a suspended task. taskDelete : Terminated a task and frees memory.

checkStack : Displays stack usage for a task (0 for all tasks). 🔍 Memory and System Debugging Inspect memory, modify values, and check system health.

d

, , : Display memory content (hex dump). m
, : Modify memory interactively. memShow: Displays the system memory map and free space.

adrSpaceShow: Shows memory context and address space details.

printErrno : Decodes a numeric error code into a readable string. tt : Function call stack trace (Backtrace). 📂 File System and I/O Commands for navigating directories and managing files. ls "": Lists files in a directory. cd "": Changes the current working directory. pwd: Prints the current working directory. copy "", "": Copies a file. rm "": Deletes a file. devs: Lists all mapped devices (e.g., /ata0, /tyCo/0). iosShow: Displays the I/O system status and drivers. 🌐 Network Configuration Configure and troubleshoot network interfaces.

ifShow: Lists all network interfaces and their IP addresses.

inetstatShow: Displays active network connections (similar to netstat). routeShow: Displays the IP routing table.

ping "", : Tests connectivity to a remote host.

arpShow: Displays the ARP (Address Resolution Protocol) table. ⚙️ Symbol Table and Objects Locate functions and variables within the loaded image. Conclusion: Print This Cheat Sheet VxWorks is not Linux

lkup "": Searches the symbol table for names matching the string. ld < : Loads an object module into memory. unld "": Unloads a previously loaded module. reboot: Restarts the system (use with caution). 💡 Quick Tips for the VxWorks Shell

Command History: Use the arrow keys or h to see recent commands.

Tab Completion: Available in newer versions (VxWorks 7) for symbols and files.

Redirecting Output: Use > filename to save command output to a file.

Hex vs Dec: Most shell inputs are interpreted as Hex by default; use 0x to be safe.


Conclusion: Print This Cheat Sheet

VxWorks is not Linux. You cannot grep, awk, or systemctl. But its real-time shell is one of the most powerful debugging environments in existence. You have direct, cycle-accurate control over memory, tasks, and devices.

Keep this cheat sheet at your desk. Bookmark it. When the Mars rover sends back a 0xDEADBEEF or the fighter jet displays a taskDelay loop, these commands will be your lifeline.

8. Debugging and diagnostics

VxWorks shell provides many tools for diagnosing system problems.

  • sp (spawn helper), i (interrupt info), intShow, excShow — Interrupt and exception diagnostics.

    • Usage: intShow(); excShow()
  • printErr, logMsg — Logging primitives to emit runtime messages.

  • stackShow / stackInfo — Inspect stack usage per task.

  • boot parameters and core dump utilities — Capture system state for post-mortem analysis (implementation dependent).

  • objInfo, symFindSymbol — Use symbol inspection to translate addresses during backtraces.

Best practice: enable symbol tables when possible; use logMsg with rates limiting to avoid flooding.

Part 9: Real-World Example Scenarios

Let's combine these commands into practical workflows.

7. Timers, watchdogs, and scheduling

Real-time scheduling and timers are essential.

  • wdStart / wdCancel / wdShow — Watchdog timer utilities.

    • Usage: WDOG_ID wd = wdCreate(); wdStart(wd, ticks, (FUNCPTR)callback, arg)
  • timer routines (sysClkRateGet / sysClkRateSet) — System clock configuration.

    • Usage: sysClkRateGet()
  • tickLib — Tick-related utilities.

Best practice: keep watchdog callbacks short and deterministic; use tick rate appropriate for timing resolution vs. CPU overhead.

12. Example Debug Session

-> i                # list tasks, find suspicious task ID
-> ti 0x8032a4c0    # inspect task 0x8032a4c0
-> checkStack 0x8032a4c0
-> semShow          # see if it's waiting on a semaphore
-> d 0x80401000, 4, 64   # examine memory region
-> lkup "myFunc"    # check if myFunc is loaded
-> reboot

2. Memory & Address Inspection

| Command | Description | |---------|-------------| | d <address> [,width] [,count] | Display memory (hex/ASCII) – e.g., d 0x1000, 4, 32 | | m <address> <value> | Modify memory byte (use mh for half-word, mw for word) | | fill <start> <end> <value> | Fill memory range with a byte value | | copy <src> <dst> <len> | Copy memory | | search <start> <end> <pattern> | Search memory for a byte pattern | | checkStack <taskId> | Check stack overflow/usage of a task |

Tip: For 32-bit aligned word display: d 0x10000, 4 – width 4 means 4 bytes per column.


Part 4: Task Management (The Heart of RTOS)

VxWorks is a multithreading marvel. You can create, delete, and inspect tasks in real-time.

| Command | Description | Syntax Example | | :--- | :--- | :--- | | taskSpawn | Creates and starts a new task. | taskSpawn("myTask", 100, 0, 20000, mainFunc, arg1, arg2) | | taskDelete | Kills a task by ID. | taskDelete tid = 0x8045a3c | | taskSuspend | Pauses a task. | taskSuspend "myTask" | | taskResume | Resumes a paused task. | taskResume "myTask" | | taskPrioritySet | Dynamically changes a task's priority. | taskPrioritySet tid, 120 | | taskLock / taskUnlock | Prevents/preempts rescheduling. | taskLock() (Critical section) | | taskIdDefault | Sets the default task ID for subsequent commands. | taskIdDefault tid |