Skip to main content

Running a WindML Graphics Demo on Vxworks 7

·1188 words·6 mins
WindML VxWorks 7
Table of Contents
APP - This article is part of a series.
Part 14: This Article

VxWorks, developed by Wind River Systems, is a leading real-time operating system (RTOS) widely used in embedded systems requiring deterministic performance. With the release of VxWorks 7, the OS has been re-engineered for modularity, scalability, and modern hardware support, including advanced graphics capabilities. While WindML—a graphics library prominent in earlier VxWorks versions like 5.x and 6.x—has largely been superseded by standards like OpenGL ES and OpenVG in VxWorks 7, it’s still possible to run WindML-based graphics demos with the right setup. This article provides a step-by-step guide to running a WindML graphics demo (specifically, the classic uglteapot demo) on VxWorks 7, leveraging its backward compatibility and development tools like Wind River Workbench 4.

Prerequisites
#

Before diving into the process, ensure you have the following:

  • VxWorks 7 Installation: A licensed copy of VxWorks 7 installed on your host machine (Windows or Linux).
  • Wind River Workbench 4: The Eclipse-based IDE for VxWorks 7 development.
  • Target Hardware or Simulator: A supported target board (e.g., Intel x86 or ARM-based) with graphics hardware, or the VxWorks Simulator (vxsim) for testing.
  • WindML Source Files: Access to WindML demo source code (e.g., uglteapot.c) and libraries, typically found in older VxWorks distributions or archived documentation.
  • Graphics Support: Ensure your VxWorks 7 image includes graphics components (e.g., Frame Buffer Driver, OpenVG, or legacy WindML support if ported).
  • Development Environment: A configured VxWorks Source Build (VSB) and VxWorks Image Project (VIP) with necessary graphics libraries.

Step 1: Setting Up the VxWorks 7 Environment
#

VxWorks 7 uses a layered build system with VSB and VIP projects to create a customized kernel image. To run a WindML demo, you need to ensure graphics support is included.

  1. Launch Wind River Workbench 4:
  • Start Workbench and select or create a workspace (e.g., C:\Users\YourName\vxworks_workspace on Windows).
  • Ensure your VxWorks 7 installation is registered in Workbench (check under Preferences > Wind River > VxWorks).
  1. Create a VxWorks Source Build (VSB) Project:
  • In Workbench, go to File > New > VxWorks Source Build Project.
  • Name it (e.g., vsb_graphics) and select your target architecture (e.g., x86_64 or SIMNT for the simulator).
  • In the configuration wizard, include the following components:
    • INCLUDE_FBDEV (Frame Buffer Driver)
    • INCLUDE_WINDML (if available in your VxWorks 7 distribution; otherwise, you may need to port legacy WindML libraries manually)
    • INCLUDE_OPENGL or INCLUDE_OPENVG (for modern graphics support as a fallback).
  • Build the VSB project by right-clicking it in the Project Explorer and selecting Build Project. This generates libraries for your kernel image.
  1. Create a VxWorks Image Project (VIP):
  • Go to File > New > VxWorks Image Project.
  • Name it (e.g., vip_graphics) and link it to your vsb_graphics project.
  • Configure the kernel:
    • Open the Kernel Configuration editor (double-click kernel_config.c in the VIP project).
    • Verify graphics components are enabled (e.g., INCLUDE_FBDEV, INCLUDE_WINDML).
    • Add INCLUDE_VXSIM if using the simulator.
  • Build the VIP project to generate a bootable VxWorks image (e.g., vxWorks in the default directory).

Step 2: Obtaining and Preparing the WindML Demo
#

The uglteapot demo is a classic WindML example that renders a rotating teapot. Since WindML is legacy, you may need to source it from an older VxWorks installation (e.g., VxWorks 6.x) or online archives.

  1. Locate the Demo Source:
  • Check your VxWorks installation directory (e.g., <VxWorks_Install_Dir>/vxworks-7/target/src/Mesa/windmldemos).
  • If unavailable, search Wind River’s documentation or forums for uglteapot.c. Alternatively, use this minimal example if you can’t find it:
