Real-time Systems Laboratory at Virginia Tech


About


ChronOS is an implementation of distributable threads in the Linux kernel, as a first-class abstraction for programming and scheduling real-time, multi-node sequential behaviors. Distributable threads first appeared in the Alpha distributed real-time OS kernel, subsequently in Mach 3.0 (a subset), and constitute the first-class programming and scheduling abstraction of the Real-Time CORBA (Dynamic Scheduling) Specification.

ChronOS provides APIs for programming with distributable threads (similar to that of Real-Time CORBA), algorithms for the real-time scheduling of distributable threads, a framework for plugging-in application-specific real-time schedulers for scheduling distributable threads, and time-critical protocols for ensuring distributable thread integrity in the presence of failures.

Back to top

Version


The current version of ChronOS is version 9.06. This is a Beta release.

The version scheme is derived from Ubuntu (year.month). ChronOS is based on Linux kernel 2.6.24.7 and the real-time linux patch 2.6.24.7.rt27 (CONFIG_PREEMPT_RT).

ChronOS currently supports Real-Time CORBA's Case 2 scheduling model and contains the following algorithms for scheduling distributable threads:
  • Fixed priority (RMS)
  • Earliest deadline first (EDF)
  • Dependent activity scheduling algorithm (DASA)
  • Locke's best-effort scheduling algorithm (LBESA)
DASA and LBESA are described in Clark's PhD thesis and Locke's PhD thesis (CS Department, CMU), respectively.

ChronOS contains the following distributable thread integrity protocols:
  • Thread Polling with Bounded Recovery (TPR)
  • Decentralized Thread Polling with Bounded Recovery (D-TPR)
TPR and D-TPR protocols are described in Curley's MS thesis (ECE Department, Virginia Tech).

Back to top

Download


ChronOS is available under GNU General Public License (GPL version 2). The current release (version 9.06) is available as a patch to Linux kernel 2.6.24.7. ChronOS consists of the following:
  1. Kernel patch that includes our modifications to the linux kernel to include distributable thread implementation at the kernel-level, thread managment components, and real-time scheduling.
  2. A middleware service that enables distributed communication between different nodes for intra-distributable thread communication.
  3. A middleware library libdt.so that provides user-level APIs for programming distributable threads.

Kernel

The ChronOS version 9.06 kernel patch can be downloaded from here

Middleware

The ChronOS version 9.06 middleware can be downloaded from here

Back to top

Installation


Kernel 

ChronOS version 9.06 is based on kernel 2.6.24.7 and real-time kernel patch 2.6.24.7-rt27.
  1. Click here to download the 2.6.24.7 kernel from kernel.org
  2. Click here to download the 2.6.24.7 real-time patch from kernel.org
Download the kernel into a folder, let's call it /home/<username>/tmp. Extract the kernel.

$ cd /home/<username>/tmp
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.7.tar.bz2
$ tar xjvf linux-2.6.24.7.tar.bz2

Rename the kernel to linux-2.6.24.7-rt27

$ mv linux-2.6.24.7 linux-2.6.24.7-rt27

Download the CONFIG_PREEMPT_RT patch and move it inside the kernel directory, and patch the kernel.

$ wget http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.24.7-rt27.bz2

# Move the patch inside the kernel folder.
$ mv patch-2.6.24.7-rt27.bz2 /home/<username>/tmp/linux-2.6.24.7-rt27

$ bzcat ./patch-2.6.24.7-rt27.bz2 | patch -p1

Download the ChronOS ver 9.06 kernel patch as described in the download section put it inside the kernel folder. 

$ mv chronos-9.06-patch.tar.gz /home/<username>/tmp/linux-2.6.24.7-rt27
$ tar zxvf chronos-9.06-patch.tar.gz

Compiling the kernel

Install the build essentials. 

$ sudo apt-get install build-essential libncurses5 libncurses5-dev

The kernel should compile fine with gcc-4.3. If you get any errors with that, you can install gcc-3.4 and create a symbolic link to it. [optional]

$ sudo apt-get install gcc-3.4
$ sudo ln -s /usr/bin/gcc-3.4 /usr/bin/gcc


Rename the kernel to chronos-9.06

$ mv linux-2.6.24.7-rt27 chronos-9.06

Go to the patched ChronOS kernel:

$ cd /home/<username>/tmp/chronos-9.06
$ make menuconfig

The kernel configuration menu would now come up:
  1. In the "Processor type and features menu," make sure that "Symmetric Multi-processing support" is unchecked. (ChronOS currently does not support multiprocessors; multiprocessor support will be included in a future release.)
  2. In the "Preemption Mode" menu, make sure that it is set to "Complete preemption (Real-time)"
Exit the menu and save the configuration file .config

$ make

NOTE: If you have more than one core, make sure that you use the make -j option instead. You can:

$ make -j2

Once the kernel is compiled, install the modules into /lib/modules:

$ sudo make modules_install

Installing the kernel

Once the kernel is compiled, install the kernel:

$ cd /home/<username>/tmp/chronos-9.06

$ sudo cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24.7-chronos-9.06
$ sudo cp System.map /boot/System.map-2.6.24.7-chronos-9.06
$ sudo cp .config /boot/config-2.6.24.7-chronos-9.06

$ sudo update-initramfs -c -k 2.6.24.7-
chronos-9.06
$ sudo update-grub

ChronOS version 9.06 is installed.

Middleware and library

Download the ChronOS middleware source code package. Create a folder. Let's call it /home/<username>/middleware. Compile the middleware service and the library:

$ cd /home/<username>/middleware
$ wget https://filebox.vt.edu/users/piyushg/chronos-9.06/chronos-9.06-middleware.tar.gz
$ tar xzvf chronos-9.06-middleware.tar.gz
$ cd chronos-9.06-middleware/middleware
$ make 
$ sudo make install

