Showing posts with label RTSJ. Show all posts
Showing posts with label RTSJ. Show all posts

19/04/2011

JPapaBench : A new benchmark was born.

A new real-time Java benchmark - JPapabench, was developed by a team lead by Michal Malohlava at Charles University in Prague.

The most exciting facts about this benchmark are:
  • jPapabench is based on the Paparazi project which provides an actual implementation of an unmanned aerial vehicles (UAV) autopilot. Therefore, the benchmark is trully reflecting an autopilot software that is used in real life UAVs.
  • JPapabench is available in several versions: regular Java, Real-time Java, and Safety-Critical Java.
  • the project is open-source and available at http://code.google.com/p/jpapabench/.
Enjoy.

Paparazi project screenshot.

08/11/2010

Real-Time Java HelloWorld

Are you starting with Real-time Java and don't know where to look first? Here is a step-by-step tutorial showing you how to install and run simple RT Java programs.

1. Install Real-time Java VM
There is a bunch of RT VMs that you can donwload and use but perhaps the one that is the easiest to install and to play with is Oracle's Java RTS. The current version is Java RTS 2.2. After filling the download form, you should be able to download it to your desktop. The name of the donwloaded file will be something like :  java_rts-2_2-fcs-bin-b19-linux-i586-eval_academic.zip

1.0 Requirements
  • RT Linux - if you want to really run with real-time priorities. However, for starting and learning how to work with RT VMs, a regular linux should do - try eg. Ubuntu or Fedora OS.
1.1  Install the RTJ VM
untar downloaded distributable into /opt/jrts2.2 directory. Let's call it RTJAVA_HOME.
$ export RTJAVA_HOME=/opt/jrts2.2/

For more details, see SUN Java RTS Technical Documentation. Java RTS is distributed under restricted academic license that expires after 365 days but don't worry, you can just dowload a new distribution and re-install it.

1.2. Verify the Installation
Type:
$ $RTJAVA_HOME/bin/java -version
You should see:
java version "1.5.0_20"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20_Java-RTS-2.2_fcs-b19_RTSJ-1.0.2)
Java Real-Time System HotSpot(TM) 64-Bit Client VM (build 1.5.0_20-b19, mixed mode)

In case you are not running in a real-time environment or your linux does not have the rt-kernel extensions, you will also see the following warning:
Java Real-Time System HotSpot(TM) 64-Bit Client VM warning: Unable to lock pages into memory: insufficient privileges
Java Real-Time System HotSpot(TM) 64-Bit Client VM warning: Cannot use the real-time scheduling class.
You can safely ignore this one for testing RTSJ.

1.3. A missing libcap.so problem
However, a problem can occur when running the "./bin/java" on some systems:
$RTJAVA_HOME/bin/java -version
dl failure on line 824Error: failed /opt/sunrts-2.2/jre/lib/i386/server/libjvm.so,
because libcap.so.1: cannot open shared object file: No such file or directory
This happened to me both on Ubuntu and Fedora OS. There is a detailed description of this problem here (as it appears, I was the first person to identify this issue).

Solution to the missing libcap.so.1 lib is to locate a libcap.so.2 and rename it as libcap.so.1
$ locate libcap.so.2
$ sudo cp /lib/libcap.so.2 /lib/libcap.so.1 


2. Runnig a Real-time HelloWorld program
Now we can finally run some real-time Java code. A classical real-time Java hello world example is below:
import javax.realtime.RealtimeThread;

public class HelloRealtimeWorld extends RealtimeThread {

    String message;

    public void run(){
      message = "Hello Realtime World";
    }
   
    public static void main(String args[]){
      HelloRealtimeWorld thread = new HelloRealtimeWorld();
      thread.start();
      try{
        thread.join();
      } catch(InterruptedException ie){
        System.err.println("got interrupted");
        return;
      }
      System.out.println(thread.message);
    }
}

To compile the Real-Time HelloWorld class:
$ $RTJAVA_HOME/bin/javac -classpath $RTJAVA_HOME/jre/lib/rt2.jar 
-d build/  HelloRealtimeWorld.java 

And, to run:
$ $RTJAVA_HOME/bin/java -cp build/ HelloRealtimeWorld
Hello Realtime World! 

And we are done!

Further resources on RT Java:
Further blog-post on the same topic:
  • http://viswanathj.wordpress.com/2011/04/09/installing-java-rts-on-ubuntu-2/

22/09/2009

