Michael Mathews of Montavista explains how the combination of anembedded Linux OS and Java technologies can provide a option for
flexible project development.
Today we are witnessing the dawning of a new age of information
access and consumption for personal as well as business use. New
types of information and new ways of using it are driving up demand
for anytime and anywhere access, feeding a need for always-on and
At the same time the market for small information devices is
rapidly evolving, driven by old and new companies addressing the
increasingly diverse consumer demands with powerful network enabled
devices that deliver more functionality.
These devices are found everywhere &endash; in the pocket or
purse, in the car, in the home and of course in the business. They
represent the next generation of net-centric computing and
They must be small, powerful, flexible, easy to use, secure, and
affordable. They must integrate well with the existing
infrastructure, work well with legacy devices, and support an easy
and painless forward migration. They will have a short life span,
followed rapidly with the next product, and therefore must be brought
to market quickly, on-time and on-budget.
The tools to facilitate this creative process will have to be
powerful, flexible and easy to use so that platforms and applications
can be built quickly, evolved and released frequently to meet
time-to-market needs. A large number of developers will be needed and
they will have to be able to work well in distributed development
teams and with code from many other developers. Very few tools can
meet all of these needs today &endash; in fact the only tool that is
ideally suited to meet this challenge is Java.
Java technology offers the domain of embedded systems developers'
clear advantages over current alternatives such as C and C++ code or
assembler. The most significant are ease of development and
maintenance, the facility to reuse code, easy integration with the
native system when necessary, and availability of a large number of
Java has been very successful over the past few years in the world
of client-server applications, and more recently in the burgeoning
e-commerce application server market. The focus in this space has
lead to many innovations that have benefited Java as an application
environment; many that apply equally well to embedded applications as
to server applications.
Development and maintenance
Over the entire life of a project, the Java environment enhances
ease of development and maintenance. When the target system is based
on a virtual machine, the code is easier to instrument, debug,
analyse, hot-replace, and maintain. Network enabled connected
devices can be far more complex than previous kinds of embedded
Manual techniques for upgrading may be no longer effective over
the project lifecycle. Instead, the connectivity of devices provides
the ability to manage components remotely, allowing development teams
to add product features, resolve problems, and maintain and upgrade
the software in the device after the product ships.
Java is a network-centric technology, designed and developed to
support the notion that the 'network is the system'. Therefore it
readily supports multiple network topology models, facilitates
interoperability through its API standardization, and enables the
delivery of features and services locally or via remote network
Java technology makes true cross development possible. Program
function is developed on workstations, unit tested and prepared for
integration. Thus, even without access to prototype hardware,
developers can proceed with function development. After prototype
hardware is available, developers can share it through network
attachments, creating a virtual lab accessible to team members within
a company or among partner companies.
The Java program execution environment also reduces issues
relating to memory management, allowing automated 'garbage
collection' techniques to be used to cleanup after released memory
Java development tools
Many developers and engineers have discovered that a critical
advantage is gained when a complete toolkit is available to embedded
Java application developers. Many of these developers have come to
embedded projects from past experience deploying enterprise class
projects, many of which will focus on the logical extension of
existing online services directly to pervasive connected embedded
devices. These developers expect to find efficient development tools.
They regularly use integrated development environments, sophisticated
debuggers, ahead-of-time Java language compilation techniques, and
program analysis profile tools. Most also have experience with
integrated version control and release management facilities.
There are many popular examples of Java development environments
available today, including Jbuilder from Borland and Forte from Sun.
A completely integrated, cross-development environment designed to
support the developer working on the host and the target is often the
critical factor in helping a project stay on time. VisualAge Micro
Edition from IBM/OTI is the leading example today.
Many developers working to create embedded Java applications using
an embedded Linux operating system will also want to use Linux as
their development workstation. This helps create a uniform and
efficient development experience and avoids the necessity of
switching between Linux and Windows workstation conventions for
commands and user interface interaction.
IBM and MontaVista have provided the VisualAge Micro Edition IDE
and tools for use on Red Hat Linux-based developer workstations. This
supports a complete cross-development embedded experience for
engineers and developers.
It's often an advantage to develop applications on a personal
computer workstation and then deploy them remotely to connected
devices in a shared laboratory. The VisualAge Micro Edition tools
provide this through remote debugger and program analysis tools and
the use of shared file techniques between the developer workstation
and the target platform. NFS or LAN based sharing techniques permit a
Java program object to be immediately loaded on a remote device.
With the hot-code replacement facilities of the virtual machine,
program changes can be immediately and seamlessly activated from the
debugger interface on the developer workstation. This tight
integration leads to a new level of efficiency for embedded
Since Java technology is based upon virtual machine technology,
hot-code replacement is available to connected embedded devices. This
offers a new degree of flexibility and convenience to the designers
of embedded projects. In particular, it's possible to design future
enhancements and feature activation based upon these techniques using
OSGi Bundle Management.
Due to the specialized requirements of embedded systems and the
corresponding use of varied, specialized hardware, embedded software
developers have traditionally used quite rudimentary methods of
development, sometimes starting from scratch on each new project
Now, as embedded techniques mature and the systems themselves
become larger and more sophisticated, there is increased interest in
reusing components or full applications from product to product. This
reuse makes it possible to invest in development once and extend the
payback across multiple projects.
The Java environment lets the owner of a component adapt it to
many projects and platforms, often at lower cost., even when
customers require different targets or when technology has introduced
new hardware (CPUs, devices) and software, including variants of
Thanks to the establishment of standard Java class library
configurations it's more than possible to manage application size. In
fact, studies have shown that applications that occupy over 500KB can
actually be more compact when deployed as Java byte-codes. This is
because byte-codes are more compact than many hardware machine
The ability to reuse well-known routines in the class libraries
combined with the smaller byte-code instructions, more than make up
for the memory footprint of the virtual machine and libraries.
With just-in-time compilation techniques and adequate program
cache memory, program execution can approach native machine language
execution speeds. What's really important is that an application runs
fast enough. For many applications (including deeply embedded devices
that act as servers monitoring product sensors or controls, and
devices which expose user interfaces) high-speed execution is not an
issue. Users often navigate graphic interfaces with speed much slower
than that delivered by interpreted Java code on today's embedded
Java developer community
Perhaps the greatest advantage derived from using Java for
embedded applications is the large developer community. Java has been
a standard part of most computer science curriculums for the past
five years, and has become globally accepted as the next generation
language and environment for network-centric applications. It is
familiar, easy to use, blessed with a wide variety of developer tools
and a strong developer community rivaled only by the Linux developer
community that has grown up during the same time frame. These
combined attributes have made it the most popular multi-platform
development tool for the new generation of applications being
designed and built today.
Java for embedded
Most of what we have covered so far applies to Java in general.
Now let's take a look at what has been happening to make Java better
for embedded use. Java was initially introduced as the language
panacea for small devices of all types.
The Java 1 specifications evolved to cover several different
configurations known as editions. The standard edition and the
enterprise edition have continued to evolve in a straight line from
Java 1 to Java 2. The original Personal edition became known as
Personal Java (pJava), and while usable on OS platforms such as
Windows CE, it could not be used for platforms with more constraints,
such as the Palm OS.
The J2ME specifications were created to address this issue and
others generated by the rapidly changing world of embedded devices.
Indeed, it is the very demands that the world of embedded makes on
Java that have resulted in the popularity and growth of J2ME. Figure
1 shows a high level view of the Java 2 configurations as they are
Fig 1: The Java 2 Platform Editions. The Java 2 Platform
Editions specify the standard API's, Java classes, and services that
are mandatory and optional for each environment. J2SE and J2EE are
designed for distributed client-server environments. J2ME is designed
to be flexible enough to work in a variety of embedded device
The J2ME specification has emerged from the Java Community Process
(JCP) as a set of specifications that are related but not totally
It addresses two fundamental device types:
1. The small battery operated portable consumer device with the
Connected Limited Device Configuration (CLDC); and
2. The small network attached device with the Connected Device
Each of these configurations is the minimum needed to build a Java
application, but both are further defined with profile
The Mobile Information Device Profile (MIDP) defines the minimum
necessary to build Java applications for small mobile devices such as
pagers, cell phones and PDA's.
The Foundation Profile defines the minimum needed to build devices
such as digital set top boxes, home gateways, automotive telematics
devices and others.
The Personal Profile (actually there are two, Personal Basis and
Personal) further defines the CDC/Foundation stack to get back to a
Java 2 specification of the old Personal Java. This helps to ensure
support for legacy implementations that still have a potentially long
The trend in embedded applications is to rely on instrumentation
for measurement and control, and to rely on software for integration
and flexibility. This means that software is filling to role formerly
addressed with intelligent instrumentation. Using software to
integrate a diverse set of devices allows for more flexibility in how
the measurement data is used to control the overall system.
Examples range from traditional industrial automation such as the
control systems used on off-shore oil rigs (see side panel), to
automotive telematics systems used to integrate automotive systems
management, to aeronautics and space exploration systems used to
integrate a diverse set of measurement and control devices into
embedded super-systems. The complexity of these systems grows
exponentially with the size of the overall system. The only way to
manage this is through the use of strong object-oriented principles
applied throughout the system. This also demands that software be
able to perform the tasks of devices as well as or better than the
Real-time special needs
Real-time system needs are a relatively small slice of the overall
code, but unless the overall system can support those real-time needs
device monitoring and control will not be good enough to meet today's
embedded applications requirements. This is particularly true as the
number of devices making up the overall system increases.
Device control in any one instance requires rapid response by a
small number of elements to monitored device events. Add 10, 100 or
1000 instances of devices being monitored and you can begin to
appreciate the real-time demands placed on the overall system. Key
components used in Java address these needs are deterministic
preempt-able garbage collection and memory management, mapping Java
threads onto native threads, and Java/native OS integration through
the Java Native Interface (JNI).
As the demands placed on the software grow Java has responded with
specialized support for specific applications and devices.
For security there is Java Authentication and Authorization
Service (JAAS), Java Cryptography Extension (JCE) and Java Secure
Socket Extension (JSSE). For digital multimedia applications there is
Java Media Framework (JMF), Java 3D, Java Advanced Imaging (JAI) and
the Java TV API.
In addition, several industry organizations are building Java into
their standards, including digital multimedia standards using
DVB-MHP, DTVIA and Open Cable, home gateways and networking with OSGi
and HAVi and smart handheld devices and screen phones using the ETSI
GSM, ECTF and ISRF standards.
As Java becomes more tightly integrated with the devices in a
system, the natural extension is to implement parts of the Java
environment in the silicon it runs on. This has been attempted
several times in the past few years, with initial attempts gaining
little success. As lessons are learned from this work we will see
more areas where silicon-Java not only makes sense, but also works
better than soft-Java.
Examples include hardware Just-in-Time (JIT) compilers, Java
accelerators for commonly used byte codes, and Java microprocessors
that can execute as native instructions with or without a JVM. There
are many companies working in this area today, and over the next 1-2
years we will begin to see real products based on these
Choosing a platform
Historically the choice of an operating system for embedded
applications was simple. There were several proprietary RTOS
alternatives to choose from. Today the choice is becoming easier with
the adoption of Linux for embedded applications. The Linux
environment has become extraordinarily popular in recent years,
resulting in much interest and activity in Linux development and
As the core Linux technology evolves to address new requirements,
the infrastructure continues to grow, providing support for numerous
new devices, technologies, protocols, and services. Most of the work
to integrate Linux with various platforms will be done by the
provider of the embedded Linux port. This work addresses the driver
development and integration necessary to fully support the features
and functions of the board. Although most embedded Linux vendors base
their work on open source components, few deliver a product that is
100% open source.
There are also numerous choices for middleware, most available as
individual components such as protocol stacks, graphics development
tools and managers, and special OS services such as high availability
and real-time extensions.
Using any one of these individually is not too difficult, but as
the number and variety increase there is inevitable impact on
developer productivity and delays during integration, test, and debug
caused by the added complexity in the stack.
Initially designed to address these issues in the desktop and
server market, Java technology has begun to find wider acceptance as
the application environment for embedded projects.
Providers of Java technology have already done this integration
for several standardized facilities, including communications,
security, and component management. The object-oriented nature
inherent in Java application design allows all of these disparate
middleware services to be dealt with in an efficient and
Other middleware environments offer the same kind of abstraction
from the details of the underlying implementation, but none with the
broad industry support that Java technology enjoys today.
The use of native code has significant implications in terms of
portability of applications and the ability to reuse code. A
well-engineered interface between the Java application, virtual
machine, and underlying hardware brings the best of all worlds to
embedded compatibility. Native code, while not portable, may be the
best solution for many functions and device interfaces.
Adding standard communication, post-development component
management, new user interfaces, and security features would be quite
expensive and time consuming in C, C++, or assembler. The Java base
libraries provide these things and more, which can speed
The next generation of embedded project developers will need to
deal effectively with the complexity and power of connected network
attached devices. Java technology implements access to TCPIP
communication component stacks - much of the work to enable
communications support has been completed, and done in a
well-understood and standard manner.
Developers can take advantage of standard tools and a wide variety
of underlying code to build network-centric services on top of a
well-established network infrastructure.
Fig 2: Component relationships: Developer Focus and Skills.
Many developers are now being educated on Java application
development. IBM has, for example, several thousands of programmers
who create Java applications. With this popular language and
deployment environment uniformly available in major educational
institutions, the number of Java developers is growing.
Synergy of Java and Linux
A properly implemented embedded RTOS must form the core of the
embedded Linux/Java platform. Embedded devices pose several
restrictions and constraints on an operating system, device drivers,
and other foundation components.
It's important to work with a version of Linux that has been
specifically implemented with embedded target platforms in mind. Not
just any Linux will do.
Special attention must be paid to the management of scarce
embedded device resources like RAM, ROM, and Flash. Where processor
features are lacking (for example, floating point math accelerators),
it's necessary to provide efficient and seamless implementations that
run on the hardware that is available.
Since embedded Linux must adapt to the unique resources available
on a target device, it's important to be able to quickly and
efficiently rebuild and restructure the Linux operating system image.
This allows developer/engineers to add, remove, and reconfigure Linux
features that will be needed by the virtual machine and Java
applications. In embedded deployment, every aspect of the device and
application must be considered in the tradeoff between size, speed,
and resource constraint.
Embedded platforms are nothing like the standardized personal
computer or server targets for which enterprise and workstation
variants of Linux are designed. In particular, special attention must
be paid to enabling access to devices on embedded targets.
Uniform access to communications ports, flash memory arrays,
display devices, and sound interfaces must be enabled. Thanks to the
broad experience embedded RTOS developers have had with Linux
deployment, several embedded-oriented standards have evolved for use
on these devices.
These standards encompass the following:
- Low overhead display device management
The combination of an embedded Linux OS and Java technology has
delivered a new level of efficiency for constructing graphic user
interfaces that can be rendered on touch screen equipped LCD display
devices. Low cost, compact, and often in color, these display devices
are attractive to both consumers and product designers.
Many pervasive designs will deliver user interface convergence on
convenient handheld or set-top-box devices, allowing control and
visibility to a large array of headless connected embedded platforms
deeply embedded in appliances, vehicles, and communications devices.
Graphic user interfaces tend to be deployed on embedded platforms
on either bitmap-based coarse icon-based forms or window control
Unlike server or workstation-based Linux, which often implements
the server/client oriented 'X-Windows' user interface framework and
one of several alternate window managers, embedded Linux offers an
efficient and direct approach. MontaVista Linux, for example,
incorporates the open source package 'MicroWindows' ported to run on
many supported processor/device platforms. This package runs directly
on top of the Linux frame buffer, providing a low-level hardware
interface that is very close to the device hardware. It's designed
for high performance on embedded processors and can be used to create
very responsive interfaces.
- Communications interfaces
Almost every development platform and embedded computer includes
communication interfaces. It's a basic part of the task of Linux
porting to make drivers available for RS-232 serial communications
and Ethernet if the devices are present on the board.
Communications is either based upon the TCPIP communications stack
provided in Linux or on raw manipulation of simple serial or bus
interfaces. The TCPIP stack provides access to the Internet and
socket interfaces for implementing session-oriented
Specialized communications buses and devices that directly attach
to the serial device can be manipulated directly through classes
provided as extensions to the Java class libraries. This could
include devices that interface with automotive buses like 'CAN',
'MOST' or IEEE J-1850.
During development, some devices may be accessed directly through
serial connections. Examples include cell phones, car radios and GPS
units. These devices are controlled through specialized protocols
that are transported over the serial link. In production, these
devices may actually be attached to an automotive communications bus.
For this reason, a layered architecture is needed for device control.
IBM has created device kits that can provide hardware simulation, and
alternate transport techniques so that the programs written on
development platforms can be directly moved into production designs.
Port combinations using Java technology and an embedded Linux OS
are now available on a large number of embedded targets. The
developer/engineer can configure and scale the virtual machine and
Java class library components as well as the embedded Linux RTOS
according to the needs of the project. Device drivers can be included
as needed, while still retaining a uniform approach to application
development and deployment for many related devices. This method
allows improved program code reuse on a large range of devices from
deeply embedded headless servers through user interface rendering
platforms. From the smallest to the largest embedded device, the
combination of a Linux OS and Java technology is very scalable.
Much of the cost of a project occurs after development is complete
and the product is deployed. This support expense can relate to the
product consumer in many ways.
The developer's relationship with the supporting Linux and Java
technology vendor is key when considering embedded Java code. It's
typical for the Java development engineers to have worked with the
Linux vendor when doing initial ports of the virtual machine and Java
class libraries to the embedded Linux target platforms.
The ongoing relationship between Linux and Java vendors is an
important consideration. It's also important, especially in the open
source environment of Linux, to be able to access the source for Java
class libraries in the various configurations being considered for a
The combination of an embedded Linux OS and Java technologies
offers engineers and developers a new choice for flexible project
deployment. Thanks to the emergence of professional support
organizations that have focused on the problems experienced by
embedded developers, a wide array of connected device platforms can
now support execution of Java applications.
Initially the most important consideration might appear to be
access to open source or deployment without RTOS royalties. These
embedded platforms may be less expensive to deploy since the business
model for the RTOS is based upon subscription services for support.
Improvements in tools for use on the Linux platform have included
specific attention to working in the resource-constrained environment
of embedded devices. With the availability of IBM's VisualAge Micro
Edition, Java application developers are fully supported with rich
cross development tools.
Long history and experience running Linux on servers has lead to
improved robustness in the Linux kernel and related facilities. These
enhancements are shared with the providers of embedded Linux
technology. Today, Linux is proving to be a robust environment with a
track record that is improving with time and experience.
Current embedded Linux development is focusing on providing more
configurable and smaller size operating system components that
improve the speed of device initialization and resource utilization.
When matched with the power and flexibility of the Java environment,
project managers and developers have available a combination that
enables them to successfully design and develop the next generation
of embedded systems applications, delivering high reliability and
Published in Embedded Systems (Europe) May