I am very proud to announce that
Parrot Virtual Machine has been ported to
RTEMS, a real-time embedded operating system (
RTOS). Here is one of the first
runs of Parrot code atop RTEMS, this example being the
Fibonacci number
benchmark with debug tracing turned on, posted by Chris Johns:
RTEMS SHELL (Ver.1.0-FRC):/dev/console. Oct 21 2009. 'help' to list commands.
fstst [/] # parrot -v p/benchmarks/fib.pir
debug = 0x0
Reading p/benchmarks/fib.pir
using optimization '-O' (0)
Starting parse...
sub _main:
registers in .pir: I3, N2, S1, P2
0 labels, 0 lines deleted, 0 if_branch, 0 branch_branch
0 branch_cond_loop
0 used once deleted
0 invariants_moved
registers needed: I3, N2, S1, P3
registers in .pasm: I3, N2, S1, P2 - 0
4 basic_blocks, 4 edges
sub _fib:
registers in .pir: I5, N0, S0, P0
0 labels, 0 lines deleted, 0 if_branch, 0 branch_branch
0 branch_cond_loop
0 used once deleted
0 invariants_moved
registers needed: I5, N0, S0, P2
registers in .pasm: I5, N0, S0, P2 - 0
5 basic_blocks, 5 edges
1 lines compiled.
Running...
fib(28) = 317811 71.1315400600433s
Many many thanks to all who have helped. -- kiwichris
I met Chris Johns a.k.a. 'kiwichris', a core RTEMS developer, at the Google
Summer of Code Mentor Summit 2009, and we have been attempting to get
Parrot working on RTEMS ever since. With his extreme hard work and
hand-tuned Makefile kung-fu, he cross-compiled Parrot, totally bypassing our
configure/build system, which does not support cross-compiling!
Getting RTEMS working on Parrot definitely pointed out a few rough edges
on Parrot's part, such as using powl() from math.h without checking for it,
even though it is an *optional* POSIX extension. RTEMS does not currently
have powl() so our string subsystem blew up. Thankfully, just replacing
it with pow() works just fine, for now. I've added a ticket to add support for
checking at Configure-time whether powl() exists, and to only use it then,
which is the correct behavior.
Also, the Parrot exit handler calls the system exit() after all other exit handlers
currently, which reboots a real-time OS like RTEMS. So we are going to have
to provide some interface to allow alternate final exit handlers.
But these issues are small, most of the hard work has already been done by Chris. At
this point, we will start fixing our configure/build system so that a RTEMS cross-compile can be done with a Configure.pl flag, such as
perl Configure.pl --cross=rtems-i386
Thanks again to Chris Johns and all RTEMS/Parrot core developers that helped make this possible.
Stay tuned to the intertubes for more updates about Parrot on RTEMS!