
October's been a good month for me, and better for my iPod. iPodLinux.org is back online and they've released a couple of pretty neat tools, and updated builds. Loader 2 (the new bootloader) is great - no more messing around with complicated wheel/key combinations to select the boot OS. Loader 2 gives you a GRUB-like list of installed OS images on the iPod disk, and can read kernel images from ext2 and ext3 partitions, as well as FAT32 (W95). So this effectively removes the need to re-create the firmware each time a kernel update takes place. All you need to do is use ipodpatcher (which originally was used for installing Rockbox) and install Loader 2, which will now get merged with the Apple Firmware.
The Podzilla interface has been improved too, and lots of annoying little problems have been ironed out mostly. The text-input is (or atleast, feels) WAY better now, and I can actually input something meaningful in a meaningful amount of time. Here is the text file I "typed" (with awkward scrolling and tapping) on my iPodLinux's PodWrite with a "Scroll with Prediction" text-input mode:
first.txt : "This isn't bad at all. The prediction algo is pretty good as far as this text input session is concerned. Took me 10 minutes to input this on the iPod, but I'll improve I guess."
Then I finally got my first Java program running on the iPod! After encountering wierd errors and battling nasty iPod text-input mechanisms for months, things have finally come to a closure. The latest build of podzilla, makes things easier, and thus enabled me to run Java programs using the K Virtual Machine (kvm) by Sun Microsystems. I got hold of the kvm binary from some place, but I don't think its available on the Sun website anymore, which is pretty odd. But this is how I got my "Hello world" in Java working on the iPod:
1. Install iPodLinux by using the latest Podzilla and loader.
2. Download kvm from here. Put the kvm binary into your iPod's /bin folder and make sure it has execute permission.
3. Write your java code, but keep it simple. KVM just supports basic I/O, data types, Vector, Stack and a couple of other simple things. No graphics, gui etc. For e.g.:
Test.java:
public class Test {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
4. Then compile the code to the JDK 1.4 format:
#javac -source 1.4 -target 1.4 Test.java
5. Finally, create a script file in gedit or vim called, say, Test.sh:
Test.sh:
kvm Test
6. Save the script file in the same folder as the Test.class file, and give both Test.sh and Test.class execute permissions:
#chmod +x Test.sh
#chmod +x Test.class
7. Put all these files in some folder in the iPod's Linux partition. I put it in "/home/shashank/java" (on the iPod partition, not your own system! Also avoid spaces in your folder path.). Then boot into iPodLinux and open the folder where you placed the files using the File Browser, and scroll to "Test.sh", and keep the "Select" button of the iPod pressed until the context menu shows up. Then select "Execute" and select "Read output". Voila! You should get the two words: "Hello World!" on your screen!
No cross-compilation, no recompiling of gcc to work with ARM7 processors (most iPods run on ARM7 processors, thus C code compiled on your PC will not work on the iPod). Life is easier with this if you want to do simple programming. Maybe if someone wrote an extended Virtual Machine, with more libraries, then it would make this a pretty solid platform.
BTW, the above steps have been written assuming you have a Linux/UNIX machine. If you have Windows, a VMWare or xVM VirtualBox image of some Linux distro on your Windows machine would make life tonnes easier compared to trying to use Windows' limited functionality with everything in life in general.
Cheers
Shashank