JamaicaVM -- User Documentation: The Virtual Machine for Real-time and Embedded Systems | ||
---|---|---|
Prev | Appendix A. Targets | Next |
VxWorks from Wind River Systems is a RealTime operating system for embedded computers. The JamaicaVM is available for VxWorks 5.4 and the following target hardware:
PowerPC
Sparc
x86
The VxWorks-Version of Jamaica is installed like descripted in section "Installation". Additionally the following steps have to be done:
VxWorks have to be configured to include the following functionallity:
INCLUDE_POSIX_ALL
Warning |
Is some of these functionally is not included in the VxWorks kernel image, some linker errors may occur when loading an application built with Jamaica and the application may not run correctly. |
Set the environment variable WIND_BASE to the base directory of the Tornado installation (default) or
extend the include path property include.vxworks-* in /usr/local/jamaica/etc/jamaica.conf with the include path of the vxWorks target header files,
Add the Tornado tools directory to the PATH environment variable, such that tools like ccppc.exe can be found.
We recomment to set the environment variable WIND_BASE in your boot- or login-script to the directory where Tornado is installed (top-level directory). Usually no modification of the Jamaica property file /usr/local/jamaica/etc/jamaica.conf is needed.
Warning |
Do not use the DOS/Windows-Style path separator \ (backslash) in WIND_BASE, because in the Cygwin environment (bash) a backslash is interpreted as an escapce sequence for some special characters. Do only use / (slash) in path names. |
Jamaica use a C-cross-compiler to create binary excutables for VxWorks from the intermediate C-code. Unter Linux usually a C-cross-compiler is installed in /opt/cross. In the property file /usr/local/jamaica/etc/jamaica.conf a C-cross-compiler is configured for the appropiated target under this directory. If your C-cross-compiler is installed in another directory or with a different name please change the following properties:
Xcc.vxworks-*
Xld.vxworks-*
Xstrip.vxworks-*
An application created with the Jamaica Builder can be loaded on the VxWorks target like any other VxWorks program. If the target system is configured for disk, FTP or NFS access simply enter the following command on the target shell:
ld < <Filename> |
<Filename> is the complete filename of the created application.
The main entry point for an application build with the Jamaica Builder is the name specified by the Builder-optioon -destination or in case this option was not specified the name of class-file containing the main()-methode. In the VxWorks target shell the application can b e started e. g. with:
sp HelloWorld,<argument string> |
The name of the main entry point can be changed with the Builder-optioon -destination. The Builder generates a file with the specified name, but it is possible to rename it later, because the name of the main entry point is read from the symbol table included in the object file.
Optional parameters, like -classpath or -Xbootclasspath can be passed to the application as a single C argument string (text enclosed in "). Multiple arguments in the string can be separated by spaces. The start code of the created application parses this string and pass it as a standard Java string array to the main method.
The built application can also be linked directly to the VxWorks kernel image, e. g. for saving the kernel and the application in a FLASH memory. In the VxWorks kernel a user application can be invoked enabling the VxWork configuration define INCLUDE_USER_APPL and defining the macro USER_APPL_INIT when compiling the kernel (see VxWorks documentation and the file usrConfig.c). The prototype to invoke the application created with the Builder is:
int <main class name>(const char *commandLine); |
where <main class name> is the name of the main class or the name specified via the Builder-option -destination. For linking the application with the VxWorks kernal image the macro USER_APPL_INIT should be set to something this name:
extern int HelloWorld(const char *); HelloWorld(<args>) |
where <args> is the command line as a C string which should be passed to the application.
In the current release of Jamaica for the VxWorks OS the following limitations have to be taken into account:
java.lang.Runtime.exec() is not implemented
The following realtime signals are not available:
#define JAMAICA_NATIVE_SIGNAL_SIGSTKFLT 0 //??? NYI SIGSTKFLT #define JAMAICA_NATIVE_SIGNAL_SIGURG 0 //??? NYI SIGURG #define JAMAICA_NATIVE_SIGNAL_SIGXCPU 0 //??? NYI SIGXCPU #define JAMAICA_NATIVE_SIGNAL_SIGXFSZ 0 //??? NYI SIGXFSZ #define JAMAICA_NATIVE_SIGNAL_SIGVTALRM 0 //??? NYI SIGVTALRM #define JAMAICA_NATIVE_SIGNAL_SIGPROF 0 //??? NYI SIGPROF #define JAMAICA_NATIVE_SIGNAL_SIGWINCH 0 //??? NYI SIGWINCH #define JAMAICA_NATIVE_SIGNAL_SIGIO 0 //??? NYI SIGIO #define JAMAICA_NATIVE_SIGNAL_SIGPWR 0 //??? NYI SIGPWR #define JAMAICA_NATIVE_SIGNAL_SIGSYS 0 //??? NYI SIGSYS #define JAMAICA_NATIVE_SIGNAL_SIGIOT 0 //??? NYI SIGIOT #define JAMAICA_NATIVE_SIGNAL_SIGUNUSED 0 //??? NYI SIGUNUSED #define JAMAICA_NATIVE_SIGNAL_SIGPOLL 0 //??? NYI SIGPOLL #define JAMAICA_NATIVE_SIGNAL_SIGCLD 0 //??? NYI SIGCLD
Jamaica does not allow an application to set the resolution of the clock in javax.realtime.RealtimeClock. The resolution of the clock depend on the frequency of the system ticker (see sysClkRateGet() and sysClkRateSet()). If a higher resolution for the realtime clock is needed the frequency of the system ticker have to be increased. Please do this with care, because other programs running on the system could change their behaviour and even fail. Under VxWorks 5.4 additionally the realtime clock have to be informed about changes of the system ticker rate with the function clock_setres(). Most simply this can be done in some startup-script for VxWorks like this:
sysClkRateSet(1000) timeSpec=malloc(8) (*(timeSpec+0))=0 (*(timeSpec+4))=1000000 clock_setres(0,timeSpec) free(timeSpec) |
This example would set system ticker frequency to 1000 ticks per second and the resolution of the realtime clock to 1ms.
Object files: because applications for VxWorks usually are linked partially only missing object files can not be detected at build time. If native code is include in the application with the -object link Jamaica can not check at build time if all needed native code is linked to the application. This is only possible for the finaly linker step when the application is loaded on the target system.