Installation of Blackdown JVM on a Linux PDA

Written by Harris Chiu (June 24, 2002)
E-mail:  chchiu@csis.hku.hk

(SPARKLE Project main page)

The installation of the JVM to the Ipaq with Linux is very straight forward
The problem usually arises in the module dependencies
The installation of Linux of Ipaq
We can use Familiar Distribution, which is relatively much more specification to other districution. You can find its website in here http://familiar.handhelds.org/ 
If you have the PoketPC OS installed at the Ipaq orignally, you can take a look at this ftp://ftp.handhelds.org/pub/linux/dists/compaq/ipaq/stable/install.html on backing up the OS. You can restore the OS if you  want. The guide tell you every details and alternatives. It will also tell you how you can install the boot loader in order to load the Linux file system to it.
 After that you will have to install the Familiar linux. The installation guide can be found here http://familiar.handhelds.org/familiar/releases/v0.5.2/install/H3600/install.html
One point should be noted is configuring the terminal program - minicom in Linux and hyperterminal in Windows. The baud rate should be set at 115200 and there should not be any flow control.
By following the installation guide, everything is supposed to be run smoothly.
After the installation of Familiar Linux, we have to set up ppp connection to the PC so that we can control the ipaq in more easier way. We can have ftp, ssh and web access, which cannot be done using the terminal program only
Setting up PPP
By following the guild here http://www.handhelds.org/z/wiki/PPPHowto, the addition and creation of script can be done by output redirection in the shell directly on the ipaq. Remember on the ipaq, you should chmod u+s /usr/sbin/pppd Otherwise you cannot get the pppd call made.
You can test if it works by connecting the ipaq with minicom. When you come into the login, you can type ppp, which act as a user. you can see some odd characters come out. It means that the ipaq is trying to communicate with the PC with some signals. You can made the call by using pppd call ipaq on the host pc
Setting up web access for the ipaq
In order to download and install the package( like X, ftp, bash ) to the ipaq, the ipaq should need some web access.
You can see the guide here http://www.handhelds.org/z/wiki/IPMasqHowto  However, you may not know which one to choose.
In this case, since the ipaq do not require a "real" ip, we can make use of the following guide
This will lose the ability to do any real packet filtering on the traffic going to your iPAQ. As root,
you will need to execute the following commands: 
  iptables -F
  iptables -t nat -F
  iptables -t nat -A POSTROUTING -s 192.168.1.101 -j MASQUERADE
  echo 1 > /proc/sys/net/ipv4/ip_forward
These commands masquerade all the traffic to/from your iPAQ as your host machine's ethernet address. Since all the traffic will look like it's going to/from your host machine, you can't easily use the iptables features to filter traffic to the iPAQ unless you wish to apply the same rules to your host system.
You may also need to instruct the filters to allow iPAQ packets to be forwarded: 
  iptables -A FORWARD -s 192.168.1.101 -j ACCEPT
  iptables -A FORWARD -d 192.168.1.101 -j ACCEPT
You will still need to add a default route on the iPAQ (ie type this after logging into the ipaq with ssh), something like this: 
  route add default gw 192.168.1.100
In order to have DNS service you have to copy the host /etc/resolv.conf to the ipaq( or simply type)
In case you need to have http access and the connection of the host rely on a proxy, you can set the proxy by 
export http_proxy="http://proxy.csis.hku.hk:8282"
Then you have setup you internet connection for ipaq
Installation of package
Firstly, you have to run 
ipkg update
Secondly, you can choose to install packge by
ipkg install <package name>
For example, you can install X11 for Ipaq by
ipkg install task-x
if you want to install mp3-player for ipaq
ipkg install task-mp3-player
if you want to install ftp
ipkg install ftp
You can set up a FTP server at your host
you can get a FTP server RPM from ftp://ftp.rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/wu-ftpd-2.6.2-5.i386.rpm
You can transfer file freely to and from the host PC by ssh and ftp
Installation of Blackdown JVM
Blackdown JVM (license to Sun micro)
Since the BlackDown JVM is very large in size, we recommend your ipaq to have 32 rom.
Installing the BlackDown JVM is very easy, you can do it by installing the jre first
ipkg install http://www.tml.hut.fi/~jsantala/feed/blackdown-jre_1.3.1-RC1_arm.ipk
and then you have to install the add-on for X server etc.
ipkg install http://www.tml.hut.fi/~jsantala/feed/blackdown-add_1.3.1_arm.ipk
At this point you cannot run swing program yet since you are still missing a library which may cause the BlackDown JVM to throw native code exception.
To install the library libstdc++2.10-glibc2.2,
ipkg install http://familiar.handhelds.org/familiar/feeds/stable/packages/armv4l/libstdc++2.10-glibc2.2_2.95.4-0.010407-fam1_arm.ipk
Then the Blackdown JVM should work properly.
If you facing problem, you can also take a look at the mailing archives for particular topics
Here is the familiar mailing archives http://www.handhelds.org/pipermail/familiar/
The mailing archive is quite useful in finding out solution for common problems
Reference