Skip to main content

Command Line Rebuild of VxWorks Kernel Source

·295 words·2 mins
VxWorks Kernel Source Command Line Rebuild
Table of Contents

Introduction
#

During VxWorks development, it’s common to modify parts of the kernel(such as drivers or boot code) to add debugging information or update functionality. Rebuilding the entire system can be time-consuming, but using the VSB_DIR variable allows you to selectively recompile just the modified source files quickly and efficiently.

Rebuilding for Single Processor (UP)
#

To rebuild a specific source file using the command line, open a VxWorks development shell and navigate to the relevant source directory (e.g., boot code):

cd C:/WindRiver/vxworks-6.9/target/src/boot

Then run make, specifying your target CPU, toolchain, and custom VSB directory:

make CPU=PENTIUM4 ADDED_CFLAGS+="-g -O0" TOOL=gnu VSB_DIR=<MY-VSB>
  • -g -O0 enables debugging with no optimization for GNU toolchain.
  • Replace with the full path to your custom VSB.

After compiling, rebuild your VxWorks Image Project to include the updated components.

For Diab Toolchain
#

If you’re using the Diab compiler instead of GNU, use the following flags to enable debugging:

make CPU=PENTIUM4 ADDED_CFLAGS+="-g -Xoptimized-debug-off" TOOL=diab VSB_DIR=<MY-VSB>

This method is valid for both VxWorks 6 and 7, assuming you’re working with a custom-built VSB.

Rebuilding for Symmetric Multiprocessing (SMP)
#

VxWorks distinguishes between two kernel types: UP (Uniprocessor) and SMP (Symmetric Multiprocessing). To rebuild for SMP, include the VXBUILD=SMP option:

make CPU=PENTIUM4 ADDED_CFLAGS+="-g -O0" TOOL=gnu VSB_DIR=<MY-VSB> VXBUILD=SMP

Building a VSB Layer in VxWorks 7
#

The VSB_DIR method is effective for rebuilding source files but not for building UI layers or specific VSB components. For those cases, use the vxprj command:

cd C:/WindRiver/workspace/your_VSB_project
vxprj vsb build FBDEV

To list all available layers in your VSB:

vxprj vsb listAll

Summary
#

Using the command line for partial kernel rebuilds is a time-saving technique for VxWorks developers. By leveraging VSB_DIR, make, and vxprj, you can efficiently recompile individual components without waiting for a full system rebuild.

Related

Porting VxWorks Applications to Linux
·4315 words·21 mins
VxWorks Application Linux
Practical PCIe Device Driver Development on VxWorks 7
·515 words·3 mins
PCIe VxWorks 7
Configuring a VxWorks 7 System With Secure User Authentication
·605 words·3 mins
VxWorks 7 User Authentication