Q&A on background of leJOS and TinyVM

Brian Bagnall was curious about the background
of the projects, as well as my (Jose
Solorzano's) personal background. He suggested
that I post answers to some questions he prepared. And I thought it would be fun to do that, so here it goes...

[Brian] First, let's have some stats on you, Jose. How old are you?

I'm 30. I was still in my 20s when I started
to work on TinyVM, if that counts for something :)

[Brian] Where do you live?

I live in the San Francisco Bay Area; Fremont,
to be more precise.

[Brian] What do you do?

I'm a software engineer for a company that
develops Java tools. I've decided not to say
anything else about that, as I wouldn't want
anyone to get the impression that there's
an association between my employer and these
projects. Such association doesn't exist. Both
projects are developed exclusively in my
spare time with my own resources. And I
consider them part of a hobby.

In addition to a day job, believe it or not,
I also have a family.

[Brian] Where did you learn your programming

I was programming (BASIC) informally when I was
a teenager. I begun studying Computer Science
in my home country, Ecuador, in the early 90s.
Most of the CS I know, I probably learned there,
and I'm thankful for the almost-free education
that I got in Ecuador. I later transfered to
Wichita State University (in Kansas) where I
got my Bachelor's Degree, and more recently, my
Master's Degree in CS. A lot of my skills come
from hobby projects, but also from the 3 or 4
professional positions I've held. (BTW, in 2
or 3 months I might be in the market for a
new job; contact me if you're interested).

[Brian] Now for the nitty gritty. Is leJOS an operating system or a virtual machine or what?

It's a replacement firmware, and a VM is
part of it. Is it an OS? I'm not sure if
I can define it that way, as you can only
have one program (although a multithreaded
one) loaded at any given time. But I do
have plans to add multi-program downloading
to leJOS, before the first beta version is
released, in which case it can more properly
be referred to as an OS.

[Brian] When did you first have the idea to
create leJOS for the RCX?

leJOS itself was forked out of TinyVM, as
you know, even though forking projects is
generally not advisable. I thought it would
be a good experiment to try, considering
the limitations of the RCX, and the potential
differences that two RCX Java runtimes could

As for TinyVM, I started to work on it in late
November, 1999, after an unsuccessful search
for an RCX Java runtime. A few months before
that, I had read an article in Dr. Dobb's by
Markus Noga about legOS. This is when I actually
became aware of Lego Mindstorms, not necessarily
when I decided it might be a good idea to write
an OS for the RCX. The last time I had coded
anything in C was several years ago. Basically,
once I tried Java, I decided C was a good
language for systems programming and things
like that, but Java was the better language
for applications programming.

Even though I'm not very good at building
robots (I'm improving this skill slowly with
the help of my 5-year-old daughter), I wanted
to program some simple robots in Java. This
was combined with an academic interest I've
had regarding object oriented operating systems,
plus a more recent interest in the whole open
source movement/revolution (I've read all the
usual literature by Eric S. Raymond). That's pretty much how the motivation for TinyVM

[Brian] Have you ever tackled a project like this before?

I have developed large hobby projects previously,
but I've never pushed them into the public domain.
Professionally, I have worked on much larger
(though not as fun) projects.

[Brian] What sort of development environment are you using for your programming?

I work mostly on Linux, so Emacs plus javac is
what I'm used to. Lately I've moved to Windows
(for testing and for my family's convenience)
and I'm using jEdit plus javac. (BTW, jEdit is
a great Java based editor which I definitely
recommend). I haven't found a need to try any
of the commercial IDEs.

[Brian] What languages are you using to program the compiler? To program the RCX-VM?

TinyVM and leJOS don't include a compiler (lejosc calls javac or jikes). You probably mean the linker, which is written in Java. It runs on
a normal JVM. The VM itself is written in C.

[Brian] You've mentioned leJOS can be ported to
other processors other than the Lego RCX. Does
this only include devices using the Hitachi H8300
processor? How difficult would this be to port
it to other devices? How much work?

