Applications for the Sharp Zaurus

Guylhem Aznar

Issue #0, linuxjournal.com

Pull up a Zaurus and make yourself comfortable.

You just got your Zaurus and you are very proud of it. You tried every single application, then even typed some commands in the terminal, like uname -a, ping localhost and ifconfig to prove to yourself that it really is a GNU/Linux machine in the palm of your hand. You even know where most of the keys are but still may be looking for the pipe (hint: read more.sbc.co.jp/slj/doc/pdf/SL5000KeyAssign.pdf to find out that bar = Shift-Space).

Sweet. But now what should you do? After the initial fun, you may be wondering what you can actually do with a machine you don't know how to use, and for which you think no third-party software exists. This article teaches you how to install software on the Zaurus and presents some killer applications you should know about.

Synchronizing PIM Data

First and foremost, you must load the Zaurus with your important information; otherwise, you will have to carry the Zaurus and your former PDA in your pocket, or worse, you will have to keep your Zaurus at home because it would be useless for your everyday life.

The first use for any handheld is personal information management (PIM), such as storing phone numbers, calendar entries, etc. In fact, the Palm was initially built around these functions, and if you have purchased a Palm, you probably depend on it to access your personal information.

How Can You Substitute the Zaurus?

Just take your Palm or your cell phone, and thanks to IrDA support, you can beam your data directly to the Zaurus, if its ROM supports IrDA. Launch Applications --> System info --> Version. If you see ROM version 1.1x, IrDA will work. If not, you will have to update your ROM with version 1.1x or higher, as explained below. This may seem like an obvious suggestion, but sending by infrared is the easiest way to transfer your data.

On your Palm, open the relevant application and click on the first tab and “Beam data” (calendar), “Beam business card” (phone book) or “Beam category” (phone book) should you want to send every business card at once.

On your cell phone, these steps will depend on the cell phone model. Please read your cell phone manual to find out how you can activate its infrared port to send data. It must 1) have an infrared port, 2) support IrDA and 3) conform to the VCS/VCF norm to send telephone numbers or calendar entries. Any recent cell phone (like the Siemens S35) will be fine.

On your Zaurus, now launch Settings --> Beam receive application and watch your data being received to the new handheld. Do not forget to click on “Add to Address book” or “Add to Calendar” when prompted to include the received information in the relevant applications.

If you have a Windows machine, or if you use Outlook as your PIM, there is another possibility. Just install intellisync, which is provided for free on your software disk. It can synchronize with Outlook or Palm Desktop, which means it will convert your Outlook or Palm contacts to Zaurus contacts.

Synchronizing Data

If you choose the intellisync method to get your data, you need to send it to the Zaurus. If you prefer another method, you need to back up this data on your PC anyway.

Look at the Zaurus cradle; you will notice it has a USB port. We will make it work perfectly with the Linux kernel after some simple steps.

First, you must know that the version of your Zaurus ROM dictates which synchronizing software you can use with your PC. Run Applications --> System Info --> Version to find which ROM your Zaurus is running. Read “Updating the ROM” below if you want to use a specific version. If you cannot see any ROM version information on there, then you are running a 1.02.

Go to more.sbc.co.jp/slj/download.asp to download the synchronizing software you need. The installation instructions are provided with the software. You may have to patch your kernel to compile a USB module.

Should you need more help, an excellent step-by-step guide is available. It includes help to make your Zaurus connect to the Internet using your computer connection.

The synchronizing software on your PC will let you save data every time you want to. It is recommended that you back up your agenda on a daily basis. You can then use desktop software or your computer to maintain it as well as your Zaurus and have both versions always synchronized.

Now that you have your Zaurus connection working, please back up your data immediately because we are going to test all kinds of software. You don't want to lose the PIM data you carefully put on your Zaurus, do you?

Flashing the ROM

Did you get a developer version Zaurus 5000D? Have you already flashed it? If you have not, you should consider updating the ROM.

First, which ROM version are you using? If you have read the previous sections you already know that Applications --> System info --> Version will tell you which ROM version you are using.

The ROM updating process is very simple. First, go to more.sbc.co.jp/slj/index.asp and download the ROM version you need. Remember, the latest is not always the best; for example, 1.11 is known to leave very few places to install applications, peg CPU usage at 100% all the time and keep the system load at 5+.

