News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Article: Exploring Linux PDA software alternatives

Dec 9, 2000 — by Rick Lehrbaum — from the LinuxDevices Archive — 8 views

Foreword: This article is the introduction to a new LinuxDevices.com series by Jerry Epplin that will explore the history, status, alternative architectures, and future developments of Linux on PDAs and handheld devices.



Embedded Linux on the rise

For several years, Linux advocates have predicted that Linux will become a significant factor in the embedded market. In addition to its virtues as a full-featured modern operating system, it is inexpensive to duplicate, an especially important factor for embedded systems. Others, coming from a more traditional embedded device development background, have been more skeptical, contrasting the compactness of older, more spartan software environments like VxWorks, QNX, or Lynx, to the relative bloat of Linux.

Until recently, this was a sterile debate. Yes, the inclusion of mature and standards-compliant features such as networking and GUIs made Linux appropriate for high-end embedded systems. And yes, its size made it inappropriate for most low-end systems. But as some predicted when the debate began, two trends have largely removed the bloat issue as a factor in choosing Linux for embedded systems.

First is simply Moore's law: the RAM, ROM, flash, and processing power needed by Linux is becoming cheaper and faster at a rate faster than Linux is consuming them with added features. Second is the improvement in Linux itself. Starting as an x86-specific kernel with little modularity, Linux has progressed to be architecture independent and to have clear modularity. The 2.4 series kernel is especially well-designed, making it feasible to add or remove components to optimize for a particular embedded platform.

Can Linux support PDAs?

In no area is this improvement more significant than for PDAs, a market for which Linux currently seems stunningly appropriate. Here is a market in which connectivity with desktop computers is important, so mature and stable networking support is a necessity. The presence of a GUI virtually defines what a PDA is, so good GUI support is also important. Current retail prices for PDAs are in the low hundreds of US dollars, a price range that allows designing in RAM, flash, and processing power sufficient to support Linux well.

On the other hand, the market is sufficiently price sensitive that most manufacturers find it onerous to pay even a token royalty to Microsoft or Palm for the use of an OS. Yet using a low-end or home-brew OS, in an attempt to target cheaper hardware, is simply out of the question — the market is moving too fast for the longer design cycles that would result.

In short, all signs now point to embedded Linux, as a platform for today's increasingly sophisticated PDAs.

The current state of PDA Linux

As of this writing, Linux on the Compaq iPAQ H3600 is probably farthest along. The iPAQ is a high-end PDA that is normally shipped with Microsoft Windows CE. However, Compaq is sponsoring an admirably open effort to port Linux to the iPAQ, found at www.handhelds.org.

The astuteness of Compaq's approach can hardly be overstated. They have made it extremely easy for anyone to participate in the development effort and have made the results open to all. They also seem to have sent free units to major Linux and open source players, with the result that some have recently expressed interest in participating in the development effort. These marketing moves are sure to have two results: first, Linux will progress rapidly on the iPAQ; and second, the market will continue to snap up iPAQs as fast as Compaq can produce them.

Currently all efforts to implement Linux on the iPAQ are, to my knowledge, based on the handhelds.org port of the Linux kernel. But the GUI implementations built upon this kernel are more diverse. The handhelds.org implementation contains a fairly straightforward port of the XFree86 implementation of the X Window system to the StrongARM processor used by the iPAQ. At least three other groups provide alternate GUI implementations — Century Software provides its Microwindows development toolkit, Trolltech has its QT Palmtop Environment, and Transvirtual has the PocketLinux distribution. Each of these implementations builds upon the base provided by the handhelds.org kernel.

The balance of this article will provide an overview of the main features and architecture of each of these distributions. In the future articles of this series, we will examine each of these PDA distributions in greater detail.



Century Software's Microwindows PDA Operating Environment

Like the other toolkits to be discussed, the Century Software PDA Operating Environment begins with the handhelds.org kernel, utilities, and cross-compiler. To this it adds a number of interacting components that together form a GUI development environment. Century Software has, in the finest open source tradition, pieced together this environment from a number of preexisting components.

At the base of this structure of components is Microwindows, a windowing environment designed to provide graphical and windowing functionality for a system for which screen, mouse, and keyboard drivers must be provided. The level of functionality provided by Microwindows is roughly equivalent to that of the Windows GDI or the X system; and, indeed, Microwindows provides two APIs, corresponding to those two commonly used systems. The GDI API is somewhat confusingly referred to as the Microwindows API, while the X-like API is called Nano-X. Both GDI and X have their detractors, but the decision to emulate two common APIs rather than invent a new one from scratch is eminently sensible — it allows a crowd of Windows and X programmers to become productive on Microwindows quickly, and it makes porting applications easy.

This porting factor is especially important in the context of Century's toolkit because its next layer is FLTK, a compact applications framework well suited to low footprint applications. FLTK is a cross-platform environment, designed to work on top of either X or Windows. Century chose to target the X API because they wished to preserve the option of running the system in a client-server environment, something that X is designed for but Windows handles somewhat clumsily. They modified FLTK to use the Nano-X API of Microwindows — they call their modified FLTK FLNX. FLNX uses the FLTK API, so FLTK applications should port to the Century environment without problems. FLTK provides the normal set of widgets that modern GUIs must have — text boxes, check boxes, menus, and others. Besides porting FLTK to target the Nano-X API, Century is working on modifying its look and feel to be more 2D, which they believe (in agreement with Palm and others) is more appropriate for PDAs.

