5. Maemo Platform Overview


5. Maemo Platform Overview

This chapter decomposes the maemo platform into components and describes the scope of those components in the platform. Also the overall design is shortly introduced, with the most commonly needed programming APIs.

5.1 Overall design

Maemo is a Debian GNU/Linux based embedded operating system designed for networked mobile devices, called Internet Tablets. Being based on Linux and Debian which support the ideology of sharing the source code, collaboration and open development model, maemo is also open source.

Maemo runs on a recent 2.6 version of Linux kernel. The user space software links with the GNU C library, glibc. Maemo aims at being as much compatible with the mainstream Linux systems as is possible, reducing the time and effort needed for porting existing applications and developing new ones to maemo platform.

The package management framework comes from the Debian distribution, simplifying and automating the process of installation, upgrading, configuring and uninstallation of the software packages.

The user interface architecture is based on GNOME framework, especially on GTK+ widgets. GTK+ has been further extended by Hildon to better suit the needs of an Internet Tablet. The actual user interface engine under GTK+ is X Window System (X Server) with Matchbox window manager. GUI applications are built using Hildon framework and GTK+ widgets, although using X Server directly with Xlib API is possible, but not recommended. Below is a table of the software "stack" for the maemo platform:

Applications
Fonts
Sounds
Icons
Connectivity
System UI
Search
Text Input
MIME Types
Home Applets
Control Panel
Task Navigator
Status Bar
Backup
Installer
Alarm
Help
Launcher
Sapwood
Hildon Widgets
Hildon File UI
ConIC
Clipboard
System SW
Cert. mgnt
libosso
X
Compression
Base Files
Core Libs
Core Utils
Core Daemons
Power mgnt
WLAN security
Bootloader
including
InitFS including
dsme

5.2 Core components

5.2.1 Linux kernel

The Linux kernel is the heart of the maemo platform. The kernel is loaded at very early stage during the boot process by a bootloader. Maemo platform is based on Linux kernel version 2.6 and current Internet Tablets utilising the maemo platform use the OMAP chipset containing a ARM processor and a DSP unit. The kernel implements the memory management, process management, networking services as well as hardware specific device and bus drivers. The device drivers include e.g. USB, LCD and WLAN. The bus drivers include e.g. I2C and Flash bus. Part of the kernel functionality, such as device drivers, network protocols or filesystem support can be implemented as loadable kernel modules which can be loaded or removed during runtime. Kernel is stored on a separate flash partition on Internet Tablet, called kernel partition. User space applications communicate to the kernel using system calls.

It is possible for developer to modify or configure the default kernel, as the sources for kernel are available. There is a guide at maemo community website describing the process. Modified kernel can also be flashed back to the device, but when doing so developer must take into account the size of the kernel partition on the Internet Tablet, as there is no way to change its size.

5.2.2 InitFS

At the last state of the kernel boot process the initial filesystem, InitFS, is mounted as the root filesystem. InitFS is a small filesystem used during the boot time, containing necessary binaries to bring the Internet Tablet normal state. After the boot scripts on InitFS are done, the final root filesystem is mounted from flash and the InitFS is mounted into /mnt/initfs.

5.2.3 Base system

The root filesystem includes the basic filesystem hierarchy of a Debian system and Debian based core distribution with few exceptions. The coreutils and Bash (shell) has been replaced with size-optimised Busybox, which combines many common UNIX utilities into a single small executable. Few utilities have also been dropped out because of space saving.

As the maemo platform includes all the basic UNIX utilities and a shell, it is possible to create and run shell-scripts and combine those small but powerful utilities to solve complex tasks easily. The user accounts and groups are handled just like stated in the first chapter. Internet Tablets have predefined user accounts, user and root. The root account should be used for administrative purposes only and is protected by default.

The filesystem hierarchy follows filesystem Hierarchy Standard (FHS) quite well. All applications are normally installed under the /usr directory and must use the hierarchy described for /usr in FHS. In addition to the directories specified in FHS, the following are placed under /usr:

share/icons/hicolor/<size>/apps
Icon files
share/sounds
Sound files
share/themes
GUI themes

The user's home directory (/home/user) can be used quite freely, with the exception of the directory /home/user/MyDocs which is reserved for user's own files (e.g. documents, images) visible through the GUI.

