↓ Skip to main content

Porting WorldWind to VxWorks: A Real-Time Graphics Implementation

Porting WorldWind to VxWorks: A Real-Time Graphics Implementation

As demand for intelligent communication, internet, and multimedia technology grows, embedded systems have become the backbone of modern infrastructure. These systems require low memory footprints, high performance, and stable scalability. We see them everywhere: aerospace, medical instruments, status monitoring, and consumer electronics.

VxWorks, developed by WindRiver Systems, stands out as a premier real-time operating system (RTOS) in these high-reliability fields. Its pedigree is well-established, notably having powered the Mars Pathfinder. This article examines the implementation of the VxWorks graphics user interface (GUI) and the specific technical hurdles of porting WorldWind software to this environment.

🌍 WorldWind Software Overview
#

WorldWind (WW) is a high-pedigree software originally developed by NASA. While it offers a sophisticated interface and 3D visualization capabilities comparable to Google Earth, its primary advantage for developers is its open-source nature. This allows for deeper inspection and easier porting for specialized hardware.

Add-On Functionality
#

WW provides a 3D view of the Earth using satellite imagery and terrain data. A key differentiator from competitors is its “Add-On” feature. If the base 3D sphere is the skeleton of the software, the layers are its blood and muscle. Because WW is open-source, third parties can develop and contribute custom layers, providing significantly more growth potential than closed-source alternatives.

DDS and Image Formats
#

By default, WW converts downloaded images (usually JPEG) into DDS (DirectDraw Surface) format for local caching. While DDS files are generally larger than JPEGs at the same resolution, they are a product of DirectX Texture Compression (DXTC) and are standard in 3D software and gaming.

In our testing, we found that disabling the automatic conversion to DDS and using JPEG directly resulted in comparable display quality and correct terrain rendering. Other supported formats include:

  • JPEG: High compression ratios (2:1 to 40:1) suitable for network environments.
  • PNG: Supports alpha channels for transparency.
  • BMP: A standard, uncompressed bitmap format.
  • GIF: Supports both static and animated images with transparency.

⚙️ The VxWorks Operating System
#

VxWorks is a high-performance real-time operating system designed for industrial leadership. It features a kernel optimized for real-time multi-tasking, interrupt management, and inter-task communication. Its efficiency allows it to run on various CPU platforms with a minimal memory footprint. It powers the F-16 Fighting Falcon, the B-2 Spirit stealth bomber, and the Patriot missile system.

For GUI development on VxWorks, developers typically choose between Zinc for VxWorks or WindML.

  • Zinc is a comprehensive GUI development tool for high-performance embedded devices with low memory overhead.
  • WindML is a more flexible, lightweight multimedia graphics library. It provides open APIs for chips, I/O devices, audio/video, and frame buffers.

Because WindML offers greater programming freedom and lower system overhead, it is the preferred choice for most applications. You can find more about the VxWorks architecture to understand how these components integrate with the kernel.

🎨 WindML Architecture and Mechanism
#

WindML serves as a support library for multimedia applications on VxWorks. It provides standard APIs for graphics, video, and audio, while allowing for custom device drivers.

System Structure
#

The WindML system consists of three primary layers:

  1. SDK (Software Development Kit): The hardware-independent layer. It provides a unified programming interface for graphics, video, audio, and event-driven servers.
  2. DDK (Driver Development Kit): The hardware-dependent layer. This is where specific hardware drivers are implemented to provide standard interfaces to the SDK.
  3. Hardware Layer: The actual physical hardware, customized to meet specific requirements.

Event-Driven Design
#

WindML utilizes a client/server model to handle events.

  • Client Side: Responsible for window drawing, updates, and responding to user messages. Each window object maintains a message queue.
  • Server Side: An “Input Monitoring Task” collects real-time events from I/O devices using the VxWorks I/O system and the select mechanism.

These events are packaged into standard structures and sent via the uglEventPost function. The event processing module then identifies the correct window message queue and delivers the message. This modularity allows for direct inter-window communication by calling uglEventPost without needing to traverse lower-level modules.

Key Implementation Details
#

To maintain strong real-time performance and minimize overhead, WindML avoids unnecessary copy operations by using pointers extensively, particularly in the I/O subsystem and message distribution modules.

WindML Functionality and Usage
#

WindML provides 2D graphics APIs, event services, region/window management, and multimedia support. The 2D API includes basic operations (lines, rectangles, ellipses, polygons), font selection, bitmap management, and double buffering.

Technical Notes for Developers:

  • Language Support: While WindML supports C and C++, standard C functions like printf() cannot be used to output characters in the GUI. You must use WindML-specific functions like uglTextDraw(ge, x1, y1, length, text).
  • Chinese Character Support: WindML does not natively support Chinese. To solve this, we implement a dot matrix font library. Since Chinese characters are stored in a library of 94 zones (each containing 94 characters), we convert the internal codes to zone-position codes to find the correct bit-map model.
  • Resource Locking: Because WindML uses multi-threading and multi-tasking, shared resources must be protected. We use mutex signals to lock the graphics context, device, and buffer. This is handled by calling UglBatchStart(gc) before drawing and UglBatchEnd(gc) to release the resources.

🚀 Current Progress
#

The porting of WorldWind to the VxWorks system is largely complete. The basic display and browsing functions are operational. Currently, the system supports JPEG graphics. Work is ongoing to implement full DDS format support and complete the remaining software features.

The successful porting of NASA’s WorldWind to VxWorks enables high-resolution map browsing on embedded systems, offering a high-performance, low-power solution for critical applications in aerospace and industrial monitoring.

Related