Skip to main content

VxWorks Multi-Image Boot: Universal Startup Method

·643 words·4 mins
VxWorks Embedded Systems RTOS Bootrom Application-Loading BSP Startup-Script Multi-Image
Table of Contents

VxWorks Multi-Image Boot: Universal Startup Method

In embedded production environments, the ability to switch between multiple VxWorks kernel images and applications on a single storage device—without recompilation—is highly valuable.

This guide presents a universal load-type startup method that enables automatic selection and execution of different VxWorks configurations from one hard disk, while keeping boot components fully decoupled.


🔍 VxWorks Startup Fundamentals
#

VxWorks supports two primary startup models:

Load-Type Startup
#

  • Uses bootrom + external kernel image
  • Common in development environments
  • Kernel is loaded from a file system (e.g., disk or network)

Pros:

  • Flexible image updates
  • Easy to modify applications

Limitations:

  • Requires manual file management when handling multiple images

Bootable-Type Startup
#

  • Kernel and application are combined into a single image
  • Typically flashed into non-volatile storage

Pros:

  • Simple deployment
  • No external dependencies

Limitations:

  • Requires full image rebuild and reflashing for updates

Key Insight
#

The method in this article extends the load-type model to support:

  • Multiple bootroms
  • Multiple kernel images
  • Multiple applications

All coexisting on a single disk.


⚙️ Boot Process Overview
#

The VxWorks startup sequence proceeds through several stages:

  1. romInit

    • Initializes hardware (interrupts, memory, registers)
  2. romStart

    • Relocates bootrom to RAM
    • Transfers control to system initialization
  3. usrInit

    • Initializes system components
    • Spawns the boot task
  4. usrRoot

    • Sets up drivers and system services
  5. bootCmdLoop

    • Loads the kernel image
  6. sysInit → Kernel Start

    • Transfers control to the VxWorks OS

Default Boot Line Configuration
#

Defined in config.h:

Network Boot Example
#

#define DEFAULT_BOOT_LINE "fei(0,0) host:VxWorks h=192.168.0.33 e=192.168.0.18 u=user pw=123"

Disk Boot Example
#

#define DEFAULT_BOOT_LINE "ata=0,0(0,0) host:/ata0/VxWorks h=192.168.0.33 e=192.168.0.18 u=user pw=123"

🚀 Universal Multi-Image Startup Method
#

This solution combines:

  • Load-type startup
  • DOS 7.1 boot partition
  • Batch-driven file switching

It enables menu-based selection of different system configurations at boot time.


🧩 Step 1: Prepare Bootrom, Image, and Startup Script
#

Each application configuration includes:

  • A dedicated bootrom
  • A kernel image
  • A corresponding startup script

Modify usrAppInit.c
#

Enable automatic script execution:

int fd;
if ((fd = open("/ata0a/startup.txt", O_RDWR, 0644)) != NULL) {
    usrStartupScript("/ata0a/startup.txt");
    close(fd);
}

Ensure the following component is included:

INCLUDE_STARTUP_SCRIPT

Example startup.txt
#

id 1,0,"/ata0a/APP/rt.out";
DualNetWork_Switch_OO("198.1.108.1", "198.1.108.253", "255.255.255.0", 66, 0, 0);

id 1,0,"/ata1a/fei.out";
DualNetWorkSwitch("191.8.200.1", "255.255.255.0", "191.8.200.1", 0);

id 1,0,"/ata1a/iiutest";
taskSpawn 0, 100, 0, 0x1000000, main;

Each configuration can use its own version of:

  • startup.txt
  • Executable binaries
  • Bootrom

💾 Step 2: Format Disk with DOS 7.1
#

Format the target disk using DOS 7.1 (FAT filesystem).

This ensures compatibility with:

  • Boot loader utilities
  • Configuration files
  • Batch scripts

🖥️ Step 3: Configure Boot Menu (config.sys)
#

Define selectable boot entries:

[MENU]
MENUITEM=vxWorks.dbg, start the image
MENUITEM=jk1, JK1
MENUITEM=jk2, JK2
MENUITEM=jk1test, JK1test
MENUITEM=jk2test, JK2test
MENUDEFAULT=vxWorks.dbg,3

[vxWorks.dbg]
DEVICE=c:\HIMEM.SYS
DOS=HIGH,UMB
SHELL=C:\VXLOAD.COM C:\bootrom.dbg

[jk1]
[jk2]
[jk1test]
[jk2test]

🔁 Step 4: Automate File Switching (AutoExec.bat)
#

Use batch logic to switch active files dynamically:

@echo off
goto %config%

:jk1test
del bootrom.dbg
copy bootrom.ts1 bootrom.dbg
del D:\APP\rt.out
copy D:\APP\rt1.out D:\APP\rt.out
del test.txt
copy test1.txt test.txt
del iiutest
copy iiutest1 iiutest
goto end

:DOS
goto end

:end

How It Works
#

  • User selects a configuration from the boot menu
  • Script replaces:
    • Bootrom
    • Application binaries
    • Startup scripts
  • Bootloader launches the selected environment

🔄 Boot Flow Summary
#

  1. BIOS completes POST
  2. DOS menu appears
  3. User selects configuration
  4. Batch script swaps required files
  5. VXLOAD.COM launches selected bootrom
  6. Bootrom loads kernel
  7. startup.txt launches application

📊 Key Advantages
#

Feature Benefit
Multi-image support Run multiple configurations from one disk
No recompilation Modify apps independently
Full separation Bootrom, kernel, and apps are decoupled
Scalability Add/remove configurations easily
Compatibility Works with existing BSP and workflows

✅ Conclusion
#

This universal VxWorks startup method enables true multi-image flexibility using a single storage device. By combining load-type booting with DOS-based menu selection and script-driven file management, it eliminates the need for repeated builds or reflashing.

The result is a highly maintainable and scalable solution where bootroms, kernel images, and applications evolve independently, making it ideal for both development and production environments.

Related

Designing a High-Reliability VxWorks BSP: From Reset Vector to VxBus
·959 words·5 mins
VxWorks BSP RTOS Embedded Systems Device Tree VxBus
VxWorks RTOS Design on ARM AT91RM9200 Embedded System
·766 words·4 mins
VxWorks ARM AT91RM9200 Embedded Systems RTOS BSP Device Drivers Task Scheduling Industrial Control
VxWorks vs VxWorks.bin: Understanding the Key Differences
·683 words·4 mins
VxWorks RTOS Boot Image BSP Embedded Systems