RTOS, virtualization for real-time systems, DO-178B and hypervisor for the most demanding embedded operating system applications...

Developing Linux Applications for the Intel PCA Platform

by Vik Sohal, Senior Systems Engineer, LynuxWorks. "Developing Linux Applications for the Intel PCA Platform" was published in Wireless Comm and Computing Solutions. Download the original PDF version of "Developing Linux Applications for the Intel PCA Platform" here. Used with permission from Wireless Communications & Computing SOLUTIONS magazine. Copyright© 2003 Intel Corporation. All rights reserved.
Figure 1. The Intel PCA architecture

The Intel® Personal Internet Client Architecture (Intel PCA) offers developers of embedded, wireless communications systems a well-defined, scalable environment within which to build their applications. By defining a scalable set of interfaces for the hardware and software environments for these devices, the Intel PCA platform enables developers to rapidly build next-generation wireless Internet devices and services faster than ever before.

In this article, we will examine the use of the popular Linux® API and its relevance in the Intel PCA application layer from a development, debugging, and deployment perspective.

Building on a revolution

For some time now, there has been a revolution brewing in the world of embedded computing. Over the past 16 years, application requirements have been becoming increasingly sophisticated while the time to develop them has been steadily decreasing. In the past, development times in the neighborhood of 8 months to a year were standard. The level of sophistication was also much lower, with MMU-less environments being common. Today, however, the industry has changed dramatically. Embedded devices are nearly as sophisticated as desktop systems, and the need for rapid integration of the latest technologies has become more than a nicety, it is now a requirement for success.

For the environment that it was designed for, Intel PCA is a response to the time/sophistication trends. By offering an architecture where the critical subsystems can be decoupled into scalable modules, Intel PCA is a clear solution to the critical issues of rapid prototyping and deployment of sophisticated internet-enabled wireless devices.

To truly take advantage of something like Intel PCA, however, establishing the software that links all the components together is critical. In Intel PCA, this software is defined within the Applications Subsystem. As we will see, many of the requirements the Intel PCA Applications Subsystem has can be easily met by the Applications Program Interfaces (APIs) adopted by the Linux operating system.

Linux: a response to a need

At its heart, Linux is a modern-day implementation of the time-tested UNIX operating system definition. UNIX® systems have formed the foundation of the internet and have been refined and debugged over many years to be reliable and fast. Linux has built on top of the legacy of UNIX by adopting the UNIX process model, the device abstraction paradigm of making devices look like files, highly advanced networking, and many other features. The speed at which Linux has taken hold within the server world has been nothing short of phenomenal, but the speed at which it is being adopted within the embedded world is even more so. For the first time, embedded developers are able to locally utilize technologies that have traditionally been available only in the server environments. Even more important, the actual implementations of these technologies are derived from virtually the same codebase as that of their server counterparts.

What is the pervasiveness of the Linux Model? Well, mainly it can be summarized by examining what needs Linux meets within the environments it dominates in Table 1.

Interestingly enough, the needs for the standard environments within which Linux is used are virtually identical to those for the modern embedded application space.

Table 1. Linux benefits
Need Benefit
Reliability Linux meets this through its "open source, many eyes" model. By providing the source code to a very large community of developers who constantly test and refine it, the stability of Linux is always converging.
Standards Because of its open nature, Linux is a very popular platform for Adoption experimenting and implementing new technologies and standards. Real-Time implementations of the Linux API are also available (LynuxWorks LynxOS is an example of one).
Performance In order for any of the standards and technologies within Linux to be adopted into widespread use, they must perform better or equal to their commercial counterparts. This fact is well understood by the Linux community who strives to ensure a high degree of performance within successive releases of the core Linux system.
Tools As Linux has progressed into a world-class operating system, so have the tools which have been used to build it. The GNU tools suite and the hundreds of utilities taken from the UNIX world have benefited Linux developers greatly. The tool model within UNIX of being able to easily combine small, simple tools and utilities into complex executing entities has also worked well to build a sophisticated tools environment. This has also led to the support of Linux by many of the major commercial software vendors
Ports The original UNIX design was written to be highly portable and the same is true of Linux. For Linux, however, porting is even easier than it was with UNIX since the source and documentation is widely available with an active community willing to answer questions .
Support While it lacks a centralized support authority, the support for Linux is certainly not lacking. Commercial organizations and a very active developer community offer the Linux developer many choices for support.
Cost Because Linux is an open-source project, it has no cost associated with its deployment runtimes.

