leJOS is a compact JVM that runs on a 32kB Hitachi microcontroller. The leJOS code is written in ANSI C and is very portable to other platforms, provided a C cross compiler exists for that platform. This makes it an ideal candidate to port over to the 64kb Commodore 64.
Goal - To create a small-footprint JVM for an unexpanded Commodore 64.
Goal: To create a Java 2 compliant JVM and API for the Commodore One
There are two possibilities for this.
1) Port the LUnix JVM from Phase One over to C=1 .
OR
2) Since there is lots of memory available on the C=1, it's possible to port a more advanced ANSI C implementation of a JVM over. Kaffe looks like it might be the best option.
Once the foundation of a JVM is in place, additional projects could expand the C=1 Java platform. These are not necessarily projects I would want to attempt, but they are possibilities.
Without a full toolset, such as Sun's JDK 1.4, it wouldn't be possible to compile programs on the C=1 platform. Without this, development would have to occur on a PC and the resulting class files transfered over to the C=1. We also wouldn't be able to use JAR files without jar.exe. There are many tools to help with development, and the most important ones should be ported over. Hopefully these tools exist as open source projects somewhere on the Internet (maybe even available by Sun) so we can port them over without much hassle.
If you know more information about this, please e-mail me.
I think the best possibility for a c64 JVM is leJOS. This is a project for the Lego Mindstorms RCX brick. The entire JVM runs in only 32Kb of RAM, but there are a few standard features have been cut in order to fit this in memory:
The API is very limited with leJOS. Things like System.out.println() will need to be adapted for the c64. If LUnix ever attempts a GUI then maybe even portions of the java.awt could be adapted for the c64. And a special API for handling sprites, SID sound, character mapping could be developed. Development of c64 Java code would occur on a PC using a Java Cross Compiler (similar to the development cycle for leJOS) since compiling source code is pretty memory intensive. In other words, no javac.exe for the c64. The ideal platform to accept command line arguments is LUnix .
The leJOS code is written in ANSI C so it should be very portable. I've done some preliminary research on this and was looking for a good C compiler. I think the cc65 cross compiler looks about the best. It looks like it has a decent library just for the c64 from what I could tell. On the down side, C code doesn't compile very efficiently to the 6502/6510 chip for some reason, but still 64Kb should be fine.
An alternate possibility is Waba, a JVm written in assembler but made to be easily portable to other systems. Unfortunately I have no assembler skills.
In order for this to run under LUnix it needs to be programmed for the LUnix Kernal. There are two possibilities for this:
Alternate JVM possibilities:
http://www.rtjcom.com/6811/general.html - written in Assembly using a GNU Assembler.
http://www.rtjcom.com/general.html - Written in C, compiled by various (usually GNU GCC)
The primary target for this port will be WiNGs (presently known as JOS). Jolse has created some amazing tools for JOS, including an LCC compiler back-end for WiNGS ( currently available for JOS).
Some goals for this project inlcude:
Converting the entire J2SE library over will not be too hard. Once a few key classes are defined (java.net.Socket, java.lang.Math, and some java.awt classes) the rest are mostly written in straight Java. This means most code can be copied right from the Sun source code.