File management operations for user files must be performed through an API provided by the application framework as maemo platform manages file operations case-insensitively, even when Linux filesystems are case-sensitive.

Below is an image of different partitions and their relational sizes on the internal flash of the Internet Tablet:

Figure 5.1: Partitions on Internet Tablet internal flash
Image filesystem-division

5.3 Generic programming libraries

Below is a list of the generic programming libraries used for developing applications on maemo platform, and a short description of them.

GNU C Library (glibc)
glibc is a standard C library released by the GNU Project. It provides the functionality required by POSIX 1c, 1d and 1j standards as well as ANSI C and some of the functionality required by ISO C99. This library is used (indirectly at least) by every application running on maemo platform.
GLib
General-purpose utility library providing many portable data types, macros, type conversions, string utilities, object-oriented framework (GObject), event mechanism, etc.
GObject
GObject provides the implementation of flexible and extensible object-oriented framework for C language.
GConf
Provides a centralised configuration management framework. Allows applications to store and retrieve their settings in a consistent manner, without the need to use configuration files.
Gnome-VFS
Filesystem abstraction library, extendable by plug-ins which allow the application to ignore the semantics of implementations between different kind of devices and services. By using GnomeVFS, an application doesn't need to care whether it will read a file coming from a web server (URLs are supported), or from within an compressed file archive (.zip, .rpm, .tar.gz, etc.) or a memory card.
LibOSSO
LibOSSO is a basic library containing required and helpful functions for maemo applications. LibOSSO also contains a wrapper allowing an application to connect to D-Bus in a simple and consistent manner. Also provides an application state serialisation mechanism. This mechanism can be used by an application to store its state so that it can continue from the exact point in time when user switched to another application. Useful to conserve battery life on portable devices. Also provides a GUI application an interface to register itself to the application framework, preventing the application to be killed as a "stray" application.
D-Bus
A service that allows related processes to pass events to each other. Passes important events from the core system to applications (e.g., "battery low"). Interfacing with D-Bus is an important part of integrating your application with the runtime environment.

5.4 GUI programming interfaces

When developing GUI applications on maemo platform, following libraries are essential:
GTK+
The GIMP toolkit, a multi-platform toolkit for creating graphical user interfaces. Graphical elements in GTK+ are called widgets. GTK+ also supports the notion of themes, which are user switchable sets of graphics and behaviour models. Uses GLib, GDK, Pango and ATK.
GDK
GDK (GIMP Drawing Kit) is a graphics library that acts as a wrapper around the low-level drawing and windowing functions provided by the underlying graphics system.
Pango
A portable library designed to implement correct and flexible text layout for various cultures around the world. This is necessary to support the different ways that people read and write text, since it's not always from top-to-bottom and left-to-right. Used by GTK+ for all displayed text.
Atk
The Accessibility ToolKit. Provides generic methods by which an application can support people with special needs with respect to using computers.
Cairo
Cairo is a 2D graphics library designed to produce consistent output on all output media while taking advantage of display hardware acceleration when available.
Hildon
A library containing widgets and themes designed specifically for maemo, enhancing GTK+. This library is necessary when creating GUI applications on maemo platform since the screen has very high PPI and applications are sometimes controlled via a stylus.

5.5 Audio and Video programming interfaces

The maemo platform includes several APIs to handle multimedia (audio and video) in applications:

ALSA
The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality. It also includes support for the older Open Sound System (OSS) API, providing compatibility with older software.
ESD
The Enlightened Sound Daemon (ESD or EsounD) is the sound server for GNOME. It mixes several sound streams into on for output. It can also manage network-transparent audio.
GStreamer
GStreamer is a plug-in expandable multimedia processing framework. The GStreamer framework is designed to make it easy to write applications that handle audio or video or both. Developers can write new plug-ins to add support for new formats to existing applications. GStreamer includes components for building a media player that can support a very wide variety of formats.
Video4Linux
Video4Linux or V4L is a video capture API for Linux, also supported by the maemo platform and the integrated camera on some Internet Tablets. Video4Linux is closely integrated with the Linux kernel.

5.6 Communication interfaces

The Internet Tablet contains WLAN and Bluetooth hardware for connecting to the Internet wirelessly, as well as the USB port for cable connection. The maemo platform contains several APIs to handle the connectivity in the application:

