- leJOS -






What is leJOS or TinyVM?

leJOS Like its predecessor (TinyVM), leJOS is a tiny JavaTM runtime written by Jose Solorzano. Itís function is a replacement firmware for the Lego MindstormsTM RCX, a programmable brick which is part of Lego's Robotics Invention SystemTM (RIS). The RCX contains a Hitachi H8300 processor and 32 Kb of RAM (of which 28 Kb are safe for the firmware to use).
TinyVM's focus differs from that of leJOS. TinyVM is a low footprint replacement firmware (< 10 Kb), whereas the focus in leJOS is completeness, and performance to some extent. The current footprint of leJOS in the RCX is 17 Kb.
leJOS allows us to experiment without breaking TinyVM. It gives us a chance to try out a different design for the API, a different usability model, and so on. TinyVM gives an idea of how small a reasonable Java runtime can be, while leJOS tells us about the amount of features that can be put in an RCX Java runtime before space runs out.
The following shows what leJOS and TinyVM both have in common:

  • Object oriented language (Java).
  • Preemtive threads (tasks).
  • Arrays, including multi-dimensional ones.
  • Recursion.
  • Synchronisation.
  • Exceptions.
  • Well-documented API.

The following shows what extras the leJOS has over the TinyVM:
  • A Windows version, which doesn't require CygWin.
  • Floating point operations (doubles truncated to 32 bits).
  • String constants.
  • Casting of longs to ints and vice versa.
  • Marks references in the stack (which makes it feasible to implement garbage collection).
  • Multi-program downloading.
  • java.lang.Math class with sin, cos, tan, atan, pow, etc.
  • More APIs.

Both JavaTM runtimes offer complex APIís to control the RCX. This includes for example the controlling of motors, sensors, LCD and Buttons and further on a sensorlistener and the communication between several RCX-Bricks or between RCX and PC.
There's a Wired News article about Lego Mindstorms at where Jonathan Knudsen, who has written a couple of programs for leJOS, is quoted as saying that leJOS is "very cool stuff." (Jonathan Knudsen is the author of The Unofficial Guide To Lego MindstormsRobots). (http://www.wired.com/news/culture/0,1284,39504,00.html)