Linux: the ideal Intel PCA applications subsystem

With all the features built into it, Linux is the ideal OS for Intel PCA. The services specified for multimedia and power management are all available as are the services for device discovery and contained execution. The Linux HAL allows easy integration with new devices as well as low-level integration with power management technologies. What's more, both Linux and Intel PCA have been developed around the fulfillment of similar requirements, as seen in Table 2.

Table 2. The synergy between Linux and Intel PCA
Trait Linux Intel PCA
Scalability Evolved through a continuously varying set of requirements having to do with Linux being deployed in a variety of different environments ranging from PDAs to servers. Is built around the notion of scalability from a functional and design perspective. Being able to pick and choose components in the different subsystems is what will allow Intel PCA to meet the needs of designers looking to build products rapidly.
Configurability Goes hand-in-hand with scalability, Linux has always accommodated the ability to quickly change its operational modes, even on-the-fly. In the world of portable devices, this plays a greater role in helping designers experiment with different options in their design phases.
Expandability Originally a side-effect of being used in a wide variety of environments and platforms, this requirement has done a great deal in keeping Linux at the forefront of technology. The kernel module mechanism has contributed greatly in this area. The devices Intel PCA will be used to build will range greatly in their relative performance and capabilities. For Intel PCA to be a framework which will adapt to new technologies as they arise, it has been designed to accommodate the need for this trait.
Memory Efficiency Linux evolved from memory-limited environments. While modern implementations can use large amounts of RAM and ROM, This trait remains within the core of Linux. To accommodate the major differences in memory requirements for different devices, Intel PCA allows the mix-and-match usage of different memory technologies. To effectively utilize them, however, efficiency must be exercised at the application layers.
Performance From a computational viewpoint, Linux imposes very little overhead. Also, the networking and file access subsystems have been refined for performance. The co-processors which can be resident in the communications subsystem as well as the class of processors usable with the applications subsystem all show Intel PCA to be well designed in offering developers solutions for any performance issues they might run across.

An indestructible OS

Figure 2. The MMU in action

While its UNIX roots give Linux an implicit advantage in the area of reliability, figuring centrally in the reliability equation is the concept of MMU-based memory protection. The MMU (Memory Management Unit) is a piece of hardware that is embedded within virtually every high end processor, including the ones offered within Intel PCA. With the MMU enabled, native and contained applications are protected from each other and the OS by a system of page mapping. Physical memory is divided into a set of physical pages which are then mapped by the MMU into the virtual address space of each running process. The mapping looks something like the diagram in Figure 2.

Within this scheme, each process thinks it owns all the memory addressable by the CPU, when in fact, only the pages it needs are actually mapped in. This arrangement greatly simplifies compilation, linking, debugging and loading of programs since for every process, the OS uses the MMU to make it appear as if all the memory is available for use by the program starting at location 0.

If a program attempts to intentionally or unintentionally access a page that the OS has not mapped in, an exception is generated noting the exact state of the system.

The use of an MMU thereby increases the overall security of the system between programs as well as keeping the OS itself isolated from potential corruption.

How Linux maps to the Intel PCA application subsystem model

In the Intel PCA Applications Subsystem, the layout of services, APIs and abstractions looks like the diagram in Figure 3.

Figure 3. General Intel PCA applications subsystem layout
General Intel PCA Applications Subsystem Layout diagram

While the number of services Intel PCA specifies in its application subsystem are extensive, they are all available under Linux. Figure 4 shows a partial mapping emphasizing the overall completeness.