Sockets
Standard Linux sockets.
TCP/IP
A standard TCP/IP protocol stack, provided by Linux kernel.
BlueZ
Implementation of the BluetoothTMwireless standards specification. Includes kernel modules, libraries and utilities. Capable of communicating the tasks that should not be handled by kernel via D-Bus-interface.
OpenSSL
Library providing a security layer for encrypted networking.
curl HTTP
A client-side support library for URL-transfer, supporting protocols HTTP, HTTPS, FTP, FTPS, LDAP etc.

5.7 Other components and interfaces

The maemo software stack image contains a lot more applications and interfaces than the generally used listed above. Here is a short description of the most important ones:

Alarm
The alarm framework provides an easy way to manage timed events in the device. It is powerful, and not restricted only to wake-up alarms. The framework provides many other features, e.g. setting multiple alarm events, setting custom icon and title of the shown alarm message, executing commands, booting up the device if it is turned off etc.
Backup
The maemo backup application saves and restores application data stored in user's home directory ( /MyDocs) and setting directories and files. Other locations than the defaults can be configured to be backed up too.
Camera
The built-in camera present in some Internet Tablets is compatible with Video-4-Linux version 2 API. Since the maemo platform delegates all multimedia handling to the GStreamer framework, applications that need access to the built-in camera should employ GStreamer for this instead of directly accessing Video4Linux devices, via the v4l2src GStreamer module.
ConIC
An Internet connectivity library used to request connections, retrieve current statistics, proxies and settings for Internet Access Points (IAPs).
GDK-Pixbuf
A library that implements various graphical bitmap formats and also alpha-channeled blending operations using 32-bit pixels (RGBA). The Application Framework uses pixbufs to implement the shadows and background picture scaling when necessary. Uses GLib and GDK.
GPS
The GPS framework in maemo platform consists of a GPS daemon and a library for controlling it, as well as methods to start and stop GPS devices (for power saving).
E-D-S
The Evolution Data Server provides a single database for common, desktop-wide information, such as a user's address book or calendar events.
HAL
The purpose of HAL (Hardware Abstraction layer) is to provide means for storing data about hardware devices, gathered from multiple sources and to provide an interface for applications to access this data.
Help Framework
The Help Framework is a centralised way to offer help services to the user of the program. Maemo platform has an in-built help system that handles all the help documentation for the programs using the Help Framework. Libraries are used to register a program to the Help Framework, and after that the content of the actual help documentation can be used.
Hildon
Hildon framework provides additional components on top of the GNOME components:
Home Applets
Home applets (or plug-ins) are small applications that run on the main window, providing different kind of information, e.g. news ticker or clock.
Task Navigator
Task navigator provides a menu used for switching between applications. To make application visible in Task navigator, you need to create a Desktop file for the application, containing information needed to show the application entry in the menu.
Status Bar
Status bar is a GUI component displaying status of the various tasks using tiny icons on the main window. The status bar can contain user defined items used by a plug-in, but with a limitation of two additional items (only the last two added are visible).
Control Panel
Control panel is a standard and centralised place for application and server settings changeable by the user. Applications can provide Control Panel plug-ins to interface with the application settings.
Installer
The Application manager is a GUI application used to install, upgrade and remove application packages for Internet Tablet. Internally the Application manager uses the Debian package management system.
MIME Types
This component provides the Internet media type (MIME type) registry of two-part identifiers for file formats.
OBEX
OBEX (OBject EXchange) is a communications protocol API that facilitates the exchange of binary objects between devices over a Bluetooth connection.
Telepathy
Telepathy provides D-Bus-based framework that unifies all forms of real-time communication, such as instant messaging, IRC, voice and video over Internet. The framework provides an interface for plug-ins to extend the protocol support by implementing new connection managers.
Text input (Hildon Input Method)
As the maemo platform is intended to be used on embedded devices, it is a quite logical that one might want to have different input methods from the ones available by default, or just simply want a different layout for the virtual keyboard. The maemo platform introduces a way to enable writing custom plug-ins for Hildon Input Method.
Sysvinit
System V style init scripts that spawn or kill processes according to system run-level. On Internet Tablet mainly used during system startup and shutdown.
Search
The maemo global search component provides a search framework.



Improve this page