A Component Framework for RTSJ

The following slides are presenting SOLEIL - a component framework for RTSJ-based systems.

These slides were used also during my PhD defense:

27/08/2009

A PhD thesis about RTSJ

My PhD thesis focused on RTSJ is titled:

SOLEIL : An Integrated Approach for Designing and Developing Component-based Real-time Java Systems

The defense of this thesis will take plate at INRIA Lille, France on September 14, 1:30 pm. Visitors are welcomed.

The thesis can be downloaded from: SOLEIL thesis download.

24/08/2009

A New Real-time Java Book

Recently, a new book about RTSJ has been published:

book

Real-Time Java™ Programming with Java RTS

by Eric J. Bruno; Greg Bollella, Prentice Hall, 2009

Read it online here.

06/08/2009

JTRES’09 Workshop

“This is the place to be.”      

Greg Bollella

JTRES is a workshop of Java Technologies for Real-Time and Embedded Systems. Annually, RTSJ professionals, researchers and fans are meeting to discuss, exchange…

We will be there too, presenting our CDx paper - an open-source RTSJ benchmark.

This year in Madrid, Spain. See more at JTRES Home Page.

07/07/2009

CDx : A Family of Real-time Java Benchmarks

Collision Detector (CDx) is our new open-source Real-time Java
benchmark.
The key features of the CDx benchmark are:
  • the first open-source RTSJ benchmark,
  • highly configurable for different VMs,
  • provides various workflows,
  • a large case study suitable for learning and experimenting with RTSJ.
Find more at our new webpage presenting CDx:

30/06/2009

Real-time Java VMs

Although real-time Java is becoming well known, the specific Virtual Machines implementing its functionalities are still known only to the community. There is no list of VMs supporting real-time features, furthermore, every VM is implementing a different subset of RTSJ. 
Therefore, I am posting a list of RTSJ-compatible VMs that are available up to this date (sorted by first release date).
  • TimeSys RTSJ Reference Implementation Only licensed for non-commercial use. Runs on X86/Linux. Available at www.timesys.com.
  • Java RTS Sun - Java SE Real-time (Java RTS). Runs on Sparc/Solaris (Beta for SUSE Linux Enterprise Realtime 10, and Red Hat Enterprise MRG 1.0.). Available at http://java.sun.com/javase/technologies/realtime/rts/.
  • IBM WebSphere Real Time. IBM WebSphere Real Time V2 for Real Time Linux, running on main-line real-time Linux distributions (Red Hat MRG and Novell SLERT). However, there are limitations on the hardware supported. The main reason for the hardware limitation is that the supported models have modified firmware to allow better control over SMI event prioritization, in order to achieve determinism of the underlying hardware. Availale at www.ibm.com/software/webservers/realtime/.
Furthermore, other real-time, Java-like platforms have been developed, either commercial or academic projects. Usually, these VMs are not fully compliant with RTSJ.
  • OVM is an academia research project at Purdue University that implements RT VM. Available at http://www.ovmj.org
  • JamaicaVM implements RTSJ and a deterministic garbage collector. Runs on various platforms. Available at http://www.aicas.com/jamaica.html.
  • jRate (Java Real-Time Extension) is an extension of the GNU GCJ compiler front-end and runtime system which adds support for most of the features required by the RTSJ. Available at http://jrate.sourceforge.net/.
  • Aonix PERC is a commercial project targeting many hard real-time, safety critical and embedded systems. The PERC platform is introducing many trade-offs and therefore is not fully compliant with RTSJ, however, allows developers to target a broader scope of applications rather than having strict limitations as it is the case of RTSJ. Available at www.aonix.com/perc.
  • aJ100 is a hardware coded JVM. Available at www.ajile.com.
  • JRockit Real-Time JRockit Enterprise Java Runtime provided by ORACLE is a Java VM featuring real-time garbage collection suitable for soft real-time systems. Available at www.oracle.com/jrockit.
  • IBM/Apogee Aphelion is comprised of reliable and high performance JREs for deploying Java applications on devices based on embedded systems. Supports many OS platforms, further details at http://www.apogee.com/
  • [UPDATE: 07/2011] LJRT - Lund Java based Real-Time, http://www.robot.lth.se/java
  • [UPDATE: 07/2011] FijiVM - FijiVM, http://www.fiji-systems.com/, more also at this post.
Source: Real-time Java programming book, discussions in the Real-time Java Group.
Please, let me know if there is any VM missing in this list.