Sign up & Download
Sign in

Darjeeling, a Java compatible virtual machine for microcontrollers

by Niels Brouwers, Peter Corke, Koen Langendoen
Proceedings of the ACMIFIPUSENIX international middleware conference companion on Middleware 08 Companion Companion 08 (2008)

Abstract

The Java programming language enjoys widespread popularity on platforms ranging from servers to mobile phones. While efforts have been made to run Java on microcontroller platforms, there is currently no feature-rich, open source virtual machine available. In this paper we present Darjeeling, a system comprising offline tools and a memory efficient runtime. The offline post-compiler tool analyzes, links and consolidates Java class files into loadable modules. The runtime implements a modified Java VM that supports multithreading and is designed specifically to operate in constrained execution environments such as wireless sensor network nodes. Darjeeling improves upon existing work by supporting inheritance, threads, garbage collection, and loadable modules while keeping memory usage to a minimum. We have demonstrated Java running on AVR128 and MSP430 microcontrollers at speeds of up to 70,000 JVM instructions per second.

Author-supplied keywords

Cite this document (BETA)

Available from portal.acm.org
Page 1
hidden

Darjeeling, a Java compatible virtual machine for microcontrollers

Darjeeling, a Java Compatible Virtual Machine for
Microcontrollers
Niels Brouwers
Delft University of Technology
The Netherlands
n.brouwers@student.tudelft.nl
Peter Corke
Autonomous Systems Laboratory
CSIRO ICT Centre, Australia.
peter.corke@csiro.au
Koen Langendoen
Delft University of Technology
The Netherlands
k.g.langendoen@tudelft.nl
ABSTRACT
The Java programming language enjoys widespread popu-
larity on platforms ranging from servers to mobile phones.
While efforts have been made to run Java on microcontroller
platforms, there is currently no feature-rich, open source vir-
tual machine available. In this paper we present Darjeeling,
a system comprising offline tools and a memory efficient run-
time. The offline post-compiler tool analyzes, links and con-
solidates Java class files into loadable modules. The runtime
implements a modified Java VM that supports multithread-
ing and is designed specifically to operate in constrained exe-
cution environments such as wireless sensor network nodes.
Darjeeling improves upon existing work by supporting in-
heritance, threads, garbage collection, and loadable mod-
ules while keeping memory usage to a minimum. We have
demonstrated Java running on AVR128 and MSP430 micro-
controllers at speeds of up to 70,000 JVM instructions per
second.
Categories and Subject Descriptors
D.1.5 [Object-oriented Programming]: Miscellaneous
General Terms
Languages
Keywords
Java, Sensor Networks
1. INTRODUCTION
Virtual machines (VMs) are a well known and powerful
means of abstracting underlying computer hardware from
an application, allowing portability across platforms without
recompilation. A VM is an abstract machine for which code
is compiled, and the run-time interpreter for the VM code
is written specifically for each platform. The best known
example is the Java language and the Java VM (JVM) but
Permission to make digital or hard copies of all or part of this work for
personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that copies
bear this notice and the full citation on the first page. To copy otherwise, to
republish, to post on servers or to redistribute to lists, requires prior specific
permission and/or a fee.
Middleware ’08 Companion, December 1-5, 2008 Leuven, Belgium
Copyright 2008 ACM 978-1-60558-369-3/08/12 ...$5.00.
VMs also underpin many other common software systems,
for example Microsoft’s .NET, Python and Perl.
Virtual machines provide a means of overcoming the chal-
lenges of fault tolerance, cost and heterogeneity. Low-cost
embedded systems often have no user interface and are de-
ployed in remote or dangerous areas so must run auton-
omously throughout their complete lifetime, i.e. for sev-
eral years. Microcontrollers lack advanced features such
as a memory management unit and a single faulty process
can potentially take down the entire software system. Vir-
tual machines help to alleviate these problems by providing
strong checking, memory management and error handling
services that improve robustness and allow software faults
to be handled appropriately before they become failures.
The total cost of ownership includes not only the price
of hardware, but also other costs such as software devel-
opment, software and hardware maintenance, testing and
cost of failures. Virtual machines may help to cut costs in
the areas of software development and testing. This effect
can be attributed to a number of factors, such as increased
maintainability and productivity [2].
Large systems deployed for long periods of time eventu-
ally face the problem of obsolescence. Virtual machines al-
low elements of the system to be replaced with different
computation hardware yet still be able to run the original
applications and relieve programmers from having to deal
with this diversity. A virtual machine solves this problem
by providing one execution model that is universal to all
node platforms. This is illustrated by the success of Java in
the mobile phone market [13].
Growing interest in Java virtual machines for embedded
applications, including Wireless Sensor Networks (WSNs),
reflected by recent efforts like [14, 7], shows a need for a
more flexible and accessible programming abstraction. At
the time of writing Java is one of the most popular program-
ming languages [19]. This gives Java a significant advantage
over other alternatives in terms of accessibility, integration
with other network components and availability of tools such
as IDEs and compilers, not to mention programmers.
On the technical side, the execution model of a Java vir-
tual machine has numerous advantages over native code.
Stack frames are allocated on the heap in an ad-hoc man-
ner so threads can be very light-weight. The Java language
and its compiler guarantee type safety, and common pro-
gramming errors such as buffer overflows and null pointers
are caught at runtime. Unreachable memory is automat-
ically reclaimed by the garbage collector, greatly reducing
memory leaks.
18

Sign up today - FREE

Mendeley saves you time finding and organizing research. Learn more

  • All your research in one place
  • Add and import papers easily
  • Access it anywhere, anytime

Start using Mendeley in seconds!

Already have an account? Sign in

Readership Statistics

9 Readers on Mendeley
by Discipline
 
 
 
by Academic Status
 
33% Student (Master)
 
33% Ph.D. Student
 
22% Post Doc
by Country
 
22% Brazil
 
11% Italy
 
11% Sweden

Groups

pool