Figure 4. Linux Intel PCA application subsystem mapping
Linux Intel PCA Application Subsystem Mapping diagram

As you can see, the Intel PCA services offered under Linux are quite complete and extensive. What's more, the design of Linux allows all of these entities to be configured in or out as well as "tweaked" for performance.

Developing, debugging and deployment environments

Linux offers open source as well as commercial versions of tools for these environments. Let's examine them:

Developing

Because Intel PCA is an embedded environment, cross-development is the methodology of choice. While a Linux desktop system can be used as a cross-development system, Windows can also be used with the right tools.

Compilation and linking are done with the GNU toolchain either under an IDE or within a command-line environment. The IDEs available range from the open source offerings (KDEvelop, Eclipse, etc.) to commercial IDEs.

The command-line development environment offers instant response and an environment familiar to those who have used the UNIX command line environment. Aside from the writing of automated scripting procedures and interactive commands, the command line environment offers a simple way of rapidly combining the utility of many different programs through the interprocess mechanisms built into the command shell. This feature of the UNIX environment allows very complex, customized procedures to be built to handle virtually any situation the user encounters from checkins to file manipulation.

In Figure 5, we see how a simple combination of commands allows a very complex search to take place. The find command searches the current location in the file hierarchy for all files (the "*" regular expression). The resulting list is then passed to the xargs command which runs the egrep command with the argument vik for every search result returned. The results include the filename of the file as well as line where the match was successful.

Figure 5. The Linux Shell At Work
zardoz# find . -name "*" | xargs egrep vik
./add-copyright:DESCRIPTION=/usr/lynx/home/vik/useful
./telephone.list:Sohal, Vik 119 vik
./telephone.list:Vivikanandan, Ganeshan 136 ganesan
zardoz#

In some situations, users may wish to put elements of the development environment (particularly the elements used for script execution) within their final deployed Intel PCA subsystem. Doing this can save a lot of time in prototyping and debugging.

IDE offerings for Linux are quite extensive. From commercial offerings running under Windows Visual Studio to self-hosted offerings running under Linux itself, there is a very large variety of choices in this area. The IDE environments also benefit from the completeness of the Linux in that they can use features like the remote debugging features of the GNU debugger (GDB), instrumented kernel traces, communications features (things like tftp for remote booting and rsh for remote status information) and numerous other development resources available within the sophisticated framework of Linux.

For source code analysis, applications for Linux such as Rational's ClearCase can perform source code analysis. These applications can find memory leaks, incorrect use of language abstractions and many other common programming errors.

For source code control, RCS (Revision Control System), CVS (Concurrent Versions System) and other tools are available, and are often included in Linux distributions.

Under Linux, graphical user interfaces for development can be used through the XWindows system. This networked windowing system combined with an appropriate window manager (Enlightenment, KDE, etc.) enables a user to develop and prototype their applications entirely on their workstation if they use the same abstractions they eventually will deploy on the runtime Intel PCA device. This benefit allows distributed development of applications in an inexpensive fashion (not everyone needs access to the final deployment hardware...)

Debugging

Because Linux runs in MMU-protected mode, debugging applications under it is greatly simplified over traditional flat address space embedded kernels. Generally, the GDB debugger is. GDB can be deployed in a fully interactive fashion with the entire debugger residing on the target system, or it can be used in a client-server mode with the target system running a GDB debugging server. The latter method is generally preferred as it entails less memory on the target and allows remote debugging from a cross-development system.

There are also a number of GUI front-ends to GDB, which can provide impressive utility. These front-ends provide the user with a graphical interface that controls the underlying GDB application through a command-line interface. Thus, you can interact with GDB with either the GUI or through its standard command-line interface.

For an embedded system, there are also timing considerations to consider. While not every embedded system has real-time requirements, all have responsiveness and performance requirements. Being able to measure the performance of running applications is frequently an important aspect of development.

