USENIX Association

Proceedings of the XFree86 Technical Conference

Oakland, California, USA November 8Ð9, 2001

THE ADVANCED COMPUTING SYSTEMS ASSOCIATION

© 2001 by The USENIX Association All Rights Reserved For more information about the USENIX Association: Phone: 1 510 528 8649 FAX: 1 510 548 5738 Email: [email protected] WWW: http://www.usenix.org Rights to individual papers remain with the author or the author's employer. Permission is granted for noncommercial reproduction of the work for educational or research purposes. This copyright notice must be included in the reproduced paper. USENIX acknowledges all trademarks herein. Salamander: The Quest to Build a Useful Handheld Computing Environment

Alexander Guy Andern Research Labs [email protected]

Abstract Compaq’s iPAQ series of handhelds represent the current state-of-the-art for consumer handhelds. As of late, the availability of commercial, off the Open-source development on handhelds has been shelf, handheld devices has grown dramatically. It growing by leaps and bounds. Thanks to support is now possible to walk into most consumer elec- from Compaq, and the community that’s been gen- tronic stores, and purchase a handheld device capa- erated around the handhelds.org website, the iPAQ ble of running a fully fledged operating system such line of handhelds has become a formidable devel- as or NetBSD. opment platform for Linux-based handheld appli- cations. The only major differences found in these handheld devices, as compared to their desktop counterparts, Presently, Linux on the iPAQ supports all APIs pro- are related to hardware. The computing and stor- vided on its desktop counterparts. Because of this, age resources available to users and applications are most applications may be ported to these handheld under much different constraints. In addition, input platforms with little or no modification. A full im- and output mechanisms are generally quite differ- plementation of X is available, as well as such clas- ent. Because of this, although the existing appli- sics as GNU’s libc and Python. Several Linux dis- cation base is available (e.g. GNOME, KDE, and tributions have been developed for, or ported to, the other X applications), their use is in many cases in- iPAQ, making conversion of existing WinCE-based feasable (although much code and experience can iPAQs to Linux quite easy[hhw]. be gained). While there are numerous applications and user en- Salamander is a project aimed at developing a use- vironments available for X (such as GNOME and ful handheld computing environment. Based on KDE), most provide less than optimal solutions UNIX-like operating systems, with X as the win- given the environment they’re being executed in. dowing environment, Salamander exists to provide Most of the existing modern code-base was de- an open-source suite of Personal Information Man- signed for use without the constraints that a hand- agement (PIM) tools and a support structure for held device provides. Aspects such as persistent applications on current and next-generation hand- storage, memory, and screen real estate are at a helds. much higher premium than found in a typical UNIX workstation 1. In addition, many existing appli- cations weren’t designed for use with the forms 1 Introduction of input provided by handhelds (e.g. “one-button” touchscreen, tiny keyboard, voice recognition).

Handheld devices have advanced over the years. Salamander attempts to provide a suite of handheld From the Atari Portfolio, through to the Palm Pi- applications that cover the common functionality lot, and Apple Newton, handheld hardware has pro- 1Thanks to X’s beginnings, there have already been numer- gressed rapidly. The latest devices to emerge, of- ous test cases that show X to be a viable windowing solution fer numerous new possibilities. HP’s Jornada and for resource-poor devices. provided by existing handheld devices and soft- When working on developing a set of new technolo- ware, while taking advantage of the new possibil- gies, it is a must that they get to a state of evaluation ities offered by being based in a UNIX-like envi- as quickly as possible. Too much time spent on de- ronment. bugging, or on rewriting existing code that doesn’t quite fit, results in less time for actually focusing on 1.1 Goals the project goals. While developing a system from scratch is tempt- The basic requirements for Salamander consist of ing, for numerous reasons there are severe draw- the following: backs to having too many pieces of foundation in flux. For Salamander’s development, we wanted to use as much existing code as possible; only per- Usefulness. Many of today’s “producitivity” forming original development, or serious modifica- devices seem to only cause additional, undue, tion, when no appropriate piece of software already complexity. Users must benefit from Salaman- existed. der’s involvement in their affairs. Because of the hardware environment that Sala-

Reliability. This is a priority, as Salamander mander is designed to run in, resource utilization must provide a stable environment that users is a serious concern. Elements used must have: rea- can depend on for storing and retrieving vital sonable memory usage, low CPU requirements, and information. a small non-volatile storage cost.

Simplicity. Providing a set of easy to under- 2.1 Prototyping Choices stand applications that can easily interact with each other is far better than the creation of X was selected very early on as the best choice monolithic, independent, applications. for the windowing environment. Not only is the codebase mature and well understood, it is also un- Interoperability. Salamander must easily and der active development. Recent efforts by Keith completely, interact and interoperate with Packard [Pac01] and Jim Gettys[GP01] have done existing available devices, such as cellular quite a bit to enhance X’s usefulness in a PDA en- phones and other PDAs. vironment.

Ease of Development. Creating additional Python v2 was chosen as the environment in which applications that can homogenously interact to develop most of Salamander’s original code. Its with the existing Salamander environment is quick development time, plethora of existing mod- a must. ules, and existence in a ready to use and complete form on handhelds were key in making the choice to use it. Python also provides an easy mechanism for developing bindings to C libraries, making in- 2 Implementation tegration with existing code a snap. In addition, the developers starting the project, all had previous Deciding which tools to use for prototyping took a development experience with Python, making the bit of thought. Our criteria for choosing code and learning curve non-existent. tools to work with came down to the following: Although not the ideal solution for handhelds, GTK+ was chosen as the widget set to use for in-

