A Smart Phone-oriented Embedded Real-time Operating System

Release Date:2005-12-02 Author:Wang Jigang, Gu Guochang, Xu Lifeng Click:

    With the rapid development of 3G wireless communication technologies, higher requirements are demanded on the performance of mobile communication terminals. The mobile phone merely used, as a voice communication device can no longer meet  users´ needs. It should be an inevitable trend to develop a smart phone that integrates wireless communication technologies and palm PC functions. The operating system or the core of software, however, can directly affect the overall performance of the smart phone[1-3]. Presently, vendors in China are developing and manufacturing smart phones that are all based on the embedded real-time operating systems made by foreign vendors such as Windows CE, Symbian OS, Palm OS, etc. Although these vendors make less investment and speed up the smart phone development, they have difficulty in optimizing the overall system performance and can hardly provide their own independent Intellectual Property Rights (IPR) in the smart phone industry.

    In order to have a full grasp of key technologies for smart phones and improve Chinese competitiveness in the mobile terminal market, ZTE has independently designed and developed a Smart Phone Operating System (SPOS). The SPOS is based on a single kernel architecture that provides a multi-task real-time kernel capable of abstracting hardware platforms and resources of mainstream mobile phones.

    It has remarkable advantages such as highly efficient and dynamic power management, priority-based preemptive scheduling, fast startup, a variety of drivers, and excellent system stability and operability. For the development of upper layer communication protocols and application software, the SPOS also provides wireless communication interfaces and application framework.

1 SPOS Overview
As a development trend for the mobile communication industry, the convergence of wireless communication and mobile PC sets a higher requirement for mobile terminal technology. With the increasingly powerful functions supported by mobile phones as well as the introduction of wireless Internet and intelligent operating system, the next-generation mobile phone is vividly described as “Smart Phone” in the industry. In addition to voice communication, the smart phone has most of the functions supplied by Personal Digital Assistant (PDA), such as personal information management, browser and email based on wireless data communication, and feature-rich value-added services. Conceptually, the smart phone refers to a mobile phone that adopts an open operating system to carry large amounts of third-party applications and perform complex information processing[4]. Therefore, it imposes higher requirements on the operating system.

    The smart phone has the following features:
    (1) Restriction and Application
    The smart phone has limited power supply because it is chiefly energized by the storage battery with a limited capacity. Therefore, the operating system shall provide excellent power management capability to ensure normal running as long as possible.

    (2) High Reliability
    Reliability is an issue to be considered by all smart phones. A good operating system shall be instrumental in developing stable and reliable application programs although its kernel and privileged code occupy less space.

    (3) Support of Real-time Multi-task Processing and Various Communication Protocols
    The wireless access mode requires the SPOS to support real-time multi-task processing and various communication protocols. Moreover, in order to help users make smooth conversion and support the standards to be launched, the SPOS shall abstract the network protocol stack. In addition, it shall ensure the consistency of Application Programming Interfaces (API) irrespective of the specific protocol stack being adopted.

    (4) Environment Self-adaptiveness
    It is an important research direction for the SPOS to ensure a QoS-based system interaction under a dynamic and mobile environment. The system self-adaptiveness is an eclectic strategy and completely transparent to the applications. Environment self-adaptiveness can ensure compatibility with the existing applications. Therefore, the particular mobile environment for application purposes has a little importance development.

    (5) Open Platform
    The SPOS shall be open to the third party users and provide a powerful programming environment for developers of handset application software to conduct related development via the application program framework in a convenient and fast manner.

2 SPOS Architecture
The SPOS based on modular and layered architecture provides scalable and open environment for the upper layer application, as shown in Figure 1.
   

    The SPOS is made up of three layers from the bottom up operating system kernel, supporting middleware and application program framework. As the system basis, the operating kernel abstracts the handset hardware platforms and provides basic functions including process scheduling, file system, memory management and inter-process communication. In addition, the kernel offers handset-related technical features such as Execute In Place (XIP), Dynamic Power Management (DPM), fast startup, etc. The supporting middleware consists of a group of components that provide the applications with core support such as wireless communication, graph, multimedia, and more. The application framework can manage applications and graph components via the service and library routines. It offers unified application development and running environment in which applications of the handset itself and those developed by the third party can run seamlessly. The tool kit is a set of tool software necessary for SPOS based platform development and application. It facilitates the development of handset devices and the third party applications [5].