Figure 6: Encapsulation at work
Encapsulation at Work diagram

First in line for assessing application timing and efficiency is the gprof utility. This utility is included as a standard part within virtually every Linux development environment. It relies on an instrumented binary built by the compiler (under GCC, this is done by throwing the -g switch). When an instrumented program is run with gprof, a table of computation usage is displayed.

For determining system-level timing, a variety of choices are available both in the commercial and open source domains that allow the Linux kernel to be instrumented and its operation displayed. This level of detail allows very comprehensive performance analysis to be performed on both kernel operation as well as the operation of the various device drivers and kernel modules.

Deploying

The crowning aspect of using Linux under Intel PCA is, of course, deploying the finished product. Most embedded Linux distributions provide some sort of encapsulation mechanism. In most cases, there is an encapsulation utility which creates a self-contained image with a ROM/RAM filesystem and a kernel. When this image is loaded into the target system, it extracts itself, runs the kernel and mounts the filesystem. The user only has to establish which features/drivers/kernel modules and other runtime entities need to be included in the final deployment. Scripts can also be used to coordinate the execution and startup of various subsystems.

Support

While a fully usable embedded Linux distribution can be assembled from freely available open source code, it is not generally a cost-effective proposition to do this. The time spent in integrating, testing and configuring a Linux distribution is a job best left to an organization and not to an individual. While the Linux model of community support works well for users utilizing widely used components, it breaks down when applied to the embedded development model where there are far less users with more customized requirements.

Commercial support for an embedded Linux is therefore a highly necessary aspect of using this model effectively.

Overall, Intel PCA is an admirable effort at creating a standardized platform for handheld device operation. An embedded version of the Linux operating system can meet or exceed the requirements dictated by Intel PCA for application scalability as well as subsystem scalability.

Sources

Figure 1: "Intel PCA Overview," Intel Web site http://www.intel.com/pca/developernetwork/overview/index.htm
Figure 3: "The Intel Personal Internet Client Architecture" White Paper September, 2001
Figure 4: "The Intel Personal Internet Client Architecture" White Paper September, 2001

Copyright© 2003 Intel Corporation. All rights reserved.