If you want a free-software only ROM, without the closed-source Java environment or the Opera browser, you can get it from sourceforge.net/projects/openzaurus.

Once you have downloaded the ROM file of your choice, you have to send it to your Zaurus. The best way is to put in on a CompactFlash card. You can get one for less than $70. You also will have to buy a CompactFlash USB reader or a PCMCIA converter for CompactFlash cards for using the CompactFlash card on your PC. Please check which device drivers are available for using this hardware on your GNU/Linux computer. You will use it to install a lot of applications in the following sections.

Now rename the ROM file to romimage, and put it in the root directory of your CompactFlash card. It must have been formatted in FAT16 to be recognized properly by your Zaurus. Just insert the card, pop up a terminal and type ls -l /mnt/cf to check if the file is present.

If you have any important data in your Zaurus, you should back it up using the synchronizing software as explained before. Any data will be lost during the ROM update process. You have been warned!

Now, turn off your Zaurus and plug in the AC power. The orange “charging battery” LED will turn on. Next, open the battery compartment lid but do not take the battery out. Now the tricky part: while pressing the C and D keys on the keyboard at the same time, press the full reset button once. This button is located below the battery compartment and can be accessed with a stylus.

You may need a friend to help with this awkward key-pressing sequence. If you were successful, both LEDs will turn on and the update process will start. You should not touch anything or play with the power plug or reset button. An incomplete ROM update may damage the Zaurus. It is best to have a coffee and come back three minutes later. You will find both LEDs turned off. You can then eject the card, close the battery compartment and press the reset button. The next time you start up the Zaurus, the new ROM will be used.

Installing Applications

Even with the new ROM, your Zaurus is quite empty. You may have noticed that new applications, like the sound recorder or the infrared apps, came with the ROM update. Run Applications --> Terminal and try some commands. You will quickly find top, vi and other command-line utilities missing.

If you did try to type rpm or dpkg, you must be wondering how you can install applications on the Zaurus. Are we back to old Slackware plain .tar.gz time?

For obvious memory-size limitations, rpm or dpkg cannot be used on the mobile Linux environments. The problem was solved when the first versions of Linux running on the Compaq iPAQ appeared: a new packaging format was designed to be simple and straightforward. Its name is ipkg, and it is mostly a .tar.gz with some basic control information on control.tar.gz and the data on data.tar.gz in the Debian way.

If you want to install an application, just type ipkg install package.ipk. Make sure it was compiled for ARM CPU and that you have the libraries it will need. If you want to remove a package, ipkg remove package will do it.

You also can use Settings --> Add Remove Software, but it fails to work sometimes. Typing ipkg on the command line is the best way to install software.

But how can you bring .ipk files to your Zaurus? If you followed the previous advice, you may have purchased a CompactFlash card and a converter to update the ROM.

If you have not, consider an SDRAM card. This will let you use the additional storage space while a device is plugged into the CompactFlash port.

Installing software is just downloading a .ipk file on your computer, putting it on the Flash card (CompactFlash or SDRAM) and transferring the files with ipkg.

To find out where your Flash card is mounted, start a terminal and type mount. If you can see /mnt/cf or /mnt/card, just go to this directory using cd /mnt/cf, then type ls to see a list of available files. Typing ipkg install somefile.ipk will then transfer the files to the Zaurus.

You may then remove the ipkg file, but it is recommended you keep it somewhere on your PC because a new handheld is like a new toy—you are likely to try a lot of different software before deciding what is worth keeping.

Some recommendations now: first, get the famous vi editor because you will need an editor to change your configuration files in /etc. This vi package will get you ps as well. If you prefer Emacs, download prdownloads.sourceforge.net/zaurus/uEmacs4s1_arm.ipk instead.

You also must install zlib from prdownloads.sourceforge.net/zaurus/zlib_1.1.2_arm.ipk since many applications depend on it.

An excellent way to start using the Zaurus is by playing games. The best way to play games on the Zaurus is to install an emulator. What about playing plain old Nintendo GameBoy games? If you have purchased the games, get GnuBoy and find a way to download the ROM files legally for the game you own. Keep in mind that downloading ROM files on the Internet for games you do not have is illegal.

