Download Java for embedded systems

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java for embedded systems
Felix G. Hamza-Lup
Outline
•
•
•
•
•
•
Embedded systems characteristics
Application domains
Java characteristics
Java in embedded systems
Future trends
References
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.
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.
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
Outline
•
•
•
•
•
•
Embedded systems characteristics
Application domains
Java characteristics
Java in embedded systems
Future trends
References
Embedded systems – applic. domains
•
•
•
•
Machine and process control
Medical instruments
Data acquisition
Network components: routers and switches
Less constraints
• Telephony: mobile phones, pagers
• PDAs
Outline
•
•
•
•
•
•
Embedded systems characteristics
Application domains
Java characteristics
Java in embedded systems
Future trends
References
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)
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
Outline
•
•
•
•
•
•
Embedded systems characteristics
Application domains
Java characteristics
Java in embedded systems
Future trends
References
Technical challenges for embedded environment
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
Problems with “Desktop” Java
• Java Garbage Collector - collect unused memory
• JCG – dangerous in embedded systems “stop-theworld effect”
• Memory allocation is not fast enough and not
predictable
Java embedded: alternatives …
• Special purpose JVM and core libraries
• JVM with JIT compiler
• Compiled JAVA (instead of interpreted)
Special purpose JVM and Frameworks
•
•
•
•
•
Sun’s PersonalJava
Sun's EmbeddedJava
JIT – compiler
J2MicroEdition
JADE’s LEAP
PersonalJava
• Re-implements the full set of Java APIs defined by
the Java application environment
• Fits into smaller devices with more limited
memory configurations
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.
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.
Sun's EmbeddedJava Technology
EmbeddedJava Application Environment
JIT compiler
JIT vs. interpreted
Slow
JVM/JIT compiler & Products
• Dynamic compilation technique using a JIT
compiler but tradeoff between:
• performance
• memory consumption
• startup time
• KAFFE JIT- one order of magnitude better execution time
than Sun's JDK VM
• SuperCede VM - performs 58% and 91% faster then JDK
• Guava by Softway -better than Sun's JDK 1.0.2 VM
• Microsoft's JVM/JIT- in Internet Explorer ; PC Magazine,
“is the fastest JVM/JIT for the PC market.”
• KVM – Kilo Virtual Machine – small code size kernel
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
J2MicroEdition
• A subset of the Java Standard Edition
• Notion of configuration
J2MicroEdition
• CDLC config.
– 160-512 kB of memory
– 16-32 bit processor
– network connectivity
• J2ME Wireless Toolkit
– debugging capabilities
– emulators
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
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
LEAP Architecture
LEAP agent communication
Target devices for LEAP
Outline
•
•
•
•
•
•
Embedded systems characteristics
Application domains
Java characteristics
Java in embedded systems
Future trends
References
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
Trends - Real-time threads
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/
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/