A LynuxWorks embedded OS is featured in this embedded system application:
Who else uses a LynuxWorks embedded operating system?
Security white papers
DO-178B Provides Certification Safety net
Developers of commercial avionics software must demonstrate compliance with DO-178 guidelines. The FAA has issued additional guidance for so-called DO-178B Reusable Software Components (RSCs as defined in AC20-148), which allow for reuse of certifications. (COTS Journal, November 2009)
Designing Safety-critical Avionics Software Using open Standards
Safety-critical avionics systems have continually grown more complex and software-intensive. Regulatory authorities and avionics manufacturers have responded with guidance such as DO-178B and RSC to ensure that software performs safely, with controlled development cost. (Boards and Solutions, September 2009)
Two Different Realms: RTOS Support for Safety-critical vs. Security-critical Systems
Safety- and security-critical system functions are evolving simultaneously, with different yet similar requirements. Modern RTOSes are stepping up to meet these needs. (VME and Critical Systems, June 2009)
Virtualization Makes Better use of Open-source OSes and apps
With the introduction of the embedded hypervisor, embedded systems can avoid certain performance or licensing issues inherent to open-source OSes and applications. (EE Times, March 23, 2009)
Secure Virtualization Technology can Extend the life of Legacy Systems
By combining the concept of virtualization and security, one can consolidate multiple legacy systems running on heterogeneous operating systems onto a single host system with high-assurance security. (Military Embedded Systems, January/February 2009)
Separation Kernel for a Secure Real-time Operating System
The technical foundation adopted for the so-called MILS architecture is a separation kernel like LynxSecure, which permits multiple functions to be realised on a common set of physical resources without unwanted mutual interference. (Boards and Solutions Magazine, February 2008)
Advances in Virtualization aid Information Assurance
Advances in the newest Intel® processors are making virtualization much easier to implement in security applications than ever before. (Embedded Computing Design, January 2008)
Protecting our most Vital Systems
Some significant defence programmes are already committed to a new approach to high-threat, high-asset-value systems. Rance DeLong explains MILS. (Components in Electronics, April 2007)
Perspectives: Security and the Separation Kernel
Today's avionics systems are designed to support more than one application, using a partitioned operating system and memory management units to ensure applications have adequate separation. (Avionics Magazine, April 2007)
MILS: An Architecture for Security, Safety, and Real Time
The unrelenting growth and integration of embedded controls, information processing, and communications has created a need for systems that provide robust protection for resources and services in the face of serious threats. (Air Force Research Laboratory Technology Horizons, November 2006)
Partitioning Operating Systems Versus Process-based Operating Systems
Partitioning operating systems are the latest buzz, while processes, by contrast, have been around for over 30 years. Both provide memory protection, however, the intent behind them is very different.
DO-178B and the Common Criteria: Future Security Levels
Although there are similarities between the airborne safety-critical requirements in RTCA/DO-178B and the Common Criteria, ISO 14508, compliance with the higher levels of security in the Common Criteria demands meeting additional security requirements. (COTS Journal, April 2006)
Reusing Safety-Critical Software Components
Safety-critical systems often operate together as a single "system-of-systems," making it important that they meet the most stringent and rigorous requirements for safety-criticality. The failure of one module in a system could create other failures or vulnerabilities, or worse yet, failure of the system as a whole. (COTS Journal, August 2005)
Using the Microprocessor MMU for Software Protection in Real-Time Systems
With minimal impact to overall system performance, user tasks and the kernel can be protected from accidental corruption by using multiple protected address spaces.
Improving code Migration and Reuse
The unrelenting growth and integration of embedded controls, information processing, and communications has created a need for systems that provide robust protection for resources and services in the face of serious threats. (Embedded Computing Design, August 2006)
LynuxWorks: A case Study in Combat-ready Linux
As open source, especially Linux, makes its way into nearly every sector of the economy, one of the final frontiers is the military and aerospace market, where new applications must clear hurdles such as the FAA's rigorous DO-178B certification for aviation software. (Newsforge, December 2005)
FCS Program Rolls Forward in Formation
A wireless data network, with advanced communications and technologies, links soldiers with 18 new, lightweight manned and unmanned ground vehicles, unmanned aircraft, sensors and weapons—and it's all in one program. (COTS Journal, June 2005)
Embedded Tools Train an eye on Security
As embedded designers incorporate more security and safety needs into devices, embedded tools will have to evolve to provide capabilities needed both for product development and process management. (EE Times, September 2004)
Secure Operating Systems for Deeply Embedded Devices
As we add more intelligence to our embedded devices, we find that they are becoming increasingly integrated into our information technology infrastructure. Though system security is not a new concept, security-in-depth is a new paradigm developers are now starting to address. (RTC Magazine, September 2004)
LynxOS Embedded RTOS LynxOS-SE Embedded RTOS RTOS: LynxOS-178 for software certification Luminosity Eclipse-based IDE
Embedded Linux: BlueCat LynxSecure Separation Kernel and Embedded Hypervisor SpyKer Embedded-System Trace Tool

Industry Solutions

Migration

Industry Standards

Embedded Systems Technology

RTOS Training for Embedded Systems

Training at LynuxWorks

Embedded System Consulting

LynuxWorks Support

Embedded Systems

LynxOS RTOS Support

BlueCat Embedded Linux Support

Contact Us

About LynuxWorks

Press Room

Newsletter and Announcements

Careers

Site Map

Board Support Packages (BSPs)

BSP Device Drivers

BSP Targets by Operating System

BSP Targets by Form Factor

Third-party I/O Devices and Hardware

SynergyWorks: LynuxWorks partners


What is SynergyWorks?

Third-party add-ons for LynuxWorks operating systems

Copyright © LynuxWorks™, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of LynuxWorks is prohibited.