The libraries and the headers are installed in /usr/local/chronos/lib and /usr/local/chronos/include respectively, while the middleware engine dtengine is installed in /usr/local/chronos/bin.

To clean the middleware use:

$ make clean

To un-install the middleware use:

$ sudo make uninstall

NOTE: By uninstalling the middleware all the contents of /usr/local/chronos/ are deleted.

Installing the remote services

The documentation section describes in detail about creating a remote service and the configuration file. A sample service is provided inside the middleware package that was downloaded in the last step.

$ cd chronos-9.06-middleware/service
$ make 
$ sudo make install

NOTE: dtengine depends on the dtservice.conf and would fail if the configuration file is not present. 

Starting dtengine

dtengine uses the underlying network connection. However, on machines which have more than one interface (eth0\eth1), dtengine must be told which interfaces are being used for distributable threads. ChronOS would then use those interfaces to communicate with other nodes.

IMPORTANT: Before starting dtengine, make sure that the following exports are also set:

$ export PATH=/usr/local/chronos/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/chronos/lib

# set the network interface (eth0 or eth1)
$ export DT_ETH_PORT=<interface>

These can be added to the .bashrc to avoid setting these every time:

$ cd ~
$ vi .bashrc
# Add the exports to the end of the .bashrc file

Start the middleware engine:

# confirm dtengine is on the path
$ which dtengine
  /usr/local/chronos/bin/dtengine

# start the dtengine
# dtengine

NOTE:
  • In ChronOS 9.06, the middleware has not been patched into /etc/init.d services. Hence, the middleware needs to be started manually after every reboot. This would be made into a service in future stable releases.
  • In the current version of ChronOS, only eth0 and eth1 are supported. A more generic version would be available in future releases.

Back to top

Documentation


ChronOS architectural stack

ChronOS stack

The middleware consists of the dtengine and a library called libdt.so. The dtengine acts like a background service which takes care of remote calls from other nodes for invoking services through the portable interceptor (PI). 

In order to use distributable threads, you need to install ChronOS on a minimum of two nodes. Each node would host a set of "services" that can be called by a distributable thread starting from one node. A service is essentially a method (i.e., a procedure or a function) that can be remotely invoked as part of a distributable thread.

Creating (remote) services

The set of services (or methods) is kept in a library file that other nodes (i.e., machines running ChronOS) can remotely invoke as part of distributable threads. An example of a service library file looks like as follows:

#include "dtapi.h"

int node1_service1 (dt_handle_t* handle, void *args)
{  
     /* service code */
     return 0;
}

int node1_service2 (dt_handle_t* handle, void *args)
{
    /* service code */
    return 0;
}

The service library file must be kept in /usr/local/chronos/lib/.

The services need to be described in a configuration file called /usr/local/chronos/conf/dtservice.conf. The dtservice.conf file has the required information about the service:

; This is a config file

NAME /usr/local/chronos/lib/libservice.so.1.0.1
TSER 2
FUNC node1_service1 node1_service2
ENDS


The configuration file has the following details:
NAME, the name of the service that has the services or methods being hosted on the node.
TSER, the total number of methods in the service
FUNC, the name of the methods
ENDS, the end of the section.

NOTE: Currently, in ChronOS version 9.06, the name and path of the configuration file is hard-coded and can't be changed and should be  /usr/local/chronos/conf/dtservice.conf.

ChronOS runs a dt-nameserver inside the kernel which receives information about the location of the services from other nodes. When the middleware is started on each node, it broadcasts the services to all other nodes. In the current beta version of ChronOS, the middleware needs to be restarted every time the services/methods are changed or updated so that the information is broadcast to every other node.

A sample service along with a Makefile is available inside the chronos-9.06-middleware.tar.gz .

APIs and System calls

The libdt.so provides the APIs that can be used for programming with distributable threads:

int dt_spawn (dt_handle_t *handle, void (*function)(dt_handle_t*, void*), void *args);
int dt_remote_invoke (dt_handle_t*, const char *name, void *args);

The header file /usr/local/chronos/include/dtapi.h contains the function prototypes and data structures.

Documentation about the middleware and how to create a test application can be downloaded here.

dt_cancel, dt_pause, and real-time scheduling functions are available but these are not fully functional in the current beta release. These would be available in the future release.

Documentation about dt_cancel and dt_pause are available here: user's guide and programmer's guide

Documentation about real-time scheduling algorithms implemented in ChronOS and how they can be extended can be downloaded here.

Documentation about thread integrity protocols implemented in ChronOS are available here: user's guide and overview.

Back to top

Publications


Distributable threads

Distributable thread middleware

Distributable thread integrity protocols

Distributable thread scheduling

Back to top

People


The ChronOS project is led by Prof. Binoy Ravindran at Virginia Tech.

Students of Virginia Tech's Real-Time Systems Laboratory are leading different aspects of the implementation effort:
  • Matthew Dellinger
  • Piyush Garyali
  • Caleb Hopkins
  • Surjyadipta Shome
Contact Piyush Garyali (piyushg@vt.edu) or Prof. Ravindran (binoy@vt.edu) for installation problems, questions or comments.

Back to top


This website was designed by Piyush Garyali using KompoZer v0.7.10 on Ubuntu GNU/Linux
The ChronOS logo was designed by Piyush Garyali using Inkscape.
The Real-time Systems Lab logo
"Soft Watch at the Moment of First Explosion" (C) Painting by Salvador Dali (1954)
Linux, (C) Linus Trovalds
(C) Real-time Systems Lab, Virginia Polytechnic and State University, Blacksburg, VA