| JamaicaVM 3.4 — User Documentation: The Virtual Machine for Realtime 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 to 6.3 and the following target hardware:
PowerPC
Sparc
x86
The VxWorks version of Jamaica is installed as described in the section "Installation". In addition, the following steps are necessary:
VxWorks must be configured to include the following functionality:
INCLUDE_ANSI_ALL
INCLUDE_DISK_UTIL
INCLUDE_NETWORK
INCLUDE_POSIX_TIMERS
INCLUDE_WINDML
INCLUDE_SYSCTL_CLI
If you are using VxWorks real time processes (aka RTP), the following components are also required:
INCLUDE_POSIX_PTHREAD_SCHEDULER
INCLUDE_POSIX_ALL
INCLUDE_RTP
| Warning |
If some of this functionally is not included in the VxWorks kernel image, 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
We recommend you to set the environment variable WIND_BASE in your boot-
or login-script to the directory where Tornado is installed (top-level directory).
| Warning |
Do not use the DOS/Windows-Style path separator \ (backslash) in |
Modifications of the Jamaica property file <JAMAICA_HOME>/etc/jamaica.conf are needed only for special cases. Usually the default settings can be used. If needed modify the following properties.
Extend the include path property include.vxworks-* in
<JAMAICA_HOME>/etc/jamaica.conf
with the include path of the VxWorks target header files.
Add the Tornado tools directory to the PATH environment variable,
so that tools like ccppc.exe resp.
ccpentium.exe
can be found.
Set the environment variable WIND_HOME to the base
directory of the WindRiver installation (e.g. "/opt/WindRiver")
Set the environment variable WIND_BASE to the
VxWorks directory in the WindRiver installation. The previous declared
environment variable WIND_HOME may be used
(e.g. "$WIND_HOME/vxworks-6.3").
Set the environment variable WIND_USR to the RTP
header files directory of the WindRiver installation. The previous
declared environment variable WIND_BASE may be used
(e.g. "$WIND_BASE/target/usr").
We recomend to use "wrenv.sh", located in the WindRiver base directory to set all nessesary environment variables. The VxWorks subdirectory has to be specified as the following example shows for VxWorks 6.2:
/opt/WindRiver/wrenv.sh -p vxworks-6.2 |
| Warning |
Do not add "wrenv.sh" to your boot- or login-script. It starts a new shell which tries to process its login-script and thus you create a recursion. |
Jamaica uses a C cross compiler to create binary executables for VxWorks from the intermediate C-code. Under Linux the C cross compiler is usually installed in /opt/cross. Under Windows the C cross compiler is usually installed in C:/Programs/Tornado/host/x86-win32/bin. In the property file <JAMAICA_HOME>/etc/jamaica.conf a C cross compiler is configured for the appropriate 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.
If you use real time processes (aka RTP), no seperate loading is needed. Loading and starting an RTP application is performed by just one command. Please proceede to next section to learn how to start an RTP application.
The main entry point for an application built with the Jamaica Builder is the name specified by the Builder option destination with the prefix "jvm_". The name "jvm" can also be used. If the option destination is not specified, the name of the class file containing the main() method is used. For example, in the VxWorks target shell the application can be started with:
sp jvm_HelloWorld,<argument string> |
Note: Even if the Builder generates a file with the specified name, it can be renamed 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 with text enclosed in """ (double quotes). Multiple arguments in the string can be separated by spaces. The start code of the created application parses this string and passes it as a standard Java string array to the main method.
If you are using VxWorks new feature of "real time processes" (aka RTP), please use the following shell command to start your RTP application:
rtpSp "<Filename>" |
If you want to specify command line parameters, add them as space seperated list in the following fashion:
rtpSp "<Filename> <arg1> <arg2> <arg3>" |
The built application can also be linked directly to the VxWorks kernel image, for example for saving the kernel and the application in a FLASH memory. In the VxWorks kernel a user application can be invoked enabling the VxWorks 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 jvm_<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.
To link the application with the VxWorks kernel image the macro
USER_APPL_INIT should be set to something like this name:
extern int jvm_HelloWorld(const char *); jvm_HelloWorld(<args>) |
where <args> is the command line (as a C string) which should be passed to the application.
The current release of Jamaica for the VxWorks OS contains the following limitations:
java.net.Socket.setSoTime() and
java.net.Socket.getSoTime() are not implemented
java.lang.Runtime.exec() is not implemented
The following realtime signals are not available:
SIGSTKFLT
SIGURG
SIGXCPU
SIGXFSZ
SIGVTALRM
SIGPROF
SIGWINCH
SIGIO
SIGPWR
SIGSYS
SIGIOT
SIGUNUSED
SIGPOLL
SIGCLD
Jamaica does not allow an application to set the resolution of the clock
in javax.realtime.RealtimeClock. The resolution of the clock depends 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 must be
increased. Care must be taken when doing this, because other programs
running on the system may change their behavior and even fail.
In addition, under VxWorks 5.4 the realtime clock must be informed
about changes of the system ticker rate with the function
clock_setres(). The easiest way to do this is to
add the following into a startup script for VxWorks:
sysClkRateSet(1000)
timeSpec=malloc(8)
(*(timeSpec+0))=0
(*(timeSpec+4))=1000000
clock_setres(0,timeSpec)
free(timeSpec)
|
This example sets the system ticker frequency to 1000 ticks per second and the resolution of the realtime clock to 1ms.
java.net.Socket.getSoTimeout() is not implemented and does not report an error if called.
java.net.Socket.setSoTimeout() is not implemented and does not report an error if called.
Object files: because applications for VxWorks are usually only partially linked, missing external functions and missing object files cannot be detected at build time. If native code is included in the application with the option object, Jamaica cannot check at build time if all needed native code is linked to the application. This is only possible in the final linker step when the application is loaded on the target system.