Since both Microwindows and FLNX are compact, Century's toolkit provides a clean and efficient environment in which to run FLTK programs. Programs targeting the FLTK API need go no further than this. But as Century's ViewML browser project demonstrates, the situation can get more complicated. Century wanted a browser appropriate for a PDA, and in the finest open source tradition they went looking for a free one they could adapt. They settled on the KDE 1.0 HTML widget because of its compactness, maturity, and full standards compliance. But KDE's widget uses the Qt application framework, not FLTK. So Century wrote a Qt compatibility layer to translate the Qt calls made by the KDE widget to the corresponding FLTK calls. The ViewML browser makes Qt calls, which are translated by the Qt compatibility layer to FLTK calls, which are translated by FLNX to Nano-X calls, which in turn are translated by Microwindows to Linux framebuffer calls. One can certainly argue that performance will suffer for applications coded to the higher layers (like Qt) but recall that you can choose to code to any of these layers — new applications should certainly use the FLTK API for performance reasons.

Additional information about Microwindows is available here.



Trolltech's Qt Palmtop Environment

Trolltech, developers of the well-known Qt application framework, recently released their Qt Palmtop Environment. Many readers recall the history of Qt, especially in the context of KDE, the desktop environment written with Qt. For years Qt held KDE in a sort of licensing limbo — KDE is itself GPL, but Qt had a more restrictive license. Some groups, such as Debian, felt that the Qt license prevented the free distribution of KDE. Recently Trolltech re-licensed Qt, so it can now be distributed freely under the GPL, or optionally under a commercial license.

While Qt itself targets Windows and X environments, the Qt Palmtop Environment is based upon Trolltech's Qt/Embedded, a version of Qt intended for small-footprint applications. Like Microwindows, it need not have X present. Also like Microwindows, cross-development, simulation, and demo development are easily done on a desktop — one simply uses the desktop version of Qt.

For better or worse, Trolltech's environment is conceptually much simpler than Century Software's. Your application is written to the Qt API; then Qt/Embedded interacts directly with the Linux I/O facilities. This is perhaps the ideal environment for developers wishing to use the Qt API (as many do — the C++ based API is considerably more elegant than that of many other GUI frameworks). The lack of layering makes Qt/Embedded the most compact environment for running Qt-based programs.

Of course, anyone wishing to use some other API may consider this single-minded focus on Qt to be a drawback as well as a benefit. The open source tradition tends to value diversity and choice over any one person's concept of what is best. Witness the constant flame wars over KDE/Gnome, Perl/Python, vi/emacs, and a host of other competing technologies between which an outsider would find little substantive difference. Many open source developers would choose whichever platform allows them to use their particular combination of favorite technologies.

Because of the somewhat bewildering combination of choices it offers, Century's platform may appeal to more open source developers than Trolltech's. On the other hand, developers coming from a more traditional embedded development background tend to favor compactness and elegance above all else. Faced with learning a new platform, they're unlikely to have a strong preference for some preexisting API or development tool — they'll use whatever gives the best result. For this market the Qt Palmtop Environment can be expected to do well.

Additional information about the Qt Palmtop Environment is available here.



Transvirtual Technology's PocketLinux

PocketLinux forms the third major application development environment providing support for the iPAQ. Transvirtual was founded by the originators of the Kaffe Java virtual machine, one of the best open source JVM implementations. Like the other environments, PocketLinux builds upon the handhelds.org Linux port to the iPAQ. Transvirtual's architecture can be summarized quite simply as Kaffe implemented on Linux. Its market can be identified even more clearly and succinctly than can Trolltech's: Java developers. For those who use Java, the appeal of PocketLinux is clear — PocketLinux is provided by the leading open source Java company, so one can expect good support and long-term commitment to the success of the product.

PocketLinux is likely to be met with skepticism by many, particularly embedded system old-timers, some of whom have never quite adjusted to the idea of using a compiler — much less a byte-code interpreter — in an embedded system. But it is probably too early to judge the success of PocketLinux from a performance point of view. Currently Transvirtual uses just-in-time compilation for all of PocketLinux on the iPAQ; that is, for PocketLinux itself and for applications. But they plan to use ahead-of-time compilation for PocketLinux in the future, leaving JIT for applications. Such a move is clearly needed as the current demo and its applications load too slowly to be taken seriously, presumably because of a lengthy JIT step. Even taking into account an expected improvement from ahead-of-time compilation of PocketLinux, it seems unrealistic to expect performance competitive with that of the fully compiled distributions.

As one might expect from a pure Java platform, PocketLinux has an elegant programming model. User interface screens are laid out using XML, then the events associated with the widgets that were defined in XML are processed in Java. Applications inherit from the BaseApplication class, which provides default handling for events. So user applications need only provide non-default event handling.

Additional information about PocketLinux is available here.



Where do we go from here?

By now, it seems clear that the programming environments available for PDAs running Linux are becoming nearly as diverse as the choices offered for desktop computers. They form a spectrum, from those providing diversity and choices to those that offer a more structured (and resource efficient) environment with favored supported tools.

The default environment provided by handhelds.org is the least structured, being a straightforward port of Linux and X to the iPAQ. Traditional Linux hackers are sure to favor this distribution because it provides a familiar environment for them to use their favorite tools. Century Software's environment is nearly as flexible, giving up X but using some longstanding open source tools with which many developers are already familiar. Somewhat more structured is Trolltech's offering; it essentially locks developers into the Qt API. In exchange they get a well designed API and efficient space usage. Finally, Transvirtual provides Java in a handheld environment. PocketLinux provides a mature and stable JVM for those wishing to use Java.



About the author: Jerry Epplin has written embedded software for the past fifteen years, primarily for medical devices. He can be reached at [email protected]







Related stories:

 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.