Skip to main content

Linux on board: Zaurus pioneers embedded Linux

Those who cannot remember the past... et-cetera, et-cetera

Photo of Peter Seebach
Peter Seebach has been using computers for years and is gradually becoming acclimated. He still doesn't know why mice need to be cleaned so often, though.

Summary:  The Sharp Zaurus handheld was a pioneer of embedded Linux®, and even though the Linux version is not around much any more, Peter Seebach thinks it's a good idea to pay tribute to this early-adopter technology. In this installment of the Linux on board series, Peter dismantles the Zaurus SL-5600 to get a better look into history.

View more content in this series

Date:  13 Dec 2005
Level:  Introductory
Activity:  2096 views

George Santayana once said, "Those who cannot remember the past are doomed to repeat it." But in the computer design industry, it seems, this warning has gone unheeded. Companies often repeat the mistakes, lessons, and improvements of previous systems.

When the first announcements came out that a new Sharp Zaurus would "run Linux," the Linux community was abuzz with fascination and rumors. Years later, there are still handheld devices running Linux that draw inspiration and ideas from Sharp's work, even though the Linux-based Zaurus has faded to obscurity in the U.S. market.

This month's Linux on board looks at the Sharp Zaurus SL-5600. This was the second retail version (the first being the SL-5500, which in turn came after the SL-5000D developer kit version), and it shows some of the roots of current efforts in the field.

The design of an embedded Linux system carries with it a number of considerations; the Zaurus was one of the first systems to tackle them. The early response from the Linux community was very enthusiastic, but the devices didn't have the commercial success in the U.S. that Sharp might have hoped for.

Hardware design

A major driving concern when designing an embedded system is hardware capabilities. The Zaurus was built around a hardware platform reasonably typical for handheld computers:

  • The CPU is a 400MHz Intel® XScale; Linux calls it an ARM processor because gcc doesn't tend to track marketing terminology.
  • The system has 64MB of flash memory and 32MB of RAM. The 5500 had 32MB of flash and 64MB of RAM; as a result, a few programs run on the 5500 but not on the 5600.
  • On the other hand, the 5600 gained the ability to survive power loss fairly gracefully.
  • It has a 320x240 screen, typical for handheld PCs. (Later models upgraded to a full 640x480, which is absolutely stunning to behold.)
  • It has Compact Flash (CF) and Secure Digital (SD) slots and can support non-storage devices such as an 802.11b wireless CF card or an Ethernet adapter.
  • The Zaurus has a selection of generic buttons, as most PDAs do, but it also has a small hidden keyboard. The keyboard is really one of the selling points; even a very small keyboard can be a big improvement over handwriting recognition. The keyboard is surprisingly usable.

The 5000 and 5500 were very similar hardware designs. Some later models were clamshell designs that offered a larger keyboard in which the screen could flip around to produce a traditional portrait-format PDA screen with stylus-only -- the same design that most tablet PCs have today.

The 5600 offered some improvements over the 5500, but the change from the StrongARM processor to the XScale wasn't entirely smooth. In particular, the new model performed poorly when running some older binaries. The new model did offer substantially improved battery life (through the simple expedient of making the battery twice as big).

The differences between the 5500 and 5600 reflect the feedback PDA users gave Sharp; in most cases, the changes reflected common concerns PDA users had. For instance, storing user data in flash is an excellent solution to the entirely too-familiar data loss that PDA users face if a battery runs low. In addition, the 5600's keyboard is slightly easier to reach than the 5500.


Building a PDA

Many of the assumptions a Linux developer might typically make for an embedded system don't work on a PDA. PDA users want to be able to run new applications, store data, and play around. Furthermore, PDAs have been using GUIs since 3Com introduced the first Palm Pilot. A 9600-baud serial console is not a particularly likely choice either.

Desktop Linux assumptions do not fit much better. Most PDA users would not feel comfortable logging onto a system and then explicitly starting an X server. Furthermore, the 320x240 screen does not favor text console usage. The virtual desktops, multiple mouse buttons, and other features of a typical desktop are ill-suited for use on a small screen with a stylus.

The Zaurus uses the Qtopia desktop environment instead of an X server. You could cram X onto such hardware (after all, this machine has more memory and processor power than, say, a SPARCstation SLC was likely to have had), but the small footprint and small display don't fit well with X's workstation assumptions.

The PDA apps included with the Zaurus were one of the weak spots of the unit as a PDA. It was a fairly young set of applications, not as full-featured, for example, as the applications on the Palm platform.


Adapting Linux

One of the challenges of getting Linux to work on a PDA involves deciding when to use the normal Linux way of doing things and when to not use the normal way. The results aren't always what users want. For instance, the decision of when (or even whether) to require passwords is a challenge. Most users don't want a password prompt on a PDA.

The Zaurus pretty much abandoned security from the start. The GUI runs as root, but even if it didn't, there's no root password; the su command just works.

The Zaurus is based on BusyBox (version 0.60.4). This most excellent utility lets a number of programs be linked together into a single executable. The organization is a little odd, though. BusyBox is built to include gzip support, but the zcat utility is provided separately. Still, it's a basically sound decision, because it saves a fair bit of space.

Booting

The rc.d system has been preserved essentially unaltered, although the definitions for the init levels aren't quite the same as they might be on a desktop Linux system:


Listing 1. Runlevels on SUSE Linux and the Zaurus

SUSE:
# runlevel 0  is  System halt   (Do not use this for initdefault!)
# runlevel 1  is  Single user mode
# runlevel 2  is  Local multiuser without remote network (e.g. NFS)
# runlevel 3  is  Full multiuser with network
# runlevel 4  is  Not used
# runlevel 5  is  Full multiuser with network and xdm
# runlevel 6  is  System reboot (Do not use this for initdefault!)