By making a few changes, you can get a GnuBoy application associated with all of the *.gb and *.gbc files. This means you will be able to start each GameBoy game by simply selecting the files from the Documents tab.

You installed an editor, didn't you? So next add the following line to /home/QtPalmtop/etc/mime.types:

application/gameboy gb gbc

And add these lines to qtopiagnuboy.desktop:

MimeType=application/gameboy
        MimeTypeIcons=GnuBoy

You must know NetHack—wouldn't you like to play it on your Zaurus as well? Download the .ipk file from trolls.troll.no/warwick/nethack.

If you prefer a plain old chess game, do not forget the Zaurus is a Java-capable device, so you can get Laser Chess Java from www.laserchess.org/downloads/laserchess_1.09_arm.ipk.

Now, you may want to take a screenshot of the applications you are evaluating. Using the screenshot applet is straightforward. Download it from prdownloads.sourceforge.net/zaurus/screenshotapplet_0.1_arm.ipk.

What about installing the X Window System? While the Zaurus comes with Qtopia, there is nothing preventing you from installing X as well, except memory limitations of course!

Download all the X files from sourceforge.net/project/showfiles.php?group_id=39939&release_id=70845 and put them on your Flash card.

Now from the terminal, install x11zaurus_0.2_arm.ipk by typing ipkg install x11zaurus*; say “yes” to the reboot question; let your Zaurus restart, and then drop to the console again. To prevent Qtopia from starting, press the / key when you see the Wait message if you use ROM version 1.1x, or press the space key for versions prior to 1.1x.

Then install icewm with ipkg install icewm_* and start X plus the window manager by typing wm.

The first time you run X, you should see the touchscreen calibration page. Slowly drag the stylus to the upper-left corner until it bumps against the corner of the plastic frame, then do the same in the lower-right corner when prompted to do so.

Then the window manager should start. It has a couple of applications, as well as default themes, preconfigured.

Here are some X installation notes:

  • The installation scripts support SD and CF card installation. Follow the prompts on installation and point it to either /mnt/card or /mnt/cf as appropriate.

  • To recalibrate your X display if it gets crooked, exit X, start up in console mode and type touch /etc/FORCE_ZTSD_CAL.

  • X installation is known to fail with ROM version 1.11 because of the lack of disk space, and /dev/isd may be missing as well, so you should choose the safe path and Flash an old ROM version (and use appropriate synchronization software) if you want to use X.

We can only hope that a new ROM version will fix the X installation problem soon. Meanwhile, you can play with some interesting X applications.

What about snes9x, available at sourceforge.net/project/showfiles.php?group_id=39939&release_id=70845? It is the famous Nintendo SuperNes emulator. Just like the GameBoy emulator, make sure you have the games: it is illegal to download ROMs for games you do not own.

Even better, get xcopilot at http://sourceforge.net/ and download the ROM of your Palm to the Zaurus. Once again, it is illegal to download Palm ROM to the Zaurus if you do not have a Palm. Now you are able to run your former Palm applications inside the Zaurus.

We will not insist on these two emulators because they prevent you from enjoying most of the Zaurus applications, which run on Qtopia and require you to reboot to use the X Window System. An xcopilot emulator running natively on Qtopia would let you run Palm applications with greater flexibility, either next to Qtopia applications or while using Qtopia applications. It is rumored to be under development. It will certainly be a killer application and broaden the Zaurus market acceptance through Palm compatibility.

If you want more applications, whether for X, the command line or Qtopia, just go to www.handango.com/sharp and sourceforge.net/project/showfiles.php?group_id=39939&release_id=70845 where you will find a lot of interesting software.

What about a movie now? Go to www.pocketmovies.net and download a trailer. Then start Applications --> Media Player, choose Options --> Full screen, plug in earphones and enjoy!

The quality is excellent for such a small device. You can play movies in MPEG-1 SIF (320 x 240) format at 24 frames per second. If you want more frames per second or want to store more movies, HALF SIF (160 x 120) is also possible. The “Fit to screen” option will make the low resolution nearly unnoticeable on this small screen.