Yes, leJOS is quite portable. I'm saying this
because I know it runs on top of a normal
operating system, like Linux or Windows (under
CygWin). Of course, this is just for
emulation/testing of RCX programs, but it means that leJOS was designed to be portable. The portability comes from the fact that the C code
in the kernel (vmsrc) does not invoke any OS-specific or platform-specific system calls. There
are hook functions that need to be provided by
each implementation (e.g. some native methods,
time routines, etc.), but this is quite easy to do. For anyone interested in porting leJOS, I wrote some guidelines in the docs/hacking/PORTING file.

[Brian] Have you identified any potential devices to port the JVM operating system to?

leJOS should be especially easy to port to
any platform gcc cross-compiles to. I was
trying to port it to a platform for which gcc
is unavailable, namely the Nintendo Gameboy.
The effort was unsuccessful, as the GBDK
compiler was choking on my C files. I might
try again on another occasion.

I've also considered Palm devices. But I'm not
sure it would be advisable to try to compete
with KVM and other commercial offerings.

Some leJOS users might have noticed a
philosophical trend in these projects:
A belief in the potential technical superiority of an Object Oriented Operating System that is Java based. While the JOS project exists to
develop such a system, and I hope it succeeds,
I am taking a different approach with similar goals. My approach is more conservative, or
evolutionary, if you will. After leJOS, there
will probably be another system, eJOS maybe, who

[Brian] How did you find out about the internal workings of the Lego RCX?

I guess, in the same way as a lot of people.
I read Kekoa Proudfoot's RCX Internals page,
printed the ROM disassembly, and so on.
Although I've read the ROM disassembly, I
make almost no use of whatever little I picked
up there. RCX hardware manipulation is achieved
with the help of Kekoa Proudfoot's librcx
library. And all of the assembly code you'll
find in leJOS/TinyVM was contributed by Ryan
Vander Bijl.

[Brian] There is another group in the design phase making an RCXJVM. The development team
includes Kekoa Proudfoot and Soren Hilmer (Soren
has asked us questions in our TinyVM developer
mailing list). Now that you've come so far with
leJOS, is there any reason for them to come
out with their own RCXJVM?

Ironically, about 3 minutes after I announced
TinyVM 0.1.0beta1, my brother sent me an email
with a URL for the RCXJVM project. I could had
learned about that project earlier if I had
been familiar with Lugnet back then. I might
have offered to contribute. Maybe not. I might
have instead waited to become a user of RCXJVM. In any case, it's likely neither TinyVM nor leJOS would exist today.

I'm not familiar with the status of RCXJVM. I
know it's been around for over a year, but I
can't really make any other factual comments about it. In any case, it's up to the maintainers
of that project to pursue its development, and so on. There's always room for alternatives and
competition. leJOS itself competes with TinyVM.
(BTW, Soren is a member of leJOS' development
team, not just part of the mailing list).

There's another more academic project
by Pekka Nikander, based on gcj, which some of
you might be familiar with. I've talked to
Pekka about collaboration possibilities, but
it looks like his design/project goals differ from mine.

[Brian] What sort of response have you gotten from the Lego RCX community?

The response has been quite good, and
it keeps me motivated to continue working
on these projects. There have been several
contributions, mainly from Ryan Vander Bijl
and yourself. Various schools seem to be
using TinyVM in Java courses. The number of downloads is not as high as what really popular
projects get, but it's reasonable. TinyVM
often appears in the list of most active
projects in the Java Foundry at SourceForge.
And I'm in general happy about how it has
done. leJOS is catching up fast.

There hasn't been much talk at Lugnet, though.
I believe there are several issues to consider.
First, most hardcore Lego users probably have
a lot of code and time already invested in NQC,
and legOS to some extent. Second, Java is
criticized for being a language for an elite
of people with degrees in Computer Science.
There might be some truth to that, as it is
an object oriented language, with features that
aren't very common in other languages. Third,
there's FUD going around about the performance
of Java. Fourth, some people might be under
the impression that these systems are more
heavy-weight than the alternatives, given that
Java runtimes are usually huge. Finally, TinyVM
is only 7 months old. leJOS is still in alpha.

[Brian] Anything else you would like to add?

I hope you find these answers informative.
It was certainly fun to answer them.

I'll do my best to keep these projects going
for a long time to come.

Best regards,

--Jose Solorzano

Posted by Jose Solorzano 2012-10-16

Log in to post a comment.