Just some news about my progress with Classpath.

I have succeeded in moving over the basic parts of java.lang to Classpath
code and have the VM running happily with this. I've made sure that I can
use BufferedReader and BufferedWriter at this time. 

Here's what I did:

I was attempting to migrate from some Sun 1.0.2 class libraries to
Classpath 1.1. I was doing this solely with the java classes, I didn't use
any Classpath native code at all.

My initial attempts failed because I wasn't careful enough in deciding
what Sun code to overwrite and what not to overwrite. Going this route led
me into trouble quite far down the line, I had a bug somewhere that was
corrupting memory in fairly random locations (and segfaulting in code that
I knew was tried and tested). 

So I backtracked and very selectively moved individual files over to
Classpath. The initial steps were moving over java.lang.Class,
java.lang.Thread (and ThreadGroup). Making sure the right native calls
were called at the right time was important. It's also necessary to watch
out for Thread priorities and stuff like that.

Classpath requires some VM specific classes such as VMObject,
VMClassLoader etc, so I had to write a bit of native code for these.

The other important classes are java.lang.System and java.lang.Runtime.
Here we deal mostly with initializing a hashtable of properties. 

There are many new native calls in the Class class, for reflection, and I
spent quite a bit of time implementing most of the reflection API. I also
had to implement quite a bit of stuff for primitive types while doing
this.

Then leaving out classes like Character, String and StringBuffer (the
implementation of these differs greatly from what I had) I moved over the
java.io code for Readers / Writers and In/OutputStreams. I patched up the
native method calls to do the right thing, but used my old native code.

I had to hardcode the gnu/java/io/EncodingManager class to use a default
encoder and decoder (and not to try construct one at runtime).

This now runs very well, but still lacks a large amount of the 1.1
functionality. In particular until I do the proper Character class there
is no internationalization support. Things like ObjectInputStream won't
work, and I haven't touched java.util. 

I hope to get a lot of this working in the next week or two, I'll post a
report here for anyone interested. 


John Leuner

> John Leuner ([EMAIL PROTECTED]) wrote:
> > I've started adapting a simple JVM that I'm working on to support
> > Classpath. What I've seen of Classpath so far is very impressive and I'm
> > keen to convert from the old classlib stuff I was using (mostly from Sun, 
> > writing the native methods myself where necessary).
> 
> Thanks for the comments.
>  
> > I'm having some problems with Strings though, in particular the Encoder
> > setup. As yet I don't have support for reflection and the Constructor
> > class. So what I'ld like to do is just hardwire a default en/decoder for
> > all Strings. My initial attempts at doing this with Encoder8859_1 seem to
> > work, but it doesn't format newlines correctly. 
> > 
> > I don't know enough about these Encoders to know exactly what I should be
> > using, what is the 'default' conversion from Characters to bytes? 
> 
> Yes, just modify gnu.java.io.EncodingManager to hard load the encoder
> class you want.  By default, this basically translates bytes straight
> through to chars by appending a 0 high bytes.  Newlines problems are
> likely caused by something else.  What exactly is happening?
> 
> > I'ld appreciate any advice. Are there any other projects besides Japhar
> > using Classpath?
> 
> JOS is planning on using Classpath, I believe.  Right now we are just
> so developmental that it is hard to be useful to other projects.  I'm
> hoping that this changes over the next few months as AWT gets done,
> we incorporate RMI, and then we can just focus on stability, bug fixes,
> and performance.
> 
> Definitely keep us posted on your progress.  John Kieser did a lot of
> the world developing the interface layer between the VM and Classpath.
> I did some work on that as well.  So if you get stuck, I can try to 
> help you out.  Most things are pretty self contained though.
> 
> -- 
> Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/
> 

Reply via email to