July 2001 Column


[ Site Index] [ Linux Index] [ Feedback ]


PDA's and Linux

Back in 1993 I made the mistake of buying an Apple Newton. Not just any old Newton, mind you, but a Messagepad 100 -- the original Newton. Even with a ROM upgrade, it sucked. The machine was slow, unwieldy, ate batteries, was pathologically incapable of learning my left-handed writing, and was probably best summed up as a curiosity. Luckily I only paid sixty quid for it, so it didn't hurt too badly: but I learned one lesson -- that handwriting recognition didn't work.

Another bunch of guys learned the same lesson a year or two ahead of me, but being smarter than me they set out to fix the problem. First, they wrote a program called "Grafitti". Grafitti taught the user to scribe in a simplified form: in return the computer could recognize it more easily and the result was an acceptably fast, workable, form of text entry. These guys then went and invented their own vision of a palmtop -- smaller and slower and more limited than the Newton (which was a general purpose computing machine, under the hood), but cheaper and lighter. They nearly ran out of money, were acquired by 3Com, and that's how Palm Computing's Pilot came to market.

(I didn't notice any of this at the time, being inseparable from my Psion 3A.)

Today, PalmOS runs on several families of palmtop computers sold by various companies -- Palm's own range, Handspring's Visor range, TRG's TRGPro, and it's big brother, the Handera 330. In fact, PalmOS is the number one operating system for palmtop computers (whatever Psion and Microsoft would like to believe). The reason is that PalmOS provides "just enough" functionality -- meaning that PalmOS machines can be made cheap and light. It doesn't provide multi-tasking, memory protection, or portability to any processor other than the Motorolla Dragonball family (a derivative of the venerable MC68000); in fact, you can't use more than 32Kb of memory for a code or data segment. It's like computing in 1984, all over again, with a very basic vintage Mac-style graphical interface, single tasking, and programs that will fit in 5-50Kb of memory.

(Compare and contrast with the fast ARM or MIPS RISC chips required by EPOC/32 or Windows CE. 8Mb of RAM in a WinCE machine will go in an eye-blink; in a PalmOS device it's like having a decent-sized hard disk.)

Now, this is the Linux column, so why am I banging on about Palm Pilots? Simply put: because a PalmOS device interoperates well with a desktop PC running Linux. There are some gotchas (which I'm going to talk about later), but in principle if you use Linux a Palm PDA makes an ideal portable companion -- and is less vulnerable than an expensive, fragile, thief-magnet laptop. Dropping a laptop or having it stolen can ruin your whole day: if the same thing happens to your Palm you'll still be cursing, but it's an order of magnitude cheaper to replace (and you won't put your shoulder out carrying it around).

SUBTITLE: Connecting the pilot

In general, you use a PalmOS device as a peripheral of your main computer: jot notes, add contacts, update your calendar, and then synchronize with the desktop box (upon which you presumably have a calendar program, address book application, and so on). You can also install additional PalmOS applications, which may have their own synchronization issues.

The standard utilities for synchronising a Palm Pilot with a Linux system come in a package called pilot-link; it's a set of command-line tools included in most current Linux distributions, or you can get the latest kit at http://www.gnu-designs.com/pilot-link/ (Pilot-link is no longer hosted on SourceForge.) On its own it isn't a whole lot of use (other than for backing up and installing extra software), but a number of "desktop" programs that run on Linux and provide calendars, address books, and so on use pilot-link as a back-end for keeping the PDA in sync with your main machine.

Pilot-link isn't the only tool for handling low-level synchronisation. Coldsync is an alternative (less widely used) kit for communicating with a PalmOS device: you can find it at http://www.ooblick.com/software/coldsync/. The main difference is that coldsync has a number of different conduits (file format translators) including a set of Perl 5 libraries for manipulating PalmOS data files.

If you use StarOffice 5.2 as your desktop office suite, there's a PalmOS synchronisation tool hidden in its depths; if your copy of Office is installed in /opt/office52, look in /opt/office52/share/palmpilot. You'll see something called starsync.prc -- a Pilot program. Once you've installed it on your PalmOS device (using pilot-link, described below) it will act as a sychronisation tool, allowing you to sync your address book, to-do list, and other data with StarOffice's scheduler (while StarOffice is running).

Pilot-link comes with command line tools to do a number of things -- the most useful of these is pilot-xfer, which lets you back up your Palm pilot from the command line, install program (.prc files) or databases (.pdb files), and a whole lot more. You'll need to do some basic setup on your system: if you're using the serial port cradle you need to create a symbolic link called /dev/pilot that points to the appropriate serial port, and you'll need to set the baud rate to use talking to the Pilot using the environment variable PILOTRATE. For example:

ln -s /dev/ttyS1 /dev/pilot export PILOTRATE=57600 # talk to pilot on first serial port at 57600 baud

(Note that pilot-link supports USB connections to Handspring Visors in versions 0.9.5 and higher.)

The first time you use a Palm Pilot you need to set up its username; the command-line tool "install-user" lets you do this (and lets you query and change the user name on an already-installed Palm Pilot). A fairly sensible thing to do every day is to drop your Palm Pilot into its cradle, tap the hotsync button, and type something like:

pilot-xfer -u ~/palm/backup

This updates an incremental backup of the data on your Pilot in the appropriate directory, so that if you have an accident and lose all the PDA's contents you can restore them by hotsyncing with the following command:

pilot-xfer -r ~/palm/backup

Suppose you want to install StarSync, the StarOffice synchronisation tool. To install a file, try this:

pilot-xfer -i /opt/office52/share/palmpilot/starsync.prc

You can get a listing of installed files (including applications and databases) off the PalmOS device this way:

pilot-xfer -l

(Or use the -L option to list the contents of the ROM and all sorts of other stuff as well.)

This barely scratches the surface of desktop integration -- there's a HOWTO document at http://www.orbits.com/Palm/PalmOS-HOWTO.html which goes into more detail about pilot-link. The manual page for pilot-link gives you a list of the tools in the suite (such as addresses -- dumps a Pilot address book in a generic format, memos -- exports Pilot memos into mailbox mail folder as separate messages, and so on).

SUBTITLE: Desktop tools

PalmOS synchronisation comes with the concept of conduits: software filters that convert between the file format of a PalmOS program (such as the address book or email tool) and some other program on your desktop machine. The idea is that file format translation should be carried out automatically whenever you hot-sync with your desktop machine. An important point is that conduits run on the desktop; and unfortunately they're not written in a high-level language, so Windows and MacOS conduits aren't usable on Linux.

A number of graphical desktop applications exist to let you read and update your address book, to-do list, and other databases on your desktop system; these come with their own conduits. Prominent among these programs are StarOffice, JPilot (http://www.jpilot.org/ -- uses GTK+, the graphics library underpinning the GNOME desktop), KPilot (the KDE pilot app -- from http://www.slac.com/pilone/kpilot_home/), and the GNOME pilot tools (from http://www.gnome.org:65348/gnome-pilot/).

All except StarOffice rely on pilot-link as a back-end to transfer data to and from the Pilot, but they provide varying degrees of editing support for palm applications. In particular, the gnome-pilot kit includes a conduits for synchronising Palm's built-in applications with GNOME desktop apps; for example GnomeCalendar and GnomeCard synchronise with the DateBook and Address Book on your Palm. If you're running Red Hat 6.2 (or later) you'll already have the GNOME desktop built-in; this starts a synchronisation demon (gpilotd) when you log in, so that tapping the hot-sync button on your Pilot's cradle has the expected effect.

SUBTITLE: PalmOS Applications that work with Linux

One of the useful things you can use your PDA for is to carry a bundle of web pages around with you, for offline viewing. The way it works is that you use an application like the AvantGo client, running on your desktop system; you use it to subscribe to various channels (actually websites that provide an AvantGo feed), and every day it prepares a database of downloaded feeds. When you hotsync, these are transferred onto your Pilot and you can read it on the train or at work without having to carry a huge bundle of paper. It's a great way to keep up with the news.

The best known web clipping application is AvantGo (www.avantgo.com), but it's commercial and not particularly UNIX-friendly; there's an unsupported UNIX desktop client for AvantGo at https://avantgo.com/setup/unsupported_unix.html.

Alternatively, you may want to look into Plucker (http://plucker.gnu-designs.com/index.pl). Plucker is an open source web clipping tool -- not quite as polished as AvantGo, but no harder to set up (given the contortions you have to go through to get AvantGo working with anything other than Windows -- for example, installing the MalSync synchronisation tool). Unlike AvantGo, Plucker doesn't require you to register your interests with a company's database; you just take a page of HTML links, add links to the sites you're interested in (and a maximum depth to probe to), and run the plucker-build tool; this generates a .pdb database that you can then transfer to your Pilot. The Pilot-side Plucker application is considerably smaller than AvantGo (about 70Kb, versus more than 300Kb), which is no bad thing, and unlike AvantGo it doesn't insist that the target website is designed specially for use with it (although clean design with no Javascript, frames or tables helps a lot with all Palm web plucking applications.)

Another thing you can do with a PalmOS machine is to read (or write) larger documents. In the early days of PalmOS, memos generated with the built-in memo app were limited to 4Kb each -- not really useful for anything other than hastily jotted notes. A file format was developed by Aportis for their on-line documentation reader, and the DOC format escaped into the wild; it's now the standard for (compressed) e-texts on PalmOS, and a number of editors and readers exist for it. DOC files don't contain formatting extras like italics and underlined text, but they're compressed fairly effectively. On Linux, you can create DOC files using the AbiWord word processor (from www.abi.com), convert text files to DOC using a command-line tool called txt2pdbdoc (from http://pda.tucows.com/palm/preview/34597.html), or use the Pyrite translators (http://pyrite.linuxave.net/dtk/dtk.html). You can read DOC files on your PDA using the excellent freeware reader CSpotRun (http://www.32768.com/bill/palmos/cspotrun/) or a variety of commercial and shareware tools.

Although it goes against the grain to recommend commercial software in an open source column, I'd like to reserve a good word for Wordsmith, the best word processor for PalmOS (see http://www.bluenomad.com/ws/prod_wordsmith_details.html). These guys are aware of the existence of Linux, and in addition to being able to edit DOC files without formatting, their word processor WordSmith comes with a converter between its internal file format and Rich Text Format that -- shock, horror -- runs on Linux. Consequently, if you need to edit formatted documents on the move, a PDA with WordSmith will interoperate tolerably well with AbiWord, KOffice, or StarOffice.

If looking for ways of carrying lots of documentation around on your palmtop -- say, all those Linux HOWTOs -- you may want to also check out iSilo (www.isilo.com), and GutenPalm (http://sourceforge.net/projects/gutenpalm/).

This isn't the Palm Pilot column, so I'm not going to run off at a tangent and start talking about all the applications you can possibly run on a Palm. Let's just say that my Palm IIIc carries numerous bits'n'pieces around, but the most frequently used seem to be AfterBurner (overclocking software to make it run faster), Eudora (a very nice Email program), Wordsmith (for those unavoidable fits of creative writing), iSilo and Plucker (for reading compressed repositories of HTML), APCalc (because the standard PalmOS calculator is a load of rubbish), and Sim City (the killer app for the colour Palm Pilots).

You can do more than simply exchange data with your Palm Pilot and read web pages under Linux. Palm have been diligent about courting the open source community; in particular they've released documentation and libraries for development, and even a ROM image of a Pilot that can be used in conjunction with an emulator to allow debugging of Pilot applications; see http://www.netmeister.org/palm/POSE/ or http://www.palmos.com/dev/tech/tools/gcc/ for details of installing the POSE emulator and the PRC-tools PalmOS development toolkit for Linux. PRC tools is a complete GCC-based toolchain for compiling C applications for PalmOS. You can, in fact, find the complete PalmOS programmer's manual on line at http://www.palmos.com/dev/tech/docs/.

In fact, there are other tools that allow you to develop software for PalmOS using Linux and UNIX as a platform; notably the new IFCTF PalmOS GNU Programming Environment (IPGPE), which is currently under development (in an alpha-ish state, available from ftp://ivan.Harhan.ORG/pub/embedded/palmos/ipgpe-alpha/). There's a port of Python to PalmOS: see http://www.endeavors.com/pippy/ for the Pippy project. And there're numerous other PalmOS native programming languages (including Forth and Scheme interpreters that are mostly free, and numerous commercial high-level languages).

SUBTITLE: Who needs laptops?

A PDA like a Palm Pilot isn't a suitable substitute for a laptop. For one thing, it doesn't run Linux. (Clue: that was a joke.) For another thing, the hardware is extremely limited. Due to the Palm's memory model it can't address more than 8Mb of memory. It only has a single serial interrupt, which is used by either the IR port or the serial port -- so you can't use the IR port to talk PPP via a GSM phone and use the external keyboard at the same time. (On its own, this drawback is enough to stop the PalmOS machines being useful dial-up workstations for a system administrator: you can't easily log into a remote server and work via ssh or telnet.)

On the other hand, a Palm Pilot can do a lot of the everyday tasks you'd want a laptop for. And it fills a gap while we wait for the next generation to show up.

For some time now Samsung have been hinting about an ultra-cool product called the Yopy, which they say they're going to launch later this year. (They said that last year, too.) The Yopy is a PDA developed by Samsung subsidiary G.Mate; you can currently get one only if you order the development kit. The Yopy is powered by a 206MHz StrongARM RISC processor with 16MB of SDRAM and 32MB of Flash memory; it is said that the final shipping product will have 64Mb of SDRAM. The display is a 240x320 pixel colour TFT screen (considerably better than any PalmOS device). On the interface side, Yopy has IrDA, USB, and serial ports, along with microphone and audio in/out jacks; it also has a type II CompactFlash card slot for memory and i/o expansion. There's an audio codec that is capable of handling realtime playback of MP3 audio tracks, and the CF card slot is compatible with IBM microdrives, so this is clearly going to be the ultimate MP3 player, if nothing else ...

What sets the Yopy apart is the operating system -- which is Linux. (And of course, the development environment is also Linux-based.) While Yopy uses its own rather unusual "Yopy Windows" graphical user interface, a project to port X11 and Gtk to the Yopy hardware is under way, suggesting more standard applications will follow. Along with a standard suite of PDA type utilities, the Yopy sports handwriting recognition -- and Conversay Systems' speech recognition software.

It's too early to tell if this device will revolutionise the PDA market by providing comparable power to a sub-notebook Linux system, but you can judge for yourself at http://www.gmate.co.kr/ (or even order a development machine, if you're feeling rich: see http://www.gmate.co.kr/english/products/development_kit.htm). Meanwhile, Samsung aren't the only PDA manufacturer evaluating Linux: Sharp have announced that they're dropping Windows CE, and a Zaurus palmtop will ship later this year with Linux as its operating system.

Agenda Computing (www.agendacomputing.com) are already selling a Linux- based palmtop, although it doesn't have the compelling lead of the Yopy. The Agenda VR3 uses a NEC VR4181 processor running at 66MHz, with 8Mb of RAM and 16Mb of Flash memory. It has a 160x240 grey-scale screen (better than the PalmOS standard, worse than the Yopy or Windows CE machines), and pretty much the usual software you'd expect, except that the basic operating system is a Linux kernel. (Weirdly, Agenda only seem to supply synchronisation software for Windows, and it expects to work with a copy of Microsoft Outlook!)

Oh, and there are reports that it's possible to load and run Linux on the Compaq iPaq PDA -- although it isn't sold with Linux as its operating system, and you are out on a limb if you do this.

The point of this efflorescence of Linux on palmtops is simple: the alternatives (Windows CE or Symbian's version of EPOC/32) cost money. Every time the vendor ships a palmtop, they get to pay another company a few pounds. In a market where the cheapest machines cost under a hundred quid, this hurts -- the profit margin can be so small that the operating system license fee wipes it out. With new, powerful embedded RISC processors turning up, it should be no surprise that Linux is likely to come from nowhere to bite off a chunk of the PDA market in 2002-2003.


[ Site Index] [ Linux Index] [ Feedback ]