Skip to main content

How to use Slack Stealer?

Posted in

First of all, it is necessary to install the Arm-toolchain compiler to rebuild the firmware after changes. Take a look at the tutorial page to know how to install such a compiler.


LeJosRT now has two Slack Stealer algorithms : Dynamic Approximate Slack Stealer (DASS) and Minimal Approximate Slack Stealer (MASS).

The purpose of these two algorithms is to obtain the laxity of the processor continously.

To activate one of these algorithms, go to /lejosRT/lejos_rt/src/nxtvm/javavm/configure.h.
At the end of this file, you should find :

  1. /**
  2. * Slack Stealer : none (0), DASS (1), MASS (2)
  3. */
  4. #define SlackStealer 0

As stated,

  • to activate DASS , set SlackStealer to 1,
  • to activate MASS , set SlackStealer to 2,
  • to desactivate these algorithms , set SlackStealer to 0.

Then, save the file.

If you want to modify the virtual machine by using the laxity, you must use the function "instant_laxity()" defined in the file realtime_threads.c.
This function returns the instant laxity.

After making your changes, open a new session in a terminal and go to the folder /lejosRT/lejos_rt/install.
If the java classes were changed, tape and execute :

  1. ./install_lib.sh

Then, make sure your NXT is attached to the PC by its USB cable, and switch it on by pressing the orange button.
Tape and execute :

  1. ./flashfw.sh

The modifications are uploaded on the robot.