With the 1GB IBM Microdrive CompactFlash hard disk, you should even be able to take some movies on your pocket, even more if you think Sharp promised DIVX support soon. Meanwhile, some hints may help you: renicing the mpegplayer process to -20 increases the frame rate. You also can reduce the throughput (400KB) and use VBR (variable bit rate) in your mpeg-1 encoder to get a better looking video. A low sound quality like mono/22KHz also can be helpful to store more movies and increase the frame rate.

Software Indigestion, Swap and Memory

Ouch. If you tried all the software we suggested, your Zaurus is now having indigestion. The symptoms of this overfilling are simple: ipkg install now gives you “no space left” errors.

You do not have a lot of options. It is either ipkg remove to get rid of useless software or ROM Flash back to version 1.10. This very version will leave you more RAM disk space left.

First, try to remove any temporary files from /tmp by typing cd /tmp ; rm -fr *. This may help a little bit because ipkg leaves the temporary files in /tmp, which increases the overfilling whenever it gets an installation error.

The 32MB of RAM in the 5000D developer version can be filled rather fast. This is because the ROM software has to be uncompressed in the RAM, eating most of the free space. Moreover, the RAM is then shared between the memory you use for your applications and the RAM disk where you are installing applications.

So do not trust the 32MB of RAM sticker for 5000D or the 64MB of RAM claim for the 5500. Think about memory available: in the 5000D with ROM version 1.11, you only have a 6MB RAM disk, i.e., less than a standard Palm!

Fortunately, we have a software solution with Linux: flashing a ROM, which is known to leave a RAM disk big enough to install applications, and creating a swap file to increase the system memory we are using for the RAM disk or flashing a ROM, which will use all the memory available to Linux as RAM, and using an external device like the SDRAM Flash card where you will install your software.

For the first option, you should use the 1.10 version, which has a 16MB RAM disk and for the second option, a custom-made ROM available from www.btinternet.com/~p.flinders/sl-5000d/readme.html will be just fine.

In both cases, purchase a 128MB SDRAM card, and plug it in to the Zaurus. It will free your CompactFlash slot for hardware peripherals like a wireless network card.

If you decide to use the custom ROM, just format the Flash card to use it as disk space where additional applications will be installed.

If you want to use swap (it can be done in both cases even if it is not mentioned on the custom ROM page), get fdisk from handhelds.org/ and create two partitions on the SDRAM: fdisk /dev/mmcda.

Then type n p 1 +25M t 82 to create a first partition of 25MB, which will be used for swap (type 82 is swap). Create a second partition, filling the rest of the card with n p 2 enter enter. It will be used as free disk space.

Now start the swap with swapon /dev/mmcda1 and mount the other partition with

mount /dev/mmcda. g/usr/mnt.rom/card -t ext2

Whenever the system goes in suspend mode or is rebooted, the swap will be removed. This is both a bug and a feature. It can be fixed with some /etc file editing, but you won't want to do that because there is only a limited number of total writes on a Flash card. You will ruin your SD card quickly if you do that.

However, while the NAND-type Flash used in most cards is usually specified at 100,000 erase/write cycles, this is only the minimum specification. Moreover, the Flash card controller adds ECC bytes to each 512-byte block and does wear leveling.

We can assume a continuous writing on a swap area at 100KB per second. Thanks to the wear leveling, the controller will cycle though the sectors, so if we have an 8MB swap area, it will do one erase/write per sector every 80 seconds. A real smart controller might even distribute them over the whole card.

The ECC algorithms will increase the erase/write cycles to at least 1M cycles per sector. That will give you two and a half years before seeing any failing sectors, and at that time the controller will start using spare sectors.

Therefore, if used properly, a Flash card will last for the lifetime of the system and definitely beat the MTBF (mean time before failure) of any hard disk even if you put your swap partition on it.

Getting the Internet

Having the Zaurus connect to the Internet is quite simple because the Zaurus uses the Linux kernel and its IP stack. You do not need a dirty hack, like the ones required to have a Palm connected.

Basically, you have two possibilities: use the cradle to connect to the Internet or get a wireless card.

