Notes about the Sharp Zaurus SL-5000D

Kent West, westk@acu.edu
24 May 2003

A few months back I came into the possession of a Sharp Zaurus SL-5000D. At first I was thrilled. A neat little PDA that runs Linux, and has a pull-down keyboard, and two expansion slots. What a neat toy!

But then I learn that the software is designed for syncing with Microsoft Windows. Yuck! What's with that?! Even with all the neat aspects of WindowsXP, I'm still finding that as a support technician I have to rebuild boxes far too often, and as a Linux convert, I find Windows to be extremely limiting and annoying.

Still, the Linux community has figured out how to get the Zaurus to synch with Linux.

Besides, with my wireless card, why do I need to synch anyway?

What was more serious to me is that the Zaurus ("Z") was pretty much unusable. If a calendar event set off a reminder alarm, and I wasn't there to click "OK", the message kept the machine on until the battery was drained or until I got around to clicking "OK". Lame-o. Another major problem is that I was constantly running out of memory. And there were lots of other little irritations like that.

Then I discovered OpenZaurus, which is a replacement of the operating system shipped by Sharp. OpenZaurus ("OZ") is not perfect, but it's a lot better than the OS that came on the unit, and has made the Z lots of fun, and more importantly, usable.

So the main point is that if you have a Zaurus, use it as it is for long enough to get irritated with it, then flash it to OpenZaurus.

In this page, I expect to document some of the things I found along the way, perhaps adding to or clarifying some points in the OZ documentation. I highly recommend that you visit the OZ site (http://www.openzaurus.org) and read up on OZ.

What I've Got

The Zaurus I have has included with it a SanDisk 128MB SD card, and a SanDisk 256MB CompactFlash card. Although this statement doesn't really belong here, I'll make it here anyway: "I'll never purchase another SanDisk device unless I'm convinced things have changed." I also got a USB cradle, a USB extension cable, and a small, keychain-sized USB reader which will take the SD card, but not the CF card.

Where I Started

I had had a Palm Pilot before, a Model III I believe. It was a fairly neat toy, but with only 2MB of RAM, it was pretty limited. It was this unit on which I learned how to connect via a serial cradle to my Linux box and sync to JPilot, and use some command line tools (pilot-xfer, etc). Later I acquired an 8MB Handspring Visor, which I liked a lot better, if only because I could fit a Bible onto it. Both of these units were monochrome, and ran the Palm OS. Since the Visor's cradle was a USB device, it forced me to learn even more about my Linux setup and get USB synching working, which I did. This was in the earlier days of USB support on Linux.

When I acquired my Zaurus, I knew nothing except what I'd read on the occasional review linked on Slashdot and etc. Basically I knew that it was powered by Linux, and had a pull-down keyboard. "What a cool toy! I need one of these!"

For the first day I was pretty pumped, but I soon became disappointed with it. I couldn't get it to be a useful tool. And if I, a Linux zealot, couldn't enjoy the unit, how could the average PDA user find it? It depressed me because it made Linux look bad.

As I googled and dogpiled for information on making my Z more useful, I occasionally stumbled across a reference to OpenZaurus. I went to their site and did a little reading, and thought that maybe someday I'd be brave enough to try flashing my Z, but not Today.

I pretty much set the Z aside, and forgot about it.

But then I started seeing these USB keychain microdrives, which are essentially flashram, like the SD or CompactFlash, in a USB connector. I also saw USB readers into which you can put your flashram stick and connect to your PC. Then I remembered that I had a USB connector that came with my Z, that was designed to fit the SD card. "Ooh, I can learn more about flashram and USB on my Linux box!"

So I plugged the connector into a USB port on my Linux box, which had a recent install of Debian 3.0 ("Woody") on it, upgraded to "Unstable". The USB's hotplug manager ("usbmgr") automatically beep-beeped when I plugged in the cable. That's promising. Then I ran "usbview" to see if it showed up in the USB list, and sure enough, there it was. On a different machine that I tried, that didn't have usbmgr running, I got an error about the usbdevfs not being mounted, or somesuch, so back to the web to do more research, where I found some esoteric command like "mount -t usbdevfs none /proc/bus/usb/devices", which then allowed me to see the USB reader.

I then inserted my SD card, and then did some more web research to figure out how to mount it. (Yes, the reader itself has to be mounted onto the usbdevfs file system, either manually or via a tool like usbmgr, and the card inserted into the reader has to be mounted.) Turns out it was a simple mount command -- "mount /dev/sda1 /mnt". Instead of mounting it on /mnt, I wanted my normal non-root user to be able to get to the files, so I created a directory in my home directory called "sdCard", then mounted via sudo like so: "sudo mount /dev/sda1 /home/westk/sdCard -o uid=westk" ("westk" is my normal non-root user account name, or "uid"). Of course with other options you can accomplish different results. More recently I've been playing with other pendrive/keychain/thumb drives (whatever they're called) and have learned that sometimes I need to mount /dev/sdb1 instead of /dev/sda1.

