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.
![]() |
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.
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.
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.
| 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. |
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.
| 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. |
![]() |
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.
In the Intel PCA Applications Subsystem, the layout of services, APIs and abstractions looks like the diagram in Figure 3.
![]() |
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.
![]() |
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.
Linux offers open source as well as commercial versions of tools for these environments. Let's examine them:
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.
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...)
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.
![]() |
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.
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.
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.
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.
Industry Solutions
Migration |
Industry Standards |
Embedded Systems Technology |
Board Support Packages (BSPs)
BSP Device Drivers |
BSP Targets by Operating SystemBSP Targets by Form Factor |
Third-party I/O Devices and Hardware |
SynergyWorks: LynuxWorks partners
|
Third-party add-ons for LynuxWorks operating systems |
||