Allowed For Rapid Prototyping teracting with X. This decision was made primarily due to PyGtk, James Henstridge’s excellent GTK+

Mature Code-Base bindings for Python. GTK+ has existed for quite a while and has had numerous projects developed Low Resource Utilization against it. Sleepycat’s BerkeleyDB libraries were chosen as Access control is handled by the initial connection general tools for data storage. Although XML to Dispatch. Once a peer has authenticated itself provides excellent interoperability traits, it leaves to Dispatch (currently handled using permissions something to be desired as far as storage space ef- on UNIX-domain sockets), its messages are con- ficiency and CPU usage for parsing goes. Berke- sidered valid, and trustworthy. leyDB provides an excellent binary storage format, with a well understood and commonly available API for interaction. 4.2 Persistent Object Store

The Persistent Object Store (POS) represents one 3 Architecture Philosophy of the core components of Salamander. Using the POS, components are given a mechanism to not Salamander follows the UNIX approach of build- only persistently store information (in the form of ing simple and robust pieces that can be connected discreet objects, that can be referenced, and linked together to perform complex work. Each one of together), they’re also given a simple way to share these pieces, called a “component”, is a peer within large groups of objects between each other. a community of components, that interact with each other to actually perform work. Objects within the POS have a given class, which defines what members objects are permitted to have (i.e. schema is enforced). There are many existing 4 Core Components cases of database and interfaces that provide this type of functionality, but using them in the environ- Salamander’s core components represent the base- ment presented proved to be too much of a diffi- line functionality upon which all other components culty. in the system depend. Core components are guaran- teed to be available in any Salamander installation Communication with the POS is handled just like and provide the basis for all other functionality. any other intercomponent communique, through the message passing system. Classes are defined, 4.1 Dispatch objects instantiated and destroyed, and members modified, all through messages passed from com- The passing of messages makes up the heart of the ponents. interaction between different Salamander compo- nents. Messages are routed in a switched manner, One of the most interesting aspects of the POS is through a central switchboard mechanism called the ability to link objects. Conceptually, the ob- Dispatch. jects in the POS interconnect to make a large unbal- anced object-graph, with different nodes intercon- Dispatch is responsible for handling all communi- necting depending on the schema that each follow. cation between connected components in the sys- This provides an interesting concept for handheld tem, called “peers”. Each peer is assigned a unique devices, because it means that information associa- identifier upon connection and may, at the peer’s tion can easily be stored and taken advantage of. discretion, opt to have other identifiers assigned, that may or may not be shared by other peers (sim- Take the example of a scheduled appointment. ilar to multi-cast, or channel-based concepts). Given the ability to link to different objects within the POS, a given appointment could interconnect Messaging is important for Salamander because of with the objects representing the people being met, the philosophy behind components. Instead of hav- as well as the location for the meeting. ing loadable embedded objects, each component acts as a seperate entity, capable of being requested This ability to link POS objects together is one of to do a specific task. When one component requires Salamander’s main strong points. It allows for low- something of another, a dialogue is started between ered redudancy, both as far as computing resources, said components, and the required steps are taken. and as time required for users to perform work. 5 Applications stored in the POS. In a day view, Chronicle would display the current tasks related to the current day, A user environment is of little use with only in- any scheduled events (along with their durations), frastructure developed. The initial creation of the and any tasks that must take place at a certain time. PIM tool suite serves as the litmus test for Sala- mander’s base framework. Applications developed for the most part have been analagous to software 6 Current and Future Status found in other environments, while taking advan- tage of some of the new functionality afforded by Salamander is currently undergoing rapid develop- Salamander’s manner of implementation and gen- ment. New functionality is being added daily, to eral philosophy. extend the usefulness of the environment. While still in the early stages of development, results are 5.1 Mingle promising. For more information on the state of the project, please see http://www.andern. Mingle is Salamander’s answer to the typical PDA org/salamander/. contact manager. Using the POS, Mingle provides a mechanism for creating, deleting, and editing con- tact entries. Due to the model of the POS, Mingle is Acknowledgements provided with some powerful linking capabilities. Thanks to Compaq for supporting the hand- Contact entries can be linked with JPEG images helds.org website, and putting such exceptional stored in the POS, allowing faces and pictures to resources behind the development of Linux on be associated with a given person. Multiple phone- the iPAQ. Thanks to all the existing open-source number and physical address objects can be linked projects that have made the creation of Salamander from a contact, and shared between contacts (in- a possibility. I’d also like to thank Gareth Green- teresting for storing directions to a given location, away, Bert Vermeulen, and Ian Hall-Beyer for re- or keeping notes on phone calls made to a specific viewing this document. phone number).

5.2 Task References Task exists to allow the creation and prioritization [GP01] Jim Gettys and . The X of required activities and projects. Tasks may re- Resize and Rotate Extension - RandR. main unconnected, or associated with an instant or In FREENIX Track, 2001 Usenix Annual period of time. Technical Conference, Boston, MA, June Tasks may also be used to track time expended per- 2001. USENIX. forming a given operation, allowing users to track http://www. “where the time went”. [hhw] Handhelds.org. handhelds.org/. Task depends on, and is tightly coupled with, Chronicle for all the time-keeping related activities. [Pac01] Keith Packard. Design and Implementa- tion of the . In 5.3 Chronicle FREENIX Track, 2001 Usenix Annual Technical Conference, Boston, MA, June Chronicle is responsible for providing the user with 2001. USENIX. an interface to add, organize, and/or remove, time- based events and objects associated with a given moment in time. Information about the current state of the user’s schedule is gleaned from any pertinent objects