Recent Changes - Search:

Software

Wiki Docs

QuickStartGuide

First you need to obtain NestedVM. The best way is to use Darcs but a tarball is available at http://nestedvm.ibex.org (although this may not be up to date).

 $ darcs get --repo-name=nestedvm http://nestedvm.ibex.org

Next you need to build it. The NestedVM build process not only builds itself, but also a complete mips toolchain based on binutils, gcc, and newlib. This part will probably take a while. There is also lots of ways it can go wrong so please let us know at mailto:nestedvm@lists.hcoop.net if you run into any trouble.

 $ cd nestedvm
 $ make

Now you should have a working copy of NestedVM and and MIPS toolchain. You can run make test to be sure.

Compiling your own code to run under NestedVM is a two step process. First you need to build a MIPS binary (using the supplied toolchain). Then you need to convert that binary to a Java class. First you need to setup the build environment (this just adds the some stuff to the PATH and CLASSPATH environment variables).

 $ make env.sh
 $ source env.sh

Next you need to build the MIPS binary

 $ cat > test.c
 int main() { printf("Hello, Word\n"); }
 ^D
 $ mips-unknown-elf-gcc -o  test.mips test.c

You'd replace test.c with your C source code. If you've got multiple files just compile and link them the same as you would with a native binary, except use mips-unknown-elf-gcc instead of plain old gcc. If you have a makefile for your app you can probably just do make CC=mips-unknown-elf-gcc LD=mips-unknown-elf-gcc. More information can be found in the Building Tips section.

Now you convert this mips binary to a java .class file. This will take test.mips and generate Test.class

 $ java org.ibex.nestedvm.Compiler -outfile Test.class Test test.mips

Finally, test the generated class.

 $ java Test
 Hello, Word

If you want to redistribute your binary you'll need to include the contents of runtime.jar with your application. You can build this by running make runtime.jar. (This isn't needed for the test above because env.sh sets the CLASSPATH for you.)

Edit - History - Print - Recent Changes - Search
Page last modified on February 27, 2009, at 03:57 AM EST