News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Embedded Linux and Java — made for each other (Part 2)

May 25, 1997 — by Rick Lehrbaum — from the LinuxDevices Archive — views

Why Java?

Java offers the domain of embedded systems clear advantages over C code or assembler. The most significant are ease of development and maintenance, reuse of code, and easy integration of native code and Java code.

  • Ease of 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, code can be easier to instrument, debug, analyze, hot-replace, and maintain. Connected devices can be far more complex than previous kinds of embedded systems. 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 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 segments.

  • Reuse of code — 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 pay-back 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 Linux.

  • Integration of Java code and native code — 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 development.


    Figure 1: 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.

    The next generation of embedded project developers will need to deal effectively with the complexity and power of connected network attached devices. Since both Linux and Java implement 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.

  • Choosing a platform: the middleware choice — There are 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 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 well-organized way. 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 enjoys today.

    Finally, it's possible to extend Linux to provide the control developers need to ensure deterministic real-time program execution and behavior. There are several approaches to implementing this. MontaVista provides extensions to standard Linux platform features rather than modify them. For example, to support real-time program execution, Hard Hat Linux made new APIs available for controlling memory management, thread scheduling, and process execution.

  • Efficient application execution — 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 instruction sets. 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.

    IBM took a unique approach to creating its implementation of embedded Java, actually creating all target versions of J9 and all configurations of the Java class libraries from a single source. IBM's source for J9 and the Java class libraries is in a form that describes how to construct the components. A separate porting layer is used to describe unique characteristics of the target processor and RTOS interfaces. Using proprietary techniques, individual ports of these components are generated, then compiled using the tools provided from the embedded Linux RTOS vendor.


    Figure 2: Memory size and application complexity

    Naturally, it's important that an application run fast enough. With just-in-time compilation techniques and adequate program cache memory, program execution can approach native machine language execution speeds. 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 processors.
Continued



Story navigation . . .

 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.