by Rinaldo Digiorgio

Java in embedded systems

how-to
Sep 1, 199611 mins

An interview with real-time professionals reveals Java's role in that field

This article will look at Java in the Real Time industry from a Business and Technology stand point. A more technical description of some of the issues, a short review of what is in JavaOS and a small highway-control applet demonstrating some of the requirements that JavaOS from a real-time perspective must meet in the future are discussed in this article. The following interview was conducted electronically with Bernard Mushinsky (bernard.mushinsky@javaworld.com), President of IPI, on June 12, 1996. I asked Bernie some questions thinking that Java was going to have a negative effect on his business and found out Java is creating opportunity in markets where it can potentially displace some well developed technologies.

Also, I lobbed a few questions at Dr. David Ripps (david.ripps@javaworld.com), Vice President of Research at IPI.

We complete the article with a short discussion of the newly announced JavaOS from Sun Microsystems and some pointers to other sites with URLS of interest. JavaSoft has also announced plans for an embedded api and serious developers should check out the general status of all the APIs.

Now, for the interviewโ€ฆ

Rinaldo: What is IPI and what does it do in the real-time industry?

Bernard: IPIโ€™s MTOS is a family of real-time operating systems that are widely used in embedded applications. There are more than two thousand licensees and many thousands of MTOS-based products have been developed. There are literally millions of embedded copies of MTOS in action in the real world.

MTOS ports are available for the 80ร—86 and 68xxx families, the MIPS R3000/R4000, and the PowerPC. Numerous board support packages have been developed and are readily available to interested parties. Among these is a highly integrated system for the 80ร—86-based PC. This system takes over the PC, and includes a DOS-compatible filesystem and drivers for all of the standard PC peripherals. Part of the standard package includes extensive support for third-party development and debugging software, as well as IPIโ€™s own Debugger/Resource Reporter.

MTOS applications range from a device to mix drinks to the AWACS and other high-end products. A few of the main product areas and some typical customers are given below:

Communication SystemsAlcatel, Ericsson, Fujitsu, GPT, GTE, Motorola, NTT, Philips, Tellabs
Process ControlABB, Bristol Babcock, Bailey, GE, Honeywell, Measurex, Toshiba
Factory AutomationGE, GM, Mitsubishi, Philips, Sony, Toyota
Medical EquipmentCiba/Corning, Cobe, Gambro, GEC, Johnson & Johnson, Nova Biomedical, Puritan Bennett, Siemens
Graphics & ImagingData Products, Genicom, IBM, Kodak, Philips, Printronix

Rinaldo: What will the effect of Java be on IPIโ€™S business? How do you think the Picojava, Microjava, and Ultrajava chips will effect your industry?

Bernard: In order to answer this question, itโ€™s necessary to assume that Java will evolve rapidly into a system that can meet the needs of the embedded systems marketplace. I say rapidly because, if the evolution is too slow, then Java really wonโ€™t get there at all. Furthermore, while Java, as presently constituted, can be used in certain non-critical embedded applications, it needs to be strengthened in significant ways. It should be more efficient, more robust, and more capable in ways that are relevant for embedded applications. One of the really undesirable things that should be avoided at almost any cost is a proliferation of proprietary solutions. Really, Sun should face up to these issues and, perhaps by working with a company like IPI, find the way forward.

Having made this statement as an introduction to my answer, Iโ€™ll now float the prediction that Java will in fact improve in the ways that we have in mind. Assuming that, Java is destined to have very far-reaching effects, much of which cannot be foreseen at the moment. Here are a few discernible consequences:

  • Leveling of the playing field. This will come about because, as Java technology replaces proprietary aspects of competing RTOS products, the feature set of the proprietary RTOS will be de-emphasized. Java technology will replace a lot of tasking models.

  • A greater emphasis on the network, which is inherent in the Java environment. Third-party arrangements that we now maintain in order to provide TCP/IP and other communications packages are likely to be less important.

  • It will become easier for IPI to offer complete solutions to a larger variety of customers.

Rinaldo: Given the fact that Java is beginning to be seriously considered for use in real-time business, what changes will you make to your current product line?

Bernard: IPI is now integrating MTOS with Java. The MTOS products will be re-designed to support Java threads and the various facilities that Java needs in order to function in an embedded environment. In addition, certain valuable MTOS features will be retained. Chief among these is support for multiple processors. This feature is transparent to the application and will be transparent to Java as well.

Rinaldo: Any ideas on what the size of the real-time segment of the Java market will be?

Bernard: This is not an easy question, especially since the availability of Java itself is likely to have a significant effect on the entire real-time market.

The market as a whole has a wide variety of components that are offered by an even wider variety of suppliers. Estimated current market sizes are:

  • Vendors of RTOS products: 50,000,000
  • Vendors of compilers, debuggers and other tools: 50,000,000
  • In-houseโ€ providers of RTOS and other tools: Unknown (The size of the โ€œin-houseโ€ segment is estimated to have a value at least as large as the value of the products provided by the โ€œvendors.โ€)

Can Java capture a substantial part of the market. Probably yes; obviously we wonโ€™t know for sure until we have more experience on which to base our predictions.

Rinaldo: You argue that Java is likely to play a leading role in embedded systems. Can you justify that claim?

