This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
This paper talks about Java and applications for embedded system, and makes differences with others programming languages like Labview or C++. In the beginning, the essay presents what embedded systems are and what Java is. Then, it presents reasons why Java is so appreciated by programmers but what the constraints are imposed by programming for embedded system. Finally, the paper makes a comparison, in term of efficiency and facilities, between Java and others programming languages for these particular systems.
Current programming languages used for embedded systems are mostly C++ and assembler. But there are not very useful because programs are too difficult to understand, and the generated code is not safe. Many of the beneï¬ts of Java, such as safe object references, its portability, have the possiblity to make embedded systems much safer and simpler to program.
The word Java is just a particular language like C or Pascal. Java includes several parts: the high level, the Java language close from C++, Java bytecode, the compiler, and Java Virtual Machine (JVM), a program to run the bytecode programs as input and interprets them.
Java is nowadays a famous programming language used especially for application software or web applications. Its popularity is due to its facility of program with it. It is simpler to write, learn and easier to maintain. But what is the utilization for program embedded system, where often low-level programming is used?
An embedded system is a computer system designed to execute one or some specifics functions often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. In embedded systems, constraints are also defined by the world outside it. So the design and implementation have an important role.
It is a difficult task to make integration of hardware and software components in embedded system design, especially if they are described using different languages. According to , authors say:
"A single language seems more appropriate, and easier of utilization."
So in this paper, the problematic is how a high-level language like Java, can control a system where the hardware part is very important. The aim of this essay is to approach the efficiency and the performance of Java in embedded systems, which begins to be developed and used in this domain. We have to make also the difference comparing these results with the C++ languages, a programming language widely used in this domain.
So first of all, we are going to talk about embedded system, its historic, the different kind of it can exist, its constraints. In this part, we will see also tools that Java can purpose to control this sort of system. In the second part, we will make comparisons between Java and others programming language for embedded system, in term of efficiency, performance, facility of utilization.
Embedded systems, categories, constraints
To begin, we have to describe what an embedded system is, make a quick historic of embedded system, with its evolution in term of design, development, but also in use.
The first applications of embedded systems were in the 1960s for only calculators. Since performance and efficiency have been multiply, and applications also. Instead prices have come down.
According József Tick in :
"Embedded systems have a small size, and are independent systems built on microcomputers, which control different devices."
They have dedicated functionality that means designed strictly for a specific set of tasks. We meet them in cell phone, cars, watches, but also routers, switches, and lots of different kinds of products. Like they have small sized, they integrate low-speed microprocessors and may have a limited resource of memory.
Constraints are imposed by many reasons for this system. Indeed, as seeing above, they are small, and they have to be performing. Moreover, many embedded systems are in real-time, operating at speeds imposed by their external environments and users, and have to be sure and predictable. Consequently, embedded systems should behave deterministically, and operate within limited resources, including time and memory. Like summarizing by József Tick in :
"The real-time control requires a correct and exact handling of multitasking"
Java, tools and properties
Java is a very useful and appreciated programming language. Indeed, lots of its characteristics are very appreciated by programmers, like simplicity (easy to learn) or software reuse (thanks to the object-oriented programming). Among these characteristics are interesting for using in embedded real-time systems, like built in multithreading and synchronization, automatic memory management, portability.
However, tools to control embedded systems with Java had to be created. Indeed, the main Java has some disadvantages. It is too big, and to slow comparing with the C code (five times faster than Java code). This Java does not have either a notion of address, which is often used to access to devices. At last, the "Java Garbage Collector", a tool allowing collecting unused memory, is a problem for the small memory size of embedded system.
So, tools were developed to allow using Java for embedded systems. We are going to presented them and also their advantages and disadvantages.
The first of all is the more common compiler used, the Java Virtual Machine (JVM). But like saying in  by Michel Barr:
"In an embedded system, JVM is essentially a set of threads that execute on top of real-time operating system (RTOS)"
Other compilers exist called JIT (Just-In Time) compilers. These one compile bytecode during execution. However, as Vincent Perrier says in :
"They produce excellent performance improvements in desktop Java applications but typically require 16 to 32 MB of RAM in addition to the application's requirements. The large memory requirement places JIT compilers out of reach for many categories of embedded applications."
So, they are not adapted for embedded systems, which have not a large memory available.
An interesting tool by Java is the edition Java 2 Platform, Micro Edition (J2ME). This one decreases the function of JVM to allow making implementation easier on smaller processor. J2ME has three principles. The first is just the JVM like in all Java implementation. The second one is the conï¬guration that deï¬nes the minimum set of JVM characteristics, but also Java class libraries available following a category of devices. The third one is the proï¬le, which determinates the smallest number of Application Programming Interfaces (APIs) accessible on a particular family of devices.
Another tool developed for real-time embedded systems, is Java Optimized Processor (JOP). This one is a hardware implementation of the JVM with predictable execution time for embedded real-time systems. According to the author, Martin Schöberl in :
"JOP is intended for applications in embedded real-time systems"
Nowadays, Sun, the java developer, created for the Standard Edition (SE), Java Embedded. This one allows having properties and advantages of Java programming to construct and design programs in embedded systems.
There are still others Java systems used in embedded systems, but we do not speak about them in this essay. We focus on the three lasts presented above (J2ME, JOP, and Java Embedded).
In this part, we will see the results about Java used in embedded system. After, we will make the difference with language C and the software Labview, about efficiency but also facility of utilization.
Efficiency of Java in embedded system
As we saw in the previous part, Java is very used for various tasks in different domains.
For the technology JOP, first of all, the core and the memory only take 50Kb. In , the author says:
"The average performance of JOP is a little bit better than a JIT-compiler solution on an embedded system"
So this tool improved the performance of Java in embedded system. Generally, this processor is more efficient than others embedded Java systems in terms of execution time, reaction speed.
The J2ME tool is a subset of the Java Standard Edition. He has 160-512 kB of memory, a 16-32 bit processor, and has network connectivity. It is usually used for the cell phone, where devices are with limitations on resources. Unlike, J2ME is a platform from Sun; it is not a processor like JOP. But thanks to it, Java's efficiency is improved for embedded system.
Java Embedded is free to develop system but if you want to deploy your application, you have to pay royalties. You just need 32MB of RAM and 32 MB of ROM to install this platform Java according to the Oracle's website . Thanks to the JIT compilation, you can optimize generated code and improve your system. This application is mostly used for systems that have enough memory.
Comparisons with Labview and C++
Labview is software from the company National Instrument created in 1986. The Labview's particularity is that it is a graphical language, that means users manipulates program elements graphically. It is very used in the instrumentation field because thanks to it, it is very simple and quick to interface devices.
Labview is very useful, and it is easy to learn. However, it requires lots of memory to use it. Moreover for embedded system, National Instrument has developed a module called Labview real-time. This one allows programming easily interfaces for these kinds of system. But often, you have to buy hardware module to control or measure devices, and prices are expensive.
C++ is one of the most popular programming languages, and is very used in software industry. It has been used in the domain of embedded systems. Like Java, C++ is an object-oriented language programming. However, C++ is a middle-level programming language that means it is more difficult to learn the language completely. Moreover, comparing to Java, C++ is not safe, it can generate unexpected code, which are difficult to avoid.
So to solve these problems, Embedded C++ has been created. This is a proper subset of C++. It has been invented in the aim to preserve the useful of C++, reduce code size and increase execution efficiency. According to the website :
"The goal of EC++ is to provide embedded systems programmers with a subset of C++ that is easy for the average C programmer to understand and use"
Nevertheless, this particular language is not very used in the software industry. Indeed, as you can see on the website, it has not been updated since 2002.
So, at the beginning of programming for embedded systems, Java was not very used for it. Indeed, its high-level, the fact it was too slow or too big to this kind of systems where memory, execution speed constraints are very important. So others programming languages were used like C/C++.
However, some properties of Java were interesting to be used, like the portability, the simplicity to learn, the safety and the security. So Sun, the Java developers created tools to facilitate utilization of Java in embedded system.
Nowadays, environments constraints in embedded systems have evolved. Memories size has increased while their dimensions have decreased. Processors are more efficient and faster.
The last Java platform SE (Standard Edition) to control embedded system called Java Embedded seems very useful and complete to program embedded system, if enough memory is available. Nevertheless, others languages programming exist and the choice of it depends of the embedded system's properties. Indeed, their types are very various, and they have to have different execution speed or size memory in function of their applications.
After presenting needs for embedded systems, the introduction presents what Java is and why it is so popular and finally what constraints are in this domain. In the background part, the essay talks about particulars requirements for this kind of programming, and what the advantages are to do it with Java, and mostly tools developed by Sun. In the next part, the argument makes a comparison between Java and others programming languages, like C++ or Labview, also used in this particular field. Finally, the conclusion finishes in presenting the advanced in embedded systems.