#include <ugl/ugl.h>
#include <ugl/ugluc.h>
void windMLTeapot(UGL_BOOL animate, int argc, char *argv[]) {
    UGL_ID gc = uglGcCreate(UGL_DEFAULT_DISPLAY);
    uglGcClear(gc, 0, 0, 640, 480, UGL_RGB(255, 255, 255));
    uglTeapot(gc, 200, 200, 100, animate);
    uglGcDestroy(gc);
}
void uglteapot(void) {
    taskSpawn("tTeapot", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTeapot, UGL_TRUE, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
  • Save this as uglteapot.c.
  1. Create a Downloadable Kernel Module (DKM) Project:
  • In Workbench, go to File > New > VxWorks Downloadable Kernel Module Project.
  • Name it (e.g., uglteapot_demo) and link it to your vsb_graphics project.
  • Add uglteapot.c to the project by dragging it into the Project Explorer or using Import > File System.
  • Modify the build settings:
    • Right-click the project, select Properties > Build Properties.
    • Under Paths, add include paths for WindML headers (e.g., <VxWorks_Install_Dir>/vxworks-7/target/h/ugl).
    • Under Libraries, add the WindML library (e.g., libwindml.a) if available, or link against Mesa/OpenGL libraries as a substitute.
  1. Build the DKM:
  • Right-click the project and select Build Project. This generates an object file (e.g., uglteapot_demo.out).

Step 3: Running the Demo on the VxWorks Simulator
#

For simplicity, we’ll use the VxWorks Simulator (vxsim) to test the demo.

  1. Start the Simulator:
  • In Workbench, go to Run > Debug Configurations.
  • Create a new VxWorks Simulator Connection:
    • Select your VIP image (e.g., vip_graphics/default/vxWorks).
    • Click Apply and then Debug to launch the simulator.
  • The simulator console should appear, showing the VxWorks boot process.
  1. Load and Run the Demo:
  • In the simulator console, load the DKM:
ld < uglteapot_demo.out
  • Spawn the demo task:
uglteapot
  • If successful, a graphical window should open, displaying the rotating teapot. If no window appears, ensure the simulator is configured for graphics output (see troubleshooting below).

Step 4: Running on Target Hardware
#

To run on real hardware (e.g., an Intel x86 board with a graphics card):

  1. Configure the VIP for Hardware:
  • Update the VIP to match your board’s BSP (Board Support Package) instead of the simulator.
  • Rebuild the VIP and transfer the image to the target (e.g., via TFTP or USB).
  1. Connect to the Target:
  • Use Workbench’s Target Manager to connect to the board via a target server.
  • Load and run the DKM as in the simulator steps.
  1. Verify Output:
  • Connect a monitor to the target’s graphics output. The teapot should render on-screen.

Troubleshooting Common Issues
#

  1. Graphics Window Not Appearing:
  • Ensure INCLUDE_FBDEV and graphics drivers are in the kernel.
  • For the simulator, verify the host machine supports graphical output (e.g., X11 on Linux or a compatible display server on Windows).
  1. WindML Not Found:
  • If VxWorks 7 lacks native WindML support, port the library from an older version or adapt the demo to use OpenGL ES (consult Wind River support for legacy compatibility).
  1. Linker Errors:
  • Check library paths and ensure all dependencies (e.g., ugl, ugluc) are linked. Use nm or objdump on the .out file to inspect Ascertain that all required libraries are present.
  1. Crash on Execution:
  • Increase the task stack size in taskSpawn (e.g., from 100000 to 200000) if the demo crashes due to stack overflow.

Modern Alternatives in VxWorks 7
#

While WindML demos like uglteapot are educational, VxWorks 7 encourages using modern graphics APIs:

  • OpenGL ES: Hardware-accelerated 3D graphics.
  • OpenVG: Vector graphics for 2D interfaces.
  • Tilcon UI: A commercial UI framework for advanced GUIs.

To adapt uglteapot for OpenGL ES, replace WindML calls with OpenGL equivalents (e.g., glClear, glRotatef), though this requires more extensive code changes.

Conclusion
#

Running a WindML graphics demo on VxWorks 7 is a blend of leveraging legacy code and adapting to a modern RTOS environment. By carefully configuring your VSB and VIP projects, integrating the demo into a DKM, and testing on the simulator or hardware, you can successfully visualize the teapot demo. This process not only demonstrates VxWorks 7’s flexibility but also bridges its historical capabilities with contemporary graphics standards. For further assistance, consult the VxWorks 7 documentation or Wind River’s support resources.

APP - This article is part of a series.
Part 14: This Article

Related

A Step by Step Guide on UART Programming for VxWorks 7
·1084 words·6 mins
UART ISR
TCP Socket Programming on VxWorks 7
·1051 words·5 mins
VxWorks 7 Socket TCP
Enabling Qt on VxWorks
·898 words·5 mins
VxWorks 7 QT