Now I was able to copy files to and from the SD card on my Linux box. Cool! I had a USB keychain microdrive. I also had a method to transfer files to/from my Zaurus now, as I hadn't yet gotten the cradle to work with my Linux box.

But first, more experimentation. I had read that these flashram cards could be reformatted, even with other file systems such as ext2. I thought it'd be great to get rid of the Microsoft-flavored DOS ("vfat") format in exchange for ext2. So I fired up "cfdisk" and started partitioning the SD card.

Hmm, things weren't working right. Try a different tool. Try a different method. Hmm, creak, crack, it's broke! It wasn't long before the card was completely unusable. So I took it to a Macintosh to reformat it. No luck. I took it to a WindowsXPPro box to reformat it. No luck. I loaned it to a friend to let him try. He took it to his friends. Basically, now, it's a piece of useless junk. It was after I had ruined my card that I found indications on the web that SanDisk brand cards tend to be problematic. Doh!

So I set everything on the shelf again, and left it alone for a few weeks.

Then my friend and co-worker brought in his new USB keychain microdrive. We played with it a while, and it made me want to have my own again. So I broke down a few nights later when I was near Circuit City and shelled out the $70 for a 128MB SD card. I could have gotten it cheaper if I had gone with SanDisk, but no way was I going to do that. So I got a PNY brand card.

It works fine as a USB micro drive, and as an SD card in my Z. I haven't yet tried to convert it to different file systems, etc. $70 is a lot of money to me.

However, I may try to do a bit-for-bit copy of my new SD card to my old broken SanDisk card. It'd be interesting to see if that recovers my SanDisk card.

So here I am, again with all the parts I started with, but with a Z that just wasn't usable to me. A few days later, after I'd pondered the uselessness of my Z, I decided it was time to try converting it to OpenZaurus, to see if that made any difference.

The Conversion

I started by reading up on OZ at http://www.openzaurus.org. I went over the instructions for flashing my Z several times, and finally decided to do it. Here's what I did.

Get the Files

