Japanese Handwriting Recognition for the Sharp Zaurus SL-5500

Note: I did this on the SL-5500 with Sharp's official ROM version 3.10. The same procedure may or may not work on other Linux-arm based PDAs. If you try it on other platforms, please do let me know the result!
You can contact me at aztarac at gmx dot de.
(Comments will be added your at the bottom.)

Mathis Rosenhauer

PS: Take note that SHARP made available the ROM source code since this was written. It is downloadable under the GPL license.


Many people love Sharp's line of Zaurus PDAs for their superior hardware. But Sharp not only makes good hardware they also wrote some of the best Japanese handwriting recognition software. Unfortunately, it's not included in the European and US models. So here is a description how to enable Japanese handwriting recognition on the Zaurus SL-5500. Please also check Ichiya Kamiki's site where I got most of the information from.

The general procedure is to take the files which are needed for Japanese input from the ROM of a Japanese Zaurus and install them on your SL-5500. The Japanese Zaurus can be a physical machine or you can mount a ROM image which is intended for ROM updates of a A300 or other Japanese models. The second variant is described here.

First you need to find a Japanese OS ROM image. I used sla300-rom1_20J.tar.bz2 for the A300 which can be found here. ROMs for other Japanese models should do as well. Untar the archive on your desktop Linux PC:

 tar jxf sla300-rom1_20J.tar.bz2
	

The important file is sla300-rom1_20J/all.nb0. It's memory layout is a bit different from the SL-5500 Ospacks but you can still mount the image through loopback (this has to be done as root on your PC):

 losetup -o 1441792 /dev/loop0 sla300-rom1_20J/all.nb0
 mount -t cramfs /dev/loop0 /mountpoint
	
Now go to /mountpoint and transfer all relevant files from the desktop to your Zaurus. I store them on SD but you could also use CF (/mnt/cf/opt/QtPalmtop) or even RAM (/home/QtPalmtop). They are more than 4 MBytes though.
 cd /mountpoint/usr/QtPalmtop.rom
 tar czf - plugins/inputmethods/libCRIM.* \
    lib/libkke.so* lib/libCRL.so* lib/libqsfepj.so* dic \
    | ssh root@zaurus "(cd /mnt/card/opt/QtPalmtop; tar xzf -)"
	

Obviously you need sshd to be installed on your Zaurus and a network connection for this to work. Another way would be to create a tarball with the files and transfer that by other means to the Zaurus.

Opie users may have to include lib/libsl*. If you installed the files in RAM (/home/QtPalmtop), then you got all you need. Otherwise you have to create a couple of links on your Zaurus. Here is a shellscript to do this for you. Don't forget to change INSTDIR if your files are not in /mnt/card/opt/QtPalmtop and su to root before running it from a shell.

Once all necessary links are created you just have to reboot and enjoy your new input method.

SL-5500 with Japanese handwriting recognition

If you see only squares instead of kanji you need to install fonts with Japanese characters. In some cases the Japanese input method disappears from the list. This happened to me after the installation of some other packages. In this case a reboot usually helps.

Good luck!


Later additions to this page:

An improvement was proposed as follows:
The next steps are done on the Zaurus in the terminal (as root!).

cd /mnt/card

if all.nb0 is on SD or

cd /mnt/cf

if it's on CF

dd if=all.nb0 of=a300.img bs=1024 skip=1408
mkdir /mnt/loop
mount a300.img /mnt/loop -t cramfs -o loop

You then can access the A300 files in /mnt/loop

cd /mnt/loop/usr/QtPalmtop.rom
tar cf - plugins/inputmethods/libCRIM.* \
    lib/libkke.so* lib/libCRL.so* lib/libqsfepj.so* dic \
    | (cd /mnt/card/opt/QtPalmtop; tar xf -)

Then you just create the links as described above.

...Now how about folks who don't have a Linux box?
The following comment should be valid not only for OSX but any OS:

> ... I don't understand the 'losetup' command or how OSX handles
> loopback. Could someone translate these directions for use with OSX or
> OSX with fink?

I'm afraid OSX has no support for cramfs out of the box but I may be
wrong. However, your zaurus has everything needed to extract the
files onboard. It's just a bit slow and you need some space on SD or
CF:

- unpack sla300-rom1_20J.tar.bz2. This has to be done on your Mac but
  I'm sure there are programs which can handle tar and bz2 on OSX.
- transfer all.nb0 to SD or CF and insert the card into your zaurus.

The next steps are done on the Zaurus in the terminal.

cd /mnt/card

if all.nb0 is on SD or

cd /mnt/cf

if it's on CF

dd if=all.nb0 of=a300.img bs=1024 skip=1408
mkdir /mnt/loop
mount a300.img /mnt/loop -t cramfs -o loop

You then can access the A300 files in /mnt/loop

cd /mnt/loop/usr/QtPalmtop.rom
tar czf - plugins/inputmethods/libCRIM.* \
    lib/libkke.so* lib/libCRL.so* lib/libqsfepj.so* dic \
    | "(cd /mnt/card/opt/QtPalmtop; tar xzf -)"

Then you just create the links as described above.

On other Linux PDAs:

Marcus said:

I just tried to install the handwriting recognition on an ipaq 3760
with opie installed (familiar 0.7 stable opie package), but there is
always a segmentation fault when libCRIM is present in
plugins/inputmethods and I start opie-login. So, it does not seem
work.

Soft keyboard, dictionary, other Japanese ROM software:

> Can I install the Japanese soft keyboard and translation dictionary onto 
> my 5600 using this rom as well? It looks like the keyboard lives in 
> /usr/QtPalmtop.rom/plugins/inputmethods/libqjpn50pad.so* but I don't 
> know if these are the only files needed.

The other input method should work by copying the libqjpn50pad.so*
files. It worked that way last time I tried it. About the dictionary I
don't know. I would probably be easy for somebody who has access to a
Japanese Zaurus to figure out which files are needed.