Bernard: That question is best answered by Dr. David Ripps, IPIโ€™s VP for engineering. His paper describes some of the work currently going on at IPI to provide a platform that integrates Legacy real-time products with Java.

David: I base my prediction on several observations.

First, because of the importance of the Web, many programmers will be forced to learn Java. Eventually, universities will switch from C to Java in Introduction to high-level languages courses. Once programmers become fluent in Java, they will naturally want to apply the language to areas beyond the Web โ€” to embedded (real-time) systems, for example.

Secondly, the companies that develop real-time systems want the flexibility to move to hardware other than that for which the system was originally targeted. This requires that the programs be portable across hardware platforms and even instruction set architectures. C provided some portability. But, embedded programs must be structured as a set of independently-executable threads or tasks. C does not have any such an execution unit as an inherent part of the language. Nor does it have mutual-exclusion or any other method to protect shared data. Programmers have to get threading, protection, coordination, and communication services from a proprietary OS. Some OSes, such as MTOS-UX, make all services available for a wide variety of CPUs; many OSes do not. By building threading and data protection directly into the language, you can port a Java program to any (Java-enabled) platform, and the program works the same way. At least in principle.

Rinaldo: You speak of embedded or real-time programs. What is your definition of real-time?

David: A real-time system is one in which timing constraints imposed by the world outside of the computer play a critical rote in the design and implementation of the system. Common areas for embedded systems are machine and process control, medical instruments, telephony, and data acquisition.

Rinaldo: Java seems to be a natural for embedded systems.

David: Java is certainly attractive as an alternative to C augmented by a real-time OS. However, you pay a price. Java does not have a rich set of coordination primitives. The programmer is forced to construct such common coordination objects as mailboxes and multi-bit event flag groups at the thread level from the few built-in facilities. This produces code that executes significantly slower than having such services provided at the kernel level.

Rinaldo: How sure are you that Java will live up to its expectations?

David: The need for a universal programming standard has been around since the days of Fortran. But industry has been burned before by promises of a universal, real-time-capable language. I am thinking of Ada. Despite high expectations and government mandates, Ada never displaced C for embedded systems. It is still too early to be absolutely sure that Java will become a force outside of network programming.

Rinaldo: How quickly might Java invade the embedded marketplace.

David: There is an enormous number of embedded systems that are currently written in C. Few companies are going to toss out that investment and re-write it all in Java. There will be cautious experiments in using Java for new products that do not have a critical delivery schedule. If these projects work well, we may see hybrid systems going out into the field: mixtures of legacy C code and Java components. Eventually, new systems will be pure Java.

Rinaldo: Can you mix C and Java on an embedded target?

David: Yes, but only if your kernel or OS was designed with such support in mind. For example, if a Java component creates a new thread and a C component creates another new thread, the OS must be prepared to handle both threads in a compatible manner. Otherwise, the Java code and C code will end up fighting each other for control, and the system will be a mess.

Summary

I still have many questions that could not be explored because some of the critical information on JavaOS is not complete as of this writing. In future articles I will try to get other industry luminaries to speak and demonstrate some of the following topics:

  • Comparison of performing a real-time critical task with Java, Ada, and C/C++.

  • Lessons to be learned from the ACVC (Ada Compiler Validation Suite).

  • Issues with getting Java accepted as an option for life-threatening systems. It is obviously safer than C++/C (ignoring the runtime), but how would it handle a head to head bake off with Ada (which defines the runtime). Will the reference implementation define the runtime in greater detail or will Solaris threads, Windows 95 threads, Windows NT threads, and JavaOS threads produce five different results?

  • Is the lack of control with the garbage collector a big issue for real-time developers? I understand Microsoft has rewritten the garbage collector for its product in Internet Explorer. Will there be opportunity for Java classes that replace the standard classes? After all, in a real-time system you are not likely to be running productivity apps, or are you? I guess the real question is will the myriad potentially specialized implementations impact portability?

  • How can the Java community deal with tough problems such as:

    • priority inversion
    • quantum schedulers
    • soft real-time
    • hard real-time

The real-time world can be much more dangerous than the Web world, Financial loss is one thing, loss of life is another and we should all realize that Java was not designed for real-time mission-critical environments, yet it has much promise to become a standard in this area.

JavaOS. What is it?

JavaOS is a version of the Java VM that can be ported to target systems without an operating system. Previous versions of Java may have relied on the windowing system or the networking drivers supplied by, letโ€™s say, Solaris or Win95. JavaOS provides itโ€™s own implementations of the networking and windowing libraries. JavaOS is not a traditional OS but rather an OS that runs Java main programs and Java applets only. JavaOS is ideal for companies and individuals interested in porting Java to new platforms with carrying all the baggage of a traditional OS. There is much technical detail on the JavaOS in the following whitepaper and some excellent slides from JavaOne in Acrobat format.

Rinaldo S. DiGiorgio works for Sun Microsystems as a Systems Engineer in the New York City office and provides frequent demonstrations of Java Technology. DiGiorgio is currently working on the integration of many technologies into HotJava/Java. Some of these technologies are database connectivity, portfolio management, low-cost video, and analytical applications in the financial and emerging genetics market. DiGiorgio has been using Unix-based operating systems since 1979, when he was deploying Unix solutions in paper mills. He sees HotJava/Java as the technology to minimize two great cost factors in the computer industry: distribution and code development.