Zaurus:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - JavaVM(Intent) developer mode
#   5 - JavaVM(Intent)
#   6 - reboot (Do NOT set initdefault to this)

The default init level on both systems is 5, and the levels are analagous. In fact, on the Zaurus, levels 3, 4, and 5 don't appear different to my untrained eye. Curiously, /etc/inetd.conf has every system service disabled, but inetd is still started up. On earlier versions, it was worse: there was an ftp server listening on an unusual port. And yes, with no root password, that could be seen as a security hole.

However, not much is done by the inittab/rc.d subsystem; the system gets the GUI started and then the GUI does all the real work.

Unlike a text console Linux system, the Zaurus displays messages telling the user to be patient. It takes a couple of minutes to boot, which is uncomfortably long on a PDA. It certainly compares unfavorably to the 10 seconds (including loading extensions) it took to reboot my Palm PDA.

The rc.d directories contain a few of the usual types of startup scripts with readable names:


Listing 2. The files in rc5.d

$ ls rc5.d
S04sd      S06pcmcia  S15inet    S23portmap S41atd     S48usb     _S02syslog

The sd and pcmcia scripts provide the hooks for the SD and CF slots, respectively. (CF slots are just small PCMCIA slots, mostly.) The syslog script runs particularly early and even rotates log files.

What you might miss, if you just look at these, are the entries in inittab that do a bit of other system initialization:


Listing 3. ininttab entries

   si::sysinit:/etc/rc.d/rc.sysinit
   s0:24:respawn:/sbin/getty 9600 ttyS0
   pd:3:respawn:/etc/sync/serialctl
   # Specify program to run on tty1
   1:2:respawn:/sbin/getty 9600 tty1
   ln:345:respawn:survive -l 6 /sbin/launch
   #qt:5:respawn:/sbin/qt
   # collie sp.
   sy::respawn:/sbin/shsync

In the default run level of 5, some of these won't run -- but it's very interesting to see what some of the options might be. The launch program illustrates something about file system layout. The launch program runs from a config file (according to strings) called /usr/sharp/etc/launch.conf; /usr/sharp is a link to /home/sharp -- because, of course, anything you could change has to be in /home.

File system layout

The file system on the Zaurus is a bit weird. CF cards are automounted on /mnt/usr.rom/cf and SD/MMC cards on /mnt/usr.rom/sd. Very surprisingly, /etc is a link to /home/etc. This makes no sense until you realize that backups are just backups of the /home directory; this way, /etc is backed up.

The / and /home file systems are both stored on flash memory, which is partitioned into two parts. The / file system is nearly full, which imposes definite limits on software expansion options -- but it also has a number of files that probably don't need to be there.

The root file system contains some magic; the files in it take up substantially more space than the root file system holds! This is done by using JFFS2 (Journaling Flash File System version 2), which compresses stored data; the 21,544 blocks of storage available hold roughly 60,000 blocks of files.

It seems that removing a few files would free up a lot of space. For example, bash. Bash is many things, but space-efficient is not among them; a 548KB program is perhaps a poor fit for a fairly crowded root file system.

Perhaps more interestingly, the /root directory contains some tar files of crucial system files in case a restore is needed. These tar files are not compressed; compressing them would free up some space (though not as much as you might think, since JFFS2 is compressing them automatically).

Account management

Unlike systems that completely ignore accounts, running everything as root, the Zaurus system runs some things as root (including the GUI itself), but runs most applications as a user called zaurus. Of course, without a password for root, this has minimal effect.

There's no real support for logging in or out; you can't specify what user you want to run things as. Of course, there's not much reason to on a PDA. Still, it might be nice to have better user/admin separation simply because, being a real live Linux machine, the Zaurus could run services. If this sounds useless, you've obviously never left your PDA at home, happily plugged in, with no way to get to your address book. If only it ran an ssh server!

Adding users is basically unsupported, and some users reported having file system stuff damaged in the process; for instance, having root-owned files given to the new user when the adduser program was run. Oops.


Summary and looking ahead

The early Zaurus had a slightly unfinished feel to its installation; there were a number of things that might have been fixed given more development time, or possibly just more discussion of the design tradeoffs.

While Sharp's development of revised ROMs for the unit was limited, third parties developed a number of drop-in replacements. One of these projects, Opie (Open Palmtop Integrated Environment; see Resources), has long since branched out into supporting other non-Zaurus hardware such as HP iPaq handhelds.

Next time in Linux on board: a closer look at what Opie is like these days (in the form of the Familiar project; see Resources). The development work that has gone into projects like this takes a lot of inspiration from the initial user experience with older systems such as the Zaurus. This is Linux doing what it does best; providing an open environment where people can learn from experience without having to reinvent the wheel entirely from scratch.

We remember history so we don't have to repeat it. If you're working on a handheld project of your own, remember the Zaurus SL-5600 as an implementation with qualities worth emulating -- and those worth improving upon.

Got something of your own worth remembering? Tell me about it on the Linux on board discussion forum.


Resources

Learn

Get products and technologies

Discuss

About the author

Photo of Peter Seebach

Peter Seebach has been using computers for years and is gradually becoming acclimated. He still doesn't know why mice need to be cleaned so often, though.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux
ArticleID=100551
ArticleTitle=Linux on board: Zaurus pioneers embedded Linux
publish-date=12132005
author1-email=crankyuser@seebs.plethora.net
author1-email-cc=htc@us.ibm.com

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers