Configuring Tornado/VxWorks This chapter describes the minimum services required by a Tornado system image in order to support an Ada program. It also describes the various ways of combining an Ada program and the Tornado system image to form bootable, stand-alone, and ROMable images.
The following topics are covered in this chapter:
Required Tornado ServicesTo Communicate With the Host
In order for VxWorks to be able to communicate with the host platform, the services provided by INCLUDE_NETWORK, along with one of the network interfaces listed in the table "Key VxWorks Options" in the Configuration chapter of the VxWorks Programmer's Guide from Wind River must be set up. This configuration must be included in the VxWorks system image.
To Use MATH Package
In order to use the MATH package from vads_compatibility.ss, the following service must be included in the VxWorks system image:
INCLUDE_ANSI_MATH /* ANSI-C math library functionality */
Tornado 3.0/VxWorks AE
To use VxWorks AE with Rational Apex Embedded for Tornado, the following services must be included in the VxWorks system image:
INCLUDE_ANSI_TIME_LOCALTIME
INCLUDE_ANSI_MKTIME
Alternate ConfigurationsThe development strategy for Apex described in Getting Started and the Programming with Rational Apex Guide for loading and running Ada applications is suitable for the early phases of the development cycle, but most developers, at some point, want to create bootable, stand-alone versions of the application. This section describes the various ways of combining the Ada program and the VxWorks system image.
Creating a Bootable Ada Application
A bootable Ada application is a fully linked Ada application that is linked with the VxWorks system image, and, optionally, started from the VxWorks initialization code. In order to create a bootable Ada application, you should create a fully linked Ada application but rather than load it using the Tornado loader services, link the Ada application with the VxWorks system image.
You can do this by converting the Ada application to the object module format supported by VxWorks and then modify the VxWorks Makefile to include the converted object file. Refer to Table 3 for your specific processor's conversion format.
If you are working with Tornado 2.0, modify the following line in the VxWorks Makefile:
MACH_EXTRA =
to contain the converted Ada object file.
If you are working with Tornado 3.0 AE, modify the following line in the VxWorks Makefile.system:
EXTRA_MODULES =
For example, if your fully linked Ada application was called hello and you were using Tornado 2.0 for PowerPC, you would do the following:
% apex_convert -format ELF hello hello.omf
MACH_EXTRA = test_program_location/hello.omf
% make VxWorks.
Table 3 Processor Conversion Formats
M68000 Family VOX to A_OUT
PowerPC, MIPS VOX to ELF
i386 Family with Tornado 2.0 VOX to A_OUT
i386 Family with Tornado 3.0 AE VOX to ELF
Optionally, if you wish to start the Ada application from the VxWorks initialization code, add the necessary code to the usrRoot() routine in usrConfig.c. This code could simply be a call to _start(), or it could be a call to taskSpawn() with _start as the entryPt argument.
Note: Depending on your target, you may have to add two leading underscores to the "start" symbol name.
68k Only
Edit the usrConfig.c file and add the following line to the beginning:
extern void _start(); (one leading underscore)
Next, in the usrRoot() function, give an example for starting up the application:
taskSpawn ("ada_app", 20, 0, 2000, (FUNCPTR)_start, 0,0,0,0,0,0,0,0,0,0);
PowerPC, MIPS Only
Edit the usrConfig.c file and add the following line to the beginning:
extern void __start(); \ (two leading underscores)
Next, in the usrRoot() function, give an example for starting up the application:
taskSpawn ("ada_app", 20, 0, 2000, (FUNCPTR)__start, 0,0,0,0,0,0,0,0,0,0);
Creating a Bootable, Stand-Alone Ada Application
A bootable, stand-alone application is a fully linked Ada application that is linked with a stand-alone version of the VxWorks system image, and, optionally, started from the VxWorks initialization code. In order to create a bootable, stand-alone Ada application, you should follow all of the steps above, but then invoke the Makefile with:
% make vxWorks.st
Creating a ROMable Ada Application
A ROMable Ada application is a bootable, stand-alone Ada application that is suitable for placing into ROM. As such, all of the steps above for creating a bootable, stand-alone Ada application apply to making a ROMable Ada application. The only difference is the target you specify when invoking make. To make a bootable, stand-alone Ada application with a symbol table:
% make vxWorks.st_rom.hex
Alternatively, you can remove the symbol table, and make:
% make vxWorks_rom.hex
Configuring a Serial PortTo load Ada programs from a serial tip session and not WindSH, you must include the following services in the Tornado system image:
#define INCLUDE_LOADER /* object module loading */ #define INCLUDE_NET_SYM_TBL /* load symbol table from network */ #define INCLUDE_SHELL /* interactive c-expression interpreter */ #define INCLUDE_SHOW_ROUTINES /* show routines for system facilities*/ #define INCLUDE_STAT_SYM_TBL /* create user-readable error status*/ #define INCLUDE_SYM_TBL /* symbol table package */ #define INCLUDE_UNLOADER /* object module unloading*/For additional information, refer to the WindRiver documentation.
Default configurations and available services are included in the file WIND_BASE/target/config/all/configAll.h for Tornado 2.0. Under Tornado 3.0 AE, the services will be added to the project.wcf file.
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2002, Rational Software Corporation. All rights reserved. |