Palm OS
CS-450-3 Operating Systems
Fall 2003
Jason Kelske
Stephen Jou
Graham Kerster
Allan Topp
Matt Jennings
Palm OS 5.0 – Table of Contents
Page
- Introduction…………………………………………………………………3
- Operating System Objectives………………………………………………3
- Flexibility………………………………………………………………...3
- Ease of Uses……………………………………………………………...3
- Mobility…………………………………………………………………..4
- Power Management…………………………………………………………4
- Data and File Management…………………………………………………5
- Memory………………………………………………………………………5
- Overview…………………………………………………………………5
- Architecture……………………………………………………………..6
- Format…………………………………………………………………...7
- Allocation………………………………………………………………..7
- Process Management……………………………………………………….8
- Security………………………………………………………………………9
- Conclusion…………………………………………………………………..9
Introduction
Palm OS is the most popular operating system that runs on Personal Digital Assistants, also known as PDA’s. It can be found running on PDA’s produced by Palm, Sony, Handspring, IBM, Samsung, and a few cell phones. Palm OS offers a variety of ways for the user to interact with it, with a user interface that fits most users needs allowing for ease of use and convenience. For example, the applications limit the amount of data that needs to be entered by the user since it is more difficult to enter data through the graffiti, graffiti 2, and the keyboard dialog on the PDA. Menu’s are hidden to allow more room on the screen, and toolbars are only included for the essential commands since they are so small and hard to tell apart on the screen. Palm OS has set the building blocks for the next era of mobile computing by “…offering the processing power to take on the most demanding mobile computing tasks, together with advanced multimedia and the wireless connectivity and security that enterprises require” (PalmSource). Palm OS’s objectives, requirements, power management, data and file management, memory, process management, and security has put it ahead of the game.
Operating System Objectives
Flexibility
To protect Palm’s investment in older software, OS 5 supports the Application Programming Interface (API) of OS 4, giving it backward compatibility. Up until now, all Palm Operating systems were 16-bit and used a processor from Motorola's Dragonball "68k" line. The Palm OS 5 now uses the ARM processor because of its superior speed and architectural improvements. (Maruth and Treadway, 2003) Even though the Palm OS 5 has upgraded to 32-bit,there's such a speed improvement (2 to 20 times faster) that it has the ability to run the existing “68k” software by tricking the application into thinking nothing has changed. This causes most of the older software to run faster without added effort. Everything is compatible since it is based on the ARM architecture and more companies offer ARM based processors in a wide range of speeds including Motorola, Intel, and Texas Instruments. In this situation the user benefits from both standardization and competition. (Palm vs Windows CE, 2003)
Ease of Use
The two biggest differences between a desktop-based computer and a Palm OS based computer is the size and the I/O devices. Functionality is extremely important when designing an Operating system on a device with such a small display. The amount of information displayed at any one time is greatly limited. (Fedor, 2002) For this reason it is important to design the user interface carefully by finding a balance between providing enough information while not over crowding the screen. The Palm OS 5 was designed to be very efficient and simple to use compared to other handheld operating systems such as Windows CE. Since the operating systems does not support multi-processing, it limits the user to one application at a time, avoiding confusion and simplifying OS requirements. Multiple screen resolutions are also supported including 160x160, 320x320, and 480x480 pixels. (Palm vs Windows CE, 2003)
In addition, handheld users do not have a keyboard or mouse. Instead of a mouse the Palm OS is enabled to use a stylus pen and touch screen for navigation purposes. In place of a keyboard the Palm Operating system supports text input through the use of Graffiti (when a user traces out special stylus pen strokes that are translated into ASCII characters) or by using an on-screen keyboard dialog box. (Maruth and Treadway, 2003)
Mobility
Mobility is another important objective of the Palm Operating System. Palm OS is intended for handheld portable devices. If the handheld is just a little too heavy or large, it stays in a drawer and never gets used. The Palm operating system software was designed exclusively for mobile devices. It uses memory and battery power very efficiently, enabling Palm Powered hardware makers to engineer extremely small and lightweight systems. (Fedor, 2002)
Power Management
Portability and battery life are both primary design concerns for mobile devices. In comparison to a desktop PC, mobile devices use batteries as its main source of power. Mobile devices are often used periodically throughout the day in places where batteries are not always easily accessible. (Fedor, 2002) Therefore it is important that the device conserve its battery life. The battery size also plays a significant role in how portable a device is. The larger the battery, the more the device will weigh. A heavy or large mobile device makes it more of an inconvenience to travel. Since, many handheld devices use either AAA or lithium batteries it is important that the operating system use its resources sparingly, to prolong the life of the batteries. (Palm vs Windows CE, 2003)
To minimize power consumption, the Palm OS dynamically switches between three different states: sleep mode, doze mode, and running mode. The system manager controls transitions between different power modes and provides an API for controlling some aspects of the power management. The Palm OS will enter into sleep mode when the power is turned off or after a few minutes without any user input. In this mode the display and the main clock shut down while the real time clock and interrupt generator continue to run. The operating system may wake up upon an I/O interrupt. While in doze mode the operating system stands by but the CPU does not perform any operations. The LCD remains on and continues to display the main clock until an I/O interrupt occurs. Once an interrupt occurs the operating system enters into running mode, where the CPU will run as long as it takes to process the users input. Once the process completes the operating system will enter back into doze mode. Running mode is obviously when the operating system uses the most battery power. Using this power management system, the Palm OS can run up to two weeks on a single charge using AAA or lithium batteries. (Maruth and Treadway, 2003)
Data and File Management
Palm devices do not have hard disks or floppy drives. Therefore, the Palm OS does not implement the traditional concept of a file system. Because there is no file system, no flash RAM support, and no secondary storage, the data is stored and organized in storage heaps in the devices memory (which will be explained in the Memory Management section). Both transitory and long-term data is stored in memory and preserved intact as long as the handheld has power. It stores data in chunks known as records, which are grouped together into a database.
A database in Palm OS terminology refers to a sequence of memory blocks allocated from the storage heap and maintained by the operating system as a single set of data storage. There are two types of databases: record and resource. A record database maintains an ordered list of data blocks, or records, which can be accessed by index, by unique ID, or by an application-defined key. A resource database maintains an unordered list of data blocks, or resources, which can be accessed by type or by unique identifier only. Of the two types of databases, record databases are more flexible in that they can be sorted and efficiently searched, but they also require more overhead to maintain. (Palm vs Windows CE, 2003)
Memory Management
Overview
Memory for the palm OS comes in the form of a removable card. The card can contain both ROM and RAM. The Palm OS is capable of supporting up to 256 different memory cards at one time, but to date all Palm products only support a single card.
ROM is actually implemented as Flash memory and is somewhat editable as a result. The memory card’s ROM size varies anywhere from 512K to 2MB. ROM is non-volatile, and as a result is where critical information is stored including the operating system and standard applications.
All remaining data is stored in RAM, including run-time data, user data, user settings, and third-party applications. RAM is volatile, meaning that this data will be lost if power to the unit is lost. There is a capacitor that allows data to be retained for up to a minute in the absence of a power supply, but after that all data is erased. This means that users need to be sure to keep their batteries charged and frequently back up their data on a more reliable media. (Albanowski, 2003)
Architecture
Each memory card is partitioned into “Heaps.” A heap is essentially a section of memory. There are 4 memory heaps in the Palm OS: a ROM heap, a storage heap, a dynamic heap, and a low memory globals heap. For the purposes of memory management, we will be focusing on the storage and dynamic heaps.
Each heap is then subdivided into several smaller sections. Each heap includes: a header, a master pointer table, chunks, and a terminator. The header contains information about the size of the heap and the heap ID. The master pointer table contains pointers to the beginning of each memory “chunk” or section. The master pointer table is similar to paged memory systems utilized by desktop operating systems. Chunks are the sections of memory that are used for data storage. Each chunk also has a header. This header indicates how large the chunk is, whether the chunk is allocated, and the owner ID. Finally, the terminator simply signifies the end of the heap. (Albanowski, 2003)
Format
There are two types of memory chunks: fixed and moveable. Fixed chunks are sections of memory whose data can not be moved. Once allocated by the OS, the data at that location can always be referenced via the same address.
Movable memory chunks are more complicated. These chunks can be moved, provided that their lock count is set to 0. If a moveable chunk has a lock count reading of 0, it is said to be unlocked and can be freely moved by the OS. However, if an application is currently using the memory and needs its contents to remain where they are, the application can increment the lock count. This tells the operating system that this block of memory is in use, and can not be moved. Multiple applications can mark a single chunk of data locked. A chunk does not become “unlocked” until all applications indicate they are no longer using that memory space.
As a result of their mobility, moveable chunks are also more complicated to keep track of. Therefore the master pointer table needs to be updated when a movable chunk is allocated for the first time and any time it is moved.
Since some chunks are moveable and some are not, the OS has to be particular about how memory is allocated. In the Palm OS, the lower addresses are reserved for moveable chunks, while the higher addresses are reserved for fixed chunks. This helps to keep free memory as unfragmented as possible. (Albanowski, 2003)
Allocation
Free memory chunks are organized into a list. The heap header contains a pointer to the first chunk marked as free. This chunk’s header contains a pointer to the next chunk marked as free. This process continues throughout the entire heap, with chunks near the beginning of the heap near the front of the list, and chunks near the end of the heap at the end of the list. When the OS needs to allocate memory it simply searches the “free-list” until it finds a memory chunk large enough. This list structure prevents the OS from having to inspect every chunk to see if it is free.
In the event that the Palm OS is unable to accommodate a memory allocation request, it performs a memory compaction. This simply means that it moves all moveable memory chunks to the beginning of the heap in an attempt to free up contiguous space. The OS will then retry the allocation request.
As memory fills up it becomes harder and harder to find free memory chunks; meaning memory compactions are done with increasing regularity. Since each compaction takes time and resources, there is a decrease in performance as memory space becomes critically low. (Albanowski, 2003)
Process Management
The Palm OS utilizes a single process mode kernel. This is similar to the original DOS in that one process is allowed to run at a time. That process will run until it has completed or it receives a stop event from the Event Manager. All applications that run within the OS are single threaded processes. User created threads are not allowed. However, the kernel does have the functionality to handle multiple kernel threads and does in fact run multiple threads at a time. While official details on how the kernel handles its own threads were not available without licensing the product for development or distribution, it appears that the kernel uses pre-emptive scheduling for all system tasks. For example, if an Alert or Error message from the system needs to be displayed, the current process is halted until the error dialog is handled. (Kruglikov, 2003)
Memory restrictions force an application to run in a unique way. Because the Palm device has no fixed disk, all applications must reside within memory. Applications are never actually closed or exited. When a user decides to stop running an application, the operating system switches from one process to another. This new process may be another application or back to the OS doze state. Since only one process can ever be running at a time, issues of deadlock and synchronization rarely occur. This single process management allows the OS to emulate a mutual exclusion model, allowing only one process to access system resources at a time. When one process is running, no other process can make a request of the CPU or memory. (Maruth and Treadway, 2003)
Event Manager
The Event Manager is a key component of the Palm OS. All applications that run on the Palm OS as well as the OS itself are event driven. They react to all possible events that the user can perform, whether it is writing with the stylus, pressing the buttons on the device or turning the device off. The Event Manager is a translator for applications. It receives all event triggers and stores them in a queue. It then takes the events off the queue one at a time and translates them into meaningful structures for applications to use.
When an application is started, it takes control over the processor. The current process is halted until it is either told to run again or the interrupting application completes. This can be a problem when error dialogs or system alerts popup. For example, if the device is currently downloading email and an alert dialog appears, it can halt the system and lose its connection to the email server. Once a process is running, it enters an event loop. This loop continually asks the Event Manager queue for events. It then handles the events that it can and continues the loop. The loop is halted when an appStopEvent is received. This is actually an event and not a termination signal. The process returns to memory, returns all resources to the system and the processor is returned to the OS. The system then returns to doze mode or begins the next process on selected by the user. (A Palm OS Management Share System)
Security
The Palm OS provides various methods that help keep the users data safe. The first is the use of a password protection scheme much like what is seen in other operating system. The user has to enter their password to be able to log onto the system or use certain features. Data contained in the Palm OS is encrypted. This helps to assure that if data does get intercepted, it is useless without the proper decryption algorithms. The Palm OS also supports PPTP and VPN secure wireless networking protocols to ensure the safety of wireless transmissions. Finally, since data is easily backed up to a PC, there is no great risk of the loss of critical information if properly synced.
Conclusion
Since the beginning of the Palm OS, it has set the trend for most mobile communication. Today the Palm OS runs on two out of every three PDA’s and accounts for eighty five percent of what businesses include on their handheld standard’s list. “PalmSource has driven innovation and maintained a strong focus on providing customers with exactly the right solution to fit their needs”. (PalmSource) A close competitor for Palm OS is Windows CE. Windows CE is a small version of the windows operating system for use with portable devices. Each has their own advantages and disadvantages and as of now it is debated as to which OS is better to use. Palm OS has and most likely will continue to redefine market expectations and lead the world in mobile platforms.