If you have followed the “Synchronizing data” guide, you already have a working cradle connection. But this is no fun. Don't you want to be able to walk around with a Star Trek Communicator-like device, browse the Internet, read and write your mail wirelessly and even send instant messages or use IRC? If so, read on.

The best and easiest way to get a working wireless internet connection on the Zaurus is to go 802.11b. You have to buy hardware to do that; a CompactFlash 802.11b card will cost you around $100. Please make sure it will work with the Zaurus before getting one; read the compatibility list on more.sbc.co.jp/slj/peri.asp. If you do not know which card you should buy, go for a Linksys WFC 11. I could get it for $120 at J&R in Manhattan. On the Internet, you can get it for less than $100 with shipping and handling included.

If you have a ROM prior to 1.1x, you will have to edit your configuration file to make it work. Have you installed an editor as suggested? In /etc/pcmcia/wlan-ng.conf, add

card 'Linksys WCF11 11Mbps 802.11b WLAN Card'
manfid 0x0274, 0x3301
bind 'prism2_cs'

Restarting the PCMCIA service or rebooting will make the card work. In 1.1x ROM or newer, you just need to plug in the card to make it work—a real plug-and-play with no driver needed.

On the Zaurus, go to Settings --> Network and Sync and configure your wireless card. Give it an IP address on the local network with the laptop IP as the gateway machine, then the DNS IP, or use DHCP to fill this information automatically if there is a DHCP server on your laptop.

Now that you have a 802.11b-capable Zaurus, you need another device to provide internet connectivity via the 802.11b network. You have two choices: purchase an access point or use ad hoc mode with another 802.11b card to share an existing internet connection on the computer using this other card.

An access point is the best option, and you can now get one for $100. A hacker-friendly Linksys WAP11 is just perfect. Not only does it work well with GNU/Linux using SNMP software, but you also can update its firmware, use directional antennas to make a long distance wireless bridge, etc.

Now, if you have an access point, the WAP configuration and installation is up to you. Make sure it is plugged in to your Ethernet network. On the Zaurus, go to Settings --> Wireless LAN, and configure your CompactFlash wireless card to use “access point” mode.

If you are using a PCMCIA 802.11b in a laptop as your access point, install masquerading software on the laptop to share the internet connection. Then set up ad hoc mode. Check the module parameters or the manual you used to configure your wireless connection. On the Zaurus, go to Settings --> Wireless LAN and configure your CompactFlash wireless card to do ad hoc mode as well.

In both cases, should you set up WEP, be sure to use the same settings on your laptop and your Zaurus, otherwise nothing will work. Now if everything went well, try to ping your Zaurus. Does it work? Launch Applications --> Opera and try to access the Internet. Congratulations! You are now on-line and ready for the next part, installing internet-aware applications.

Internet Applications

Now that you can walk around with the Zaurus in the palm of your hand, while being connected to the Internet, there are some applications you need to install.

First is tkcjabber, a commercial, closed-source application from www.thekompany.com that is worth every cent. Basically, it will turn your 802.11b Zaurus into an instant messenger that is always on if you run it in the background. Using ICQ, AIM, MSN, YM and IRC will now be just like using a cell phone.

When you receive a message, the Zaurus “incoming message” LED blinks, and a cell phone-like sound is played. Then you can chat in a window.

There are only two drawbacks. First, the interface is icon-only. The first time you use it will be the worst: no tooltips, no text, no nothing. Fortunately, the user interface is very intuitive, and you will not be lost for long, except for the contacts. I have yet to find how to add contacts by ICQ number or nickname.

The second big problem is AIM connectivity. With the tkcjabber test version I used, I got disconnected from AIM every minute for the famous “unauthorized software access” reason—a very strange reason, considering Jabber got a license to use AIM. These bugs are very minor and did not interfere with the daily use of this great application. It is a recommended purchase. In fact, like Opera, it should come bundled with the Zaurus because you will always run it if you do instant messaging.

Zic is a free application that only does IRC. We can only hope it will compete with tkcjabber soon because competition would increase the quality of both products.

Now what about sniffing wireless traffic? There is an excellent application running on the Zaurus to sniff 802.11b traffic. If you are using a prism2-based wireless card, like the Linksys WCF11, you should not have any problem installing and using it.