Using my Debian GNU/Linux box, I connected to the "Download" page at the OpenZaurus site (http://www.openzaurus.org/oz_website/content/download) and downloaded these two files:
    zImage-5000d-24memory-6storage.bin (from the "Zaurus SL-5000D Kernel Images" table area)
    initrd.bin (from the "Root Filesystem Images" table area)
I also created a text file on my home directory named "zaurus.md5" and put these two lines in it:
    6a1b4e22bfe14e92d348b4d98ed8a32c  initrd.bin
    945558e74d1f50f308b2b9bcade569f4  zImage-5000d-24memory-6storage.bin

The number in the first column is the md5sum number that I got from the "Download" page, just under the file links mentioned above. An md5 checksum is just a hash that allows you to double-check that the file you downloaded is the same as the one posted by the web page's designer.

I then checked the files by running the command "md5sum -vc zaurus.md5", and got the result:
    initrd.bin     OK
    zImage-5000d-24memory-6storage.bin         OK
which tells me the files downloaded without getting corrupted along the way. (I also learned that if you have any blank lines on the end of the .md5 file, you'll get unexpected errors in the output.)

Next, according to the instructions at the OZ Install Guide (http://www.openzaurus.org/oz_website/content/installguide), I renamed the "zImage-5000d-24memory-6storage.bin" file to just plain "zImage".

Transfer the Files to the SD Card

Because I don't have a CF card reader, I couldn't transfer the files directly to the Compact Flash card. But I do have an SD card reader, and a working SD card! So I plug the SD card into the reader, and the reader into my USB port on my Debian box. <beep> <beep>.

Then I create a tempory directory in my homd directory, named "sdCard".

Then I mount the card with "sudo mount /dev/sda1 /home/westk/sdCard -o uid=westk".

Then I copy the two files with:
    cp initrd.bin mnt/
    cp zImage mnt/

Then I unmount the SD card with "sudo umount mnt", and remove the SD card from the USB reader.

Transfer the Files to the CompactFlash Card

I then put the SD card into the Zaurus, where it's automagically recognized and mounted.

I the start the Zaurus' File Manager, and click on the "Tree" tab, then browse to /mnt/card, then click on the "List" tab, and find my two files. I click on "initrd.bin", then click on File/Copy. Then I click on "Tree" again, move to /mnt/cf, and click on "List". I then click on File/Paste.

I repeat that process for the "zImage" file.

I now have the two files on the root of the Compact Flash card, where the OZ Install Guide says they need to be.

Time to Flash

I make sure the Zaurus is plugged into the AC power, as per the Install Guide. I then switch the "Replace Battery" switch to "Replace Battery" and remove the battery cover.

Then I put the stylus between my teeth, using my mouth as a third hand. Then with my two hands, I press on the "C" and "D" keys on the hide-away keyboard, turn the unit over, and then manuever the stylus with my mouth so that it presses the Reset button inside the battery compartment.

I let off the keys, and flip over the unit and see both lights on.

So I set the machine down and let it cook for ten minutes or so.

When one of the lights goes out, just leaving the power light on, I know the flash has completed.

I press the Reset button again, replace the battery cover and switch back to "Normal Operation", and power on the unit.

And instead of seeing the colorful OpenZaurus splash screen which is obviously different than the dull "Sharp" (is that an oxymoron?) screen that belongs to the previous OS, I see the dull "Sharp" screen, which means the flash failed.

What went wrong?!

Try Again

I got the Zaurus second-hand, and there were lots of files and directories on the CF card, including one named "romimage". I got to wondering if these files were getting in the way somehow. One of the directories was named "backup", so I moved all the files off the root into this "backup" directory, except for the "initrd.bin" and "zImage" files. So other than directories, these were the only two files in the root of the CF card. Then I tried flashing the unit again.

This time seemed to take a few minutes longer, but that could've been my imagination. What wasn't my imagination was that this time, both lights went off. So I pressed the reset button again, put the battery case back together and set the switch back to "Normal Operation", and powered up.

Whoo-hoo! A colorful "OpenZaurus" penguin-critter appears, letting me know the flash was successful. The bootup process is a bit different; smaller fonts, more information flows by, and soon I'm looking at a new QTopia graphical environment.

I'm there. Woot!

Tweaking

The first thing I did was eject my CF card (by clicking on the "card" icon at the bottom left, and then clicking on the "Eject CF Card" link), and insert my wireless CF card, so I could hit the network. Then I looked for a web browser or email client, and found nothing.

So I found the "Packages" icon, and clicked on it, thinking to install some stuff. There's a long list of stuff, with blue dots next to them and with blank checkboxes next to the blue dots. There's also a pull-down menu in the top-right area that says "Installed Pkgs", so I'm assuming that anything with a blue dot is already installed. I click on the pull-down and find "local IPKG" which then shows me a couple of ipkg files I had earlier loaded onto my SD card in anticipation of loading a Bible reader/version on this unit. Cool. These items don't have blue dots. So I put a check in the checkboxes, and then click on the green --> arrow in the top right corner. Looks like this is the way to install these packages, as there's a box that says "Install" followed by the two packages, and a "Start" button at the bottom of the screen. I click on "Start", and immediately realize these are being installed to the root directory, as indicated by a pull-down menu at the upper right. I know from previous reading that I'm not going to have room for that, so I click on "Abort", and abort it does. When I close this window, the system seems to hang for about 20 or 30 seconds. Then I reselect the two packages, click on the green arrow, change the pull-down menu to "sd" to put the apps on my SD card, and click on Start. In just a couple of minutes the process has finished, and under the "Q" menus I now have a QSword Bible reader with the King James version. Cool. (BTW, I got the KJV because it was free; I think Christians are doing a disservice to themselves and to the world by using an antiquated version that subconciously teaches us to separate our everyday lives and our church lives; they should be one and the same.) I also notice in the package manager that these ipkg files now have a blue dot by them.

There should be a way to install packages from the network. Within the Packages application I click on "Options/Configure". Under the "Servers" tab I then click on "unstable", because I like bleeding edge, and then click on "Update". Has anything happened? I didn't see any activity. Maybe I should double-check that I have network connectivity with my wirelass LAN. So I open up "Q/Settings/Network" and see that I have an IP address that looks valid for my DHCP-enabled LAN. Just to verify, I open up "Q/Applications/Konsole" and ping weww.wired.com. Success!

So back to the Packages configuration screens. I close that screen, and then click on "Actions/Update Lists", followed by "Start". It goes very fast, and then again, the system seems to hang for 30 seconds or so. The pull-down menu still only mentions "Installed Pkgs" and "local IPKG", so I must've done something wrong. Back into "Options/Configure". This time I "X" the "Active Server" checkbox, and try again.  Ooh, looks like it might be working. Again, the hang, then the pull-down menu has "unstable" included, and when I click on it, I see lots of new packages to be installed. Fun.

So I get to experiment, and I'm sure I'll hose something, forcing a reflash of OpenZaurus. Oh well, at least I have good instructions.