zafena development

April 15, 2009

Why going to hell in the first place?
During the past year I have involved myself in the porting effort of OpenJDK to various embedded systems using the Icedtea build system. Unfortunally the embedded development boards that I had access during last year where equiped with inadequate amounts of RAM making it practically impossible to build Icedtea directly on native hardware. I learnt how to workaround this by using emulated hardware with more RAM using QEMU, now the compilation process of Icedtea was doable, yet it still took a week to compile Icedtea6 using QEMU. urgh...

I spent some time in my personal created emulator hell watching time pass by and always feeling behind not working on the current code base like all other freejava hackers. I finally decided something had to be done about this and wanted to break free.

My liberation was made possible by first scouting for a build environment suitable for rapid cross compilation and porting development of OpenJDK for any hardware architecture imaginable, including your toaster. Lucky for me I got to know about the Jalimo project and even got the chance to meet one of its core developers Robert Schuster during FOSDEM09. Robert demonstrated how easy embedded Java development could be using the Jalimo infrastructure and it provided me with all the tools I needed to speedup my compile run and test cycle, I was no longer in need of a emulator instead I could build binarys swiftly using the full power of an affordable IA32 quadcore cpu (with 12Mb of cache) and deploy my work for testing on real hardware for debugging within ohurs not days, simply bliss.

It took some time for me to understand how the four required pieces openembedded, bitbake, jalimo and my own goal could be merged, it turned out they where designed to fit!
First openembedded bitbake and jalimo where all three downloaded from their respecive svn or git trees
The only tricky part was that I (the user) needs to provide configuration files containing the basic information of what kind of target i want to crosscompile against and specify what bundles of recipe I want to use to accomplish this, basically I had to express my mind in a way that bitbake understood.

Once this was setup I could stand in any directory and start the build by simply typing:
bitbake openjdk-6
... or any other software package as long I knew the name of the recipe to use.
Even bitbake openjdk-6-shark builds out of the box!

Within a day playing with bitbake my build computer had downloaded 2gig of sourcecode, eaten several gigs of harddrive space. Rather cool... It had built all cross compilers tools I needed, compiled all dependent librarys, from scratch and all optimised for the target hardware that I wanted to run and debug the binarys on.
The final result was then obtained in the temp directory of my choice.

I have documented my work crosscompilation experiences on the Icedtea wiki:
http://icedtea.classpath.org/wiki/CrossCompileFaq

Cheers and have a great day!
Xerxes

2 Comments »

  1. Hi xerxes, do you know anybody has tried to build to iphone using your techniques ?

    Comment by testman — April 20, 2009 @ 15:50

  2. Hello Testman:
    A cool person named Michael Lauer have added a iphone-compat distro configurationfile to openembedded
    conf/distro/iphone-compat.conf
    Using this configuration it would be possible get some java programs to run on the iphone by building jamvm.

    JamVM are know to be compile-able for iPhone and I have JamVM running on one.
    http://iphoneroot.com/java-vm-for-iphone/

    I would expect a build of OpenJDK for iPhone to fail since OpenJDK are only known to work on ARM using Linux while the iPhone are using Darwin. This can of course be fixed by someone who are familiar with the Darwin kernel since the full openjdk sourcecode are available. Keep an eye on the OpenJDK psd port and try to extend this port for ARM processors as well.
    http://openjdk.java.net/projects/bsd-port/

    The iPhone GUI are a bit different as fair as I know from the GUI (X11) systems used on stationary GNU/Linux machines so there might be some issues as well how to get OpenJDK to display graphics on the iPhone.
    The fastest way to make OpenJDK display a gui on the iPhone would be to make a backend for caciocavallo
    http://openjdk.java.net/projects/caciocavallo/

    Comment by xerxes — April 27, 2009 @ 14:26

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress