System Call Functionality


You can use the system call functionality in the picoJavaTM environment to extend the capabilities of the simulation environment in various ways. A sample implementation of the system call functionality is present in the picoJava-II distribution. See the README in the directory $PICOJAVAHOME/$PROJECT/syscall_example.

At startup, IAS or RTL looks for a dynamically linked library in the file that the environment variable PICOJAVA_SYSCALL_LIB points to. The following process follows:

To invoke system calls, the program that runs on IAS or RTL must write to the special address 0xffe8 with the ncstore_byte instruction. Doing so triggers a call to the function void picojava_syscall (). The IAS or RTL environment does not handle passing of parameters between the code that runs on the picoJava core and the system call library; instead, IAS or RTL assumes that parameters and such are set up in memory according to a predefined protocol.

Compile with this command:

cc -G -o libsyscall.so.1 libsyscall.c

If you are using gcc, use this command:

gcc -fpic -shared -o libsyscall.so.1 libsyscall.c

Set up the environment variable, as follows

setenv PJSIM_SYSCALL_LIB libsyscall.so.1

IAS or RTL looks for PJSIM_SYSCALL_LIB; if it is set, it the loads the functions from the specified library.

IAS webpage


Copyright © 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303-4900 USA. All rights reserved.


Last modified 24-March-1999