Embedded VMs

RussSchultz

Professional Malcontent
Veteran
Anybody know any virtual machines that are targetted by GCC? (or a cheap compiler)

Any search on google, or the like brings up a crapload of a Java VM articles, or products.

I'm looking for a VM for a RISC core, or one that is targetted by a reasonably cheap compiler. An 8 or 16 bit VM would be best, though a 32 would probably be acceptable.

I've found the following:
-C-FLEA by Dunfield. Has potential.
-Hints of something called the HEC virtual machine. Can't find any more information on it other than it exists
-MMIX by Knuth. Absolutely useless. its a 64 bit architechture. Complete overkil for what I'm trying to do.
 
I think there is a little trick that you might not be using in your searches...

Try using:

free "virtual machine" RISC -java -amazon

That should do it, I got a whole bunch of java stuff as well so I killed that, then amazon.com started creeping up trying to sell me stuff so I blew that away to. Love the -xxxx.
 
Bleh. Java is unacceptable. Garbage collection is the devil in embedded solutions.

I found a motorola 68k core simulator w/ source. It fits my bill completely:

-popular core
-targetted by GCC
-in the public domain
-relatively simply

Now I just have to see how good the code density is.
 
Hrm. Perhaps an 8051 or Z80 looks good, also.

An AVR does also, but its too new and I'm sure Atmel might be a little too keen on defending their copyrights.
 
Java ME, micro edition, which is meant for embedded devices does not have garbage collection, AFAIK.
 
Even Java Card (smaller than Java ME) requires dynamic allocation, from what I can tell from the documentation.

I love their description of Java ME. "Some handheld and embedded platforms have limited memory, as little as 512 or 1M, to devote to a java virtual machine".

The Java people are nuts.
 
LoL! Yeah, they are nuts.

I'm starting to love CPython, which I feel is more portable, considering the fact that what platform out there lacks a good C compiler vs a JVM.
 
RussSchultz said:
Hrm. Perhaps an 8051 or Z80 looks good, also.

An AVR does also, but its too new and I'm sure Atmel might be a little too keen on defending their copyrights.

Russ, what do you want such a VM for?

otherwise i can think of two good 8bit VM's off the top of my hat, both msdos-hosted, one of them is a z80 w/ cp/m (i used to toy a lot with it some years ago, actually one might be able to find lots of goodies for cp/m, incl. a native cc), the other is a 6800 VM with a genuine, embedded-devices-oriented multi-tasking os.

--darkblu
 
Our DSP compiler writes somewhat crappy code, and we have very limited memory.

It was a bit of a lark of mine to port a small VM to our DSP to run user interface code. The VM engine would be a memory manager, we'd get the benefit of a top notch compiler (GCC), all at the expense of execution speed.

Anywyas, I think the bifurcated system would make debugging a intense pain the arse, but I might pursue it.
 
RussSchultz said:
It was a bit of a lark of mine to port a small VM to our DSP to run user interface code. The VM engine would be a memory manager, we'd get the benefit of a top notch compiler (GCC), all at the expense of execution speed.

ok, i see now. two remarks then:
* you want to port it so you'd most like want an open source VM, unless you're heavily into reverse-engineering ;)
* re 8bit VMs - i'm not aware of any GCC support for 8bit targets. AAMOF, i don't know if GCC's target defining language supports 8bits architectures at all (maybe it used to in the past).. so i'd say your best bet would be an 68K. but you may want to visit the gcc site and inquire for yourself.
 
GCC's target defining language does support 8-bit processors - at least AVR, which is supported by GCC, is 8-bit. For a list of all currently supported platforms, look here. Of course, you could always write your own target - not sure how many man-months that will take, though.
 
Here is a C compiler for the 8 bit 6502. There are loads of 6502 emulators out there, or you could write your own (only 151 opcodes...)

I don't think the 6502 is the best C target, but I thought I should mention it...
 
I think I've settled on an 68HC11/12 (if I continue with the project at all).

Again, not too many opcodes, targetted by GCC, somewhat "optimized for C" (Or at least motorola's website says so)

Or I might try interpreted C, though I'm having trouble finding something that compiles to bytecode and interprets the bytecode.

Maybe EiC would do the trick. Or maybe not.
 
Back
Top