20/06/2011

SCJ Checker : A new release, v2.0

We have just released a new version of the Safety-Critical Java Annotations Checker. The checker introduces an improved checking of memory-safety annotations along with a lot of other improvements and bug-fixes.

Along with the Checker, we have produced a short tutorial [PDF],  the document contains:
  • Checker installation and running instructions, 
  • the essential concepts and ideas behind the annotation system, 
  • various examples to illustrate the basic features of all the annotations, 
  • the key restrictions and rules enforced by the annotation system. 

The document is written with the motivation to give the reader the basic understanding of programming SCJ applications with the annotations.

27/05/2011

Safety-Critical Java Case Studies

We have recently put together a set of Safety-Critical Java applications. The implementation of these applications is open source, you can find them in our oSCJ repository, in directories oSCJ/examples and oSCJ/tools/checker/examples. The directories now contain more than 3O KLOC of Safety-Critical Java application code, here is a description of the most interesting case studies:

Quicksort is benchmark based on the quicksort algorithm. The application periodically sorts an array of objects that are allocated in an upper-scope, thus introducing a cross-scope manipulation of objects into the algorithm.

Thruster case-study simulates a spacecraft thruster engine. Control of the engine requires a 100-millisecond periodic activity to adjust the valve settings to avoid mechanical drift and, therefore, obtain an even fuel flow. Inspired by [Wellings-JTRES10].

Fast-MD5 implements a periodic execution of the Fast-MD5 encryption algorithm of a fixed string within its most inner memory area.

Webserver is an application handling http requests and was developed as a case study within the SquawkVM project to evaluate SCJ implementation running on SUN SPOTS embedded devices.

CDx-SCJ is an open-source family of benchmarks that can be used to measure performance of various hard and soft real-time platforms. The CDx benchmark consists of a periodic task that takes air traffic radar frames as input and predicts potential collisions.

Railsegment, developed by Kelvin Nilsen at Atego, is a complex simulator of a train control software that is responsible for collecting the data about speed and position of the train, analyzing them in real-time and adjusting the train speed according to the route plan.

Jpapabench is a SCJ benchmark based on the Paparazzi project which provides an open-source implementation of an autopilot for unmanned aerial vehicles (UAVs). The autopilot has been successfully tested on several real devices. The JPapabench is developed by Michal Malohlava at MFF UK, see the JPapabench webpage.

We believe that these applications are a representative set of SCJ case studies that demonstrate many SCJ concepts on real examples. 

02/05/2011

A family of real-time Java benchmarks

Be sure not to miss a new publication on the Collision Detector (CDx) benchmark [PDF]. Tomas Kalibera and his team put together an updated journal publication on CDx.

The article also reports on our performance comparison of the oSCJ platform running on LEON3 boards. Although the paper reports 50% overhead of the oSCJ in comparison to the C version of the benchmark, we are happy to announce that in the last few months we have been able to further decrease the overhead to ~28%.

The figure shows are new measurement of the improved performance of oSCJ. Further, our most recent experiments suggest that we can do even better. Stay tuned.

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.

13/02/2011

Safety-Critical Java Specification : First Draft Released

The moment we all have been waiting for is here.

The first public version of the Safety-Critical Java Specification (JSR-302) was released. The draft can be downloaded from JSR-302 webpage, go to the Download Section.

To make a good picture of what SCJ is about, read the first two chapters. And if you want to know what we have been contributing to, read the Chapter 9 : Java Metadata Annotations.

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/

03/11/2010

October Reading List

The list of papers, books, and other articles that caught my attention during the last month.

Papers:
Books:
Others: