harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: Understanding the Harmony Laucher.
Date Wed, 05 Apr 2006 14:42:06 GMT
hadrien@Safe-mail.net wrote:
> Hello there,
> First, I want to apologise for my english which is not my natural language and 
> for all the times I chatted during english lessons at school.

Hi Hadrien, good to meet you.  Please don't apologize -- I'd be useless
if we were doing this in French, Russian, Chinese or any of the other
mother-tongues used by people on the list !

> I am a student at UQAM and I am following Etienne Gagnon's course on 
> Virtual Machines. I have studied SableVM since January, which means I do not 
> obviously know all its details, and I am currently working with Etienne on 
> adapting SableVM to work with Harmony classlib.

Great.

> Actually, I am analysing the booting process presented in 5 steps and Physical 
> packaging presented in doxygen documentation at 
> http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/index.html
> The scheme is neat but I would need a deeper comprehension and particulary on
> the first boot process step :
> 
> In createVMArgs of native-src/launcher/main.c, it creates the VM in a 
> platform independant manner by calling 
> hysl_lookup_name (handle, "JNI_CreateJavaVM", (UDATA *) CreateJavaVM, "iLLL"))
> to get a pointer to JNI_CreateJavaVM function provided by shared library 
> (libsablevm.so in my case), is that right ?

Yep, hysl_ (=harmony's portable shared library functions) lookup_name
function [1] looks up a function in a shared library at run time.

[1]
http://svn.apache.org/viewcvs.cgi/*checkout*/incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/hysl_8c.html#a12

> I am able to make the launcher call JNI_CreateJavaVM in libsablevm.so but I 
> need the VM to load class from Harmony and this is quite difficult as I do 
> not really get all the stuff the harmony launcher does.

A very quick sumary:

The launcher and VM work together to get the Java code running.  The
launcher creates the VM in the invocation() function, and passes in a
variety of arguments (taken from the command line, from a VM-specific
properties file <vmdll>.properties, a pointer to the portlib, etc.),
then it uses JNI calls in main_runJavaMain() to invoke the Java code's
main() method (or uses a JarRunner for -jar command line option).

The class files that are loaded on the bootclasspath are a combination
of the VM-specific kernel types and those in the jre/lib/boot JARs.  In
the IBM VME we explicitly use -Xbootclasspath/p in our VM properties
file to add the kernel types onto the bootclasspath, and read the
jre/lib/boot/bootclasspath.properties file to pick up the shared library
code.

> If somebody can make me understand better the boot process, be sure I will be 
> very interrested.

Of course, there's lots to say about it to describe the whole thing in
detail, but if you have any specific questions after watching the code
run just let us know and we'll do our best to help.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message