Top Banner
Java for embedded Java for embedded systems systems Felix G. Hamza-Lup
38

Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Dec 23, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Java for embedded systemsJava for embedded systems

Felix G. Hamza-Lup

Page 2: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Outline

• Embedded systems characteristicsEmbedded systems characteristics

• Application domains

• Java characteristics

• Java in embedded systems

• Future trends

• References

Page 3: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Embedded systems

• Real-Time systems– Timing constrains play a critical role in their

design and implementation.

• Have dedicated functionality i.e. designed strictly for a specific set of tasks

• Incorporate relatively low-speed microprocessors and may have a limited amount of memory.

Page 4: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Embedded systems - Inputs

• Random

• Short-lived external signals

• Processor must interrupt whatever else it is doing to capture the data, or it will be lost=>=> embedded programs are organized as a set of

individual, but cooperating threads of execution.

Page 5: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Hardware for embedded applications

• Most embedded systems are housed within a highly-constrained box.– lack of space– excessive vibration

=>=> embedded applications will be structured as a small section of initialization code that starts the programs from a ROM disk

Page 6: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Outline

• Embedded systems characteristics

• Application domainsApplication domains

• Java characteristics

• Java in embedded systems

• Future trends

• References

Page 7: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Embedded systems – applic. domains

• Machine and process control

• Medical instruments

• Data acquisition

• Network components: routers and switches

Page 8: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Less constraints

• Telephony: mobile phones, pagers

• PDAs

Page 9: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Outline

• Embedded systems characteristics

• Application domains

• Java characteristicsJava characteristics

• Java in embedded systems

• Future trends

• References

Page 10: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Characteristics

• Portability – platform independence

• Software reuse – OO

• Simplicity – easy to learn

• Safety and security - JavaTM Authentication and Authorization

Service (JAAS)- JavaTM Cryptography Extension (JCE)- Secure Socket Extension (JSSE)

Page 11: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Some key characteristics

• The key characteristics of Java that make it attractive as a specification language for embedded systems are: – Built in multithreading and synchronization – Lack of pointer arithmetic – Automatic memory management

Page 12: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Outline

• Embedded systems characteristics

• Application domains

• Java characteristics

• Java in embedded systemsJava in embedded systems

• Future trends

• References

Page 13: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Technical challenges for embedded environment

Page 14: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Problems with “Desktop” Java

• Too big: JVM + JIT (just-in-time) compiler+libraries 16 MB

• Too slow: 5 x slower than C code

• No notion of address: most often hardware is accessed referring to a specific address

• Security, portability, dynamic behavior – not needed in embedded systems

Page 15: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Problems with “Desktop” Java

• Java Garbage Collector - collect unused memory

• JCG – dangerous in embedded systems “stop-the-world effect”

• Memory allocation is not fast enough and not predictable

Page 16: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Java embedded: alternatives …

• Special purpose JVM and core libraries

• JVM with JIT compiler

• Compiled JAVA (instead of interpreted)

Page 17: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Special purpose JVM and Frameworks

• Sun’s PersonalJava

• Sun's EmbeddedJava

• JIT – compiler

• J2MicroEdition

• JADE’s LEAP

Page 18: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

PersonalJava

• Re-implements the full set of Java APIs defined by the Java application environment

• Fits into smaller devices with more limited memory configurations

Page 19: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

EmbeddedJava - Goals

• Standardize software development for embedded devices

• Integrate a compact EmbeddedJava application environment directly into new devices

• Small adjustable memory footprint <= Configurable APIs based on application.

Page 20: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

EmbeddedJava - Sun's advanced tools streamline

• JavaFilter - builds a list of the specific fields and methods used by the Java platform to run the Java application

• JavaCodeCompact - optimizes the code by removing unused parts of the platform.

• JavaDataCompact – for linking in auxiliary data files such as HTML, image, and sound files.

Page 21: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Sun's EmbeddedJava Technology

Page 22: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

EmbeddedJava Application Environment

Page 23: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

JIT compiler

Page 24: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

JIT vs. interpreted

Slow

Page 25: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

JVM/JIT compiler & Products

• Dynamic compilation technique using a JIT compiler but tradeoff between:

• performance• memory consumption• startup time

• KAFFE JITKAFFE JIT- one order of magnitude better execution time - one order of magnitude better execution time than Sun's JDK VM than Sun's JDK VM

• SuperCede VMSuperCede VM - performs 58% and 91% faster then JDK - performs 58% and 91% faster then JDK• GuavaGuava by Softway -better than Sun's JDK 1.0.2 VM by Softway -better than Sun's JDK 1.0.2 VM• Microsoft's JVM/JITMicrosoft's JVM/JIT- in Internet Explorer ; PC Magazine, - in Internet Explorer ; PC Magazine,

“is the fastest JVM/JIT for the PC market.” “is the fastest JVM/JIT for the PC market.” • KVMKVM – Kilo Virtual Machine – Kilo Virtual Machine – small code size kernel

Page 26: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Compiled JAVA

• Java native machine language

• Seems to be the current trend

• “Bye, bye”– portability– load new classes on-the-fly

• Best real-time behavior

Page 27: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

J2MicroEdition

• A subset of the Java Standard Edition

• Notion of configuration

Page 28: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

J2MicroEdition

• CDLC config.– 160-512 kB of memory– 16-32 bit processor– network connectivity

• J2ME Wireless Toolkit – debugging capabilities– emulators

Page 29: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

JADE

• Java Agent DEvelopment Framework

• Software framework fully implemented in Java language

• A middle-ware that simplifies the implementation of multi-agent systems

• Complies with the FIPA specifications

Page 30: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

JADE’s LEAP on embedded systems

• Lightweight Extensible Agent Platform

• LEAP is an extension of JADE to enable it to run on wireless devices and PDA's such as cell phones and Palms

• 02/05/02 - LEAP 2.1 has been released

Page 31: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

LEAP Architecture

Page 32: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

LEAP agent communication

Page 33: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Target devices for LEAP

Page 34: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Outline

• Embedded systems characteristics

• Application domains

• Java characteristics

• Java in embedded systems

• Future trendsFuture trends

• References

Page 35: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Trends

• Some constraints are relaxed: more memory, cheaper CPUs …

• Real-time functionality - delivered by OS not by JVM

• Tendency to link Java code with OS proprietary code

• Real-time threads parallel to JAVA threads• New distributed services

Page 36: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

Trends - Real-time threads

Page 37: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

References (1)• http://java.sun.com/products/embeddedjava• “What are the advantages of Java in embedded

systems?” F.Mueller, ECE 2002• “Using Java in Embedded Systems” V.Ivanovic,

M. Mahar, Circuit Cellar, 1999.• “Java on embedded systems” M.Gafen, NSI.com.• “Personal Java – Application Environment

Specification v.1.1.2” 1999.• Embedded systems conferences:

http://www.esconline.com/

Page 38: Java for embedded systems Felix G. Hamza-Lup. Outline Embedded systems characteristicsEmbedded systems characteristics Application domains Java characteristics.

References (2)

• “LEAP: a FIPA platform for mobile and handheld devices” Frederico B., Agostino P.

• “Introduction to Java 2 Micro Edition”, Jeff Brown, OCI (Object Computing Inc)

• JADE: http://sharon.cselt.it/projects/jade/• LEAP: http://leap.crm-paris.com/• FIPA: http://www.fipa.org/