Go to kismetwireless.net and download the binary archive for the Zaurus. Uncompress it with tar zxvf. It will give you the ipkg file you can install with ipkg install. If you installed zlib before as suggested, you are ready to run it. However, there is one fault: you cannot sniff traffic and use the wireless connection at the same time.

Therefore, you should use the following script to start Kismet. Store the script (see Listing 1) in /usr/local/bin/sniff.

Listing 1. Script to Start Kismet

Now try to do a ping to the Zaurus from your computer, and launch this script. You will see that it will not only find your access point but also the channel being used, and then capture the traffic. As suggested on the Kismet web site, you should use ethereal to process the dump file. The next versions of Kismet will let you plug in a GPS on the audio port of the Zaurus (to read the wireless network position) and may decrypt WEP.

Now that you can sniff traffic, scanning the machines on the wireless is the next logical step. This is where Nmap comes in. Get it from prdownloads.sourceforge.net/zaurus/zutilsnmap-extra.zip, and port scan the machines on the wireless network using nmap IPaddress.

You can get OpenSSH for the Zaurus from the Sharp web site.

It is not a standard ipkg file but a .tar.gz archive with an install script within. To install OpenSSH, type

tar zxvf openssh*.tar.gz
cd openssh
./install.sh m

This will install OpenSSH in the main memory. If you have an SDRAM card, replace ./install.sh m with install.sh s. Do not install OpenSSH on the CompactFlash port, since the wireless card will use it, and you will not be able to use OpenSSH and the network connection at the same time.

Note: you cannot untar the archive and install it. The /root directory is the home directory for the root user on many UNIX platforms and the Zaurus. However, it is mounted read-only at boot time, while many applications, including OpenSSH, expect to write to this directory. The Zaurus actually uses /home/root as the root home directory, but through some .profile hack. You need to fix that directly in /etc/passwd where /root is mentioned.

Editing /etc/passwd by setting /home/root as the home directory instead of /root solves the problem. This should be considered one of the many bugs that Sharp needs to fix by default.

If you have not installed an editor, or if you do not know how to use one, type the following command to fix /etc/password:

sed -e ':/root:/home/root:' /etc/passwd > /tmp/passwd
cp -p /etc/passwd /etc/passwd.BAK
mv /tmp/passwd /etc

Once this is done, you can complete the installation. Now that you have OpenSSH installed, not only can you administer a remote machine, but you can also remotely log in on the Zaurus with SSH. Type killall -HUP inetd to restart the inetd dæmon and allow for incoming SSH connections.

An FTP dæmon running on the nonstandard port 4242 completes the SSH. You can use it to get the files you handle with an SSH connection. But did you know there is no root password on the Zaurus by default? This means you are walking around with an open FTP server in your pocket, accessible with 802.11b. You may run passwd to set up a root password, but it does nothing to the FTP server, as if it was not using /etc/password. At least, the latest version of the ROM makes the FTP server open only on the USB network interface.

Anyway, a mobile FTP server would be great if only you could put a password on it. Now, what about an HTTP server to complete it? Get boa from sourceforge.net, and you can tell your friends you are walking with your internet server and that they can open an SSH version to administer it if they want—just make sure not to mention the FTP dæmon.

If they do not have SSH, or if they would prefer a graphical remote administration, what about using VNC? Grab a VNC server for the Zaurus from opensource.lineo.com/fbvncserver (opensource.lineo.com/fbvncserver/zaurus-fbvncserver_0.1.1_arm.ipk currently) and install it. Then somewhere on your network, start a VNC client; the Zaurus display is exported as if it was running X.

After you are done, you really deserve some time off. So, go get the demo version of zradio, a radio streamer. For only $10, you can use it to listen to on-line radio stations from your Zaurus. If you do not like the earphones, you may try the speaker hack from www.zymurgy.net/zaurus.html. Maybe the next version of this hack will include a microphone, which would let you use your Zaurus as a memo with the default “Recorder” application.

I hope you had some fun and found a lot of ideas for possible uses of the Zaurus with this software review.

Guylhem Aznar is the coordinator of the LDP and documentation coordinator for the GNU Project. Being a medical student in real life, he enjoys playing with his Zaurus.

email: g@7un.org