3 SPOS Kernel Design
The SPOS kernel provides not only basic functions involving real-time process scheduling and interrupt processing, but also featured handset oriented functions such as dynamic power management, fast startup, etc. The universal kernel with optimized and enhanced functions can meet the requirements for
handset applications.

3.1 Real-time Process Scheduling
The operating system is designed to offer a space for running programs, and has the process as its core. The SPOS is a multi-process operating system, and supports two kinds of process scheduling, the algorithms priority based preemptive scheduling and round robin scheduling.

    When priority based preemptive scheduling is adopted, each process has a priority and the kernel allocates its CPU to the ready task with the highest priority. When multiple processes with the same highest priority are available in the system, there are two choices for process scheduling. In default, when a certain process is running and if the kernel doesn´t relinquish the CPU automatically, the process will be always running. Therefore, other processes have no chance to be executed. Another choice is the round robin scheduling among processes with the same priority. It makes use of time slicing to ensure the same processing time for these processes with the same priority.

3.2 Dynamic Power Management
With the adjustment of system running state made by the three layers of the operating system, and based on the application requirements for CPU and peripheral equipment, DPM can dynamically adjust core voltage and running frequency of the CPU. This is maximally reducing power consumption and extending handset usage time while guaranteeing functions of the smart phone. The model of SPOS dynamic power management is shown in Figure 2.
The implementation of DPM at the bottom layer resides on the SPOS kernel, that extends some important parts of the operating system. The power management mechanism comes from an outer system and interacts with DPM in two ways, the predefined collection of strategies and the strategy manager.

 

    The strategy refers to a data structure endowed with name. In order to accurately control the status of the dynamic system, it is necessary to specify the component status and the conversion of equipment status so that a reliable operation consistent with the overall power management mechanism can be guaranteed. The strategy is installed in the system kernel and has an abstract object layered structure. The operation status and operation point can be mapped to form a DPM strategy as required. The strategy manager is an application program responsible for setting an appropriate strategy out of a group of predefined strategies as the current system strategy based on the system running status.

    At any given time, the system is running under a specific operation point that is represented by parameters including the kernel CPU voltage, CPU and bus frequency, and peripheral status. The DPM is defined as a series of rules and programs for transferring the system from one operation point to another during the program execution and event occurrence. The operation status covers a wider scope than the operation point. It refers to several operating modes of the CPU such as Normal, Standby, Idle, Sleep and more. In order to identify the different requirement on performance and power, different task status can be assigned for different task. The different task status forms different operation status. Each operation status can have multiple operation points while an operation point class is composed of numerous operation points under the same operation status. The strategy maps each operation status of the system into a specific operation point, and the DPM can adjust this map relationship to achieve optimal combination of power consumption and performance.

    The DPM module is transparent to the application program of upper layer and has no effect on the calling of the system by the application program. Therefore, great amount of available resources can be used to provide compatibility with the existing applications. Power management rules can be configured to meet the requirements of specific system and application. Consequently, the system is able to provide the most flexibility by generating a management rule library to work with the DPM, or by setting the system directly via the strategy manager.

3.3 Fast Startup
Mobile phone users are always expecting to see that the system is ready when pressing the power key. They can hardly accept a lengthy start of their mobile phone. Generally, 10 seconds is considered the upper limit for the readiness of a mobile phone system.

    The initiating process of the operating system is divided into such four steps as boot loading, kernel loading, kernel initiating and user space initiating. Usually the embedded system has no BIOS self test; therefore, it takes several milliseconds for the system to complete the power on and boot load process, which can be ignored. As the user space initiating is associated with services needed by the system, it is difficult to specify the time. The Kernel loading and initiating process is the most important to the fast startup of the operating system. Hence, the SPOS kernel is designed in accordance with the following requirements.

    (1) Kernel Loading
    The SPOS adopts XIP technology, which is a mechanism where codes can be executed directly in the flash memory without being loaded to RAM. With this XIP technology, the kernel reduces its time for copying codes from the flash memory onto RAM. In addition, reduces its time for self-extraction by means of decompressed mapping. As the access speed to the flash memory is lower than that to RAM, traffic flow over the flash memory and RAM shall be balanced based on the hardware environment when XIP technology is used.

    (2) Kernel Initiating
    The operating system kernel conducts time reference measurement in a cycle mode to adapt to different CPU. After selecting the hardware, the SPOS writes the measured reference values into the system, thus saving the cycle time. With the memory size remaining unchanged, the SPOS pre-establishes a page table. In this way, the time for the kernel to set up a page table is saved. Moreover, the SPOS considers those equipment drivers with slow startup as loadable modules and delays their initiating process.

    (3) User Space Initiating
    The SPOS selects to initiate its application services. It starts up the most important services such as phone call as early as possible while delaying time-consuming services.

4 Wireless Application Interface
The Wireless Application Interface (WAI) of the SPOS provides users with a unified API regardless of specific operations at the bottom layer including wireless communication and command control. Therefore, the users can have access to wireless communication functions via the unified API function without concerning about the specific structure and protocols employed for the wireless communication part. It supports wireless protocols used in GSM, GPRS, WCDMA and CDMA2000 system[6]. The WAI module operates in Client/Server mode, as shown in Figure 3.

 

    The WAI consists of three layers, the application interface layer, the phone service layer and the communication processing layer. The application interface provides a group of APIs to be called by the application that communicates with the phone service server in message mode. The WAI provides users with standard API modules such as Phone Line, Phone Book, SMS, and Call. They are designed for phone call, SIM card access, and short message sending/receiving respectively. The phone service server delivers unified service to the upper layer application, and adopts the communication protocol such as AT command to interact with the wireless communication part—the communication part with dual—CPU structure. On one hand, it accepts application requests and converts them into corresponding control commands to be sent to the wireless communication part for further processing. On the other hand, it accepts communication and control commands sent from the wireless communication part and notifies the application program via the standard interface after these commands are resolved. The communication layer is responsible for managing communication equipment of protocol transmission. Therefore, the phone service server can interact with the wireless communication part via the serial equipment. When new equipment is added, it is only necessary to recreate the object of communication processing for management. In this way, the platform can provide better scalability. The transmission equipment of communication protocol can be either physical equipment such as physical serial port, or virtual equipment such as virtual serial port.

5 Application Program Framework
The application program framework contains the application server and the application & shared library. It is designed to provide a unified application development framework, based on which users can develop application software in an easy and fast manner. The framework structure of application program is shown in Figure 4.
The application server is a practical application process. It implements graph server functions in the GUI module such as graph management, event handling, etc., and is responsible for application program management, fast upload, synchronization, and application download. In addition, there is functions oriented to the application environment such as installation management, desktop setting, add-on management and more. Moreover, it provides the application with shared system services involving sound system, infrared, and transmission and application packet installation.

    The application & shared library provides some shared support libraries oriented to handset applications such as Personal Information Management (PIM) library, handset application interface library, and handset application tool library. The PIM library has a unified mechanism for management of personal information including calling card folder, phone book, messages, schedule, task, and others. The handset application interface library provides a shared component collection for handset applications, such as analog clock component, information indicator component and more. Users can also make a third-party application library in response to different applications, therefore, the shared library can be expanded to meet the requirement for application execution.

6 Conclusions
The SPOS not only presents features and state-of-the-art technologies necessary for the smart phone, but also provides the upper layer application software with a good environment for development. Presently, the design for a prototype of the SPOS-based smart phone has been completed. It offers higher performance and can fully meet the current requirement for the smart phone. Certainly, the SPOS needs to be further optimized, as it has shortcomings in such aspects as security and software size. Nevertheless, the SPOS overall architecture and design concept is of relatively high practicability and can be widely adopted.

References
[1] Imielinski T, Korth H F. Mobile Computing [M]. Boston (MA,USA): Kluwer Academic Publishers, 1996.
[2] Satyanarayanan M. Fundamental Challenges in Mobile Computing [A]. Proceedings of 15th ACM Symposium on Principles of Distributed Computing [C]. Philadelphia (PA, USA),1996. New York (NY, USA):ACM Press, 1997.1-7.
[3] Cai Junliang, Sun Xiaoming. A Linux-based Vehicle Real-time Operating System [J]. Academic Journal of Tsinghua University (Nature Science), 2004,44(1): 78-80.
[4] Badrinath B R, Imielingski T. Mobile Wireless Computing: Challenges in Data Management [J]. Communications of the ACM, 1994,37(10): 12-28.
[5] Epplin J. Linux as an Embedded Operating System [DB/OL].Heisterbergallee (Germany):SSV Embedded Systems. www.dilnetpc.com/emblinx3e,2000.
[6] Narayanan D. Operating System Support for Mobile Interactive Applica [D]. Pittsburgh (PA, USA): Carnegie Mellon University, 2002.

Manuscript received: 2005-03-28