I'm working on the ERIC project. ERIC is for Execute, Run, Invoke and Call.
It replaces the java/javaw/jre/jrew tools used to launch a virtual machine.
ERIC already works on Microsoft Windows. I'm porting it to Linux.

I would like ERIC for Linux to launch the decaf virtual machine. I don't
have another virtual machine that works on Linux. I don't need JNI to
launch decaf. Since decaf defines a decaf_main() method, it shouldn't be
difficult for ERIC to launch decaf. All I need is for decaf to be compiled
into a shared library, like "libdecaf.so.XXX".

ERIC is written in C/C++. Some of the portable classes might be useful to
jJOS and decaf. For example, SharedLibrary is a platform-independent C++
interface. It is a interface for shared librarys, both dynamic shared
libraries on Linux and dynamic link libraries on Microsoft Windows. This
C++ class might be useful when decaf loads machine code for native methods
dynamically.

  void example() {
    SharedLibrary *lib = createSharedLibrary( "libdecaf.so.XXX" );
    if ( !lib ) {
      return;
    }
    decaf_main = (Tdecaf_main) lib.getMethod( "decaf_main" );
    if ( !decaf_main ) {
      delete lib;
      return;
    }
    decaf_main( argc, argv, kernel );
    delete lib;
  }

When decaf runs in "host" mode, it can load any Linux shared library. The
mechanism for linking bytecode and machine code can be demonstrated in
"host" mode long before similar support is available in "i386" mode.


_______________________________________________
Kernel maillist  -  [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel

Reply via email to