On Sun, May 5, 2013 at 5:22 AM, Alexander Gladysh <agladysh@xxxxxxxxx> wrote: > Hi, list! > > There are several projects that aim to launch an application framework > as a Xen VM instance without OS. > > For example: > > http://erlangonxen.org/ > https://github.com/GaloisInc/HaLVM > > (Are there others?) > > This kind of feat should be possible with LuaJIT too, and it looks > like an interesting and potentially very useful project. OK well the prototype is done for running LuaJIT directly on Xen now. Thanks to Antti Kantee for doing most of the work. Essentially this is a build of a modified version of the Xen "Mini-os" which provides a small stub to handle basic Xen functions like memory allocation, combined with NetBSD kernel components to provide networking and file system access if required, plus NetBSD libc to provide enough to build and run normal C code. Then the build system creates an executable 'kernel' that Xen can run which combines LuaJIT and example bytecode-compiled Lua scripts. The current example compiles the ljsyscall test suite, just to show how the build works. Some things are not supported, like fork, exec, dynamic libraries, mmap other than a small stub. All code is MIT or BSD licensed. https://github.com/justincormack/rumpuser-xen Currently it only works with 32 bit LuaJIT, it needs some fixes to mmap for 64 bit support. The build process is not very nice, and will be improved. You should be able to compile C libraries and add support, the base environment is much like NetBSD, so most stuff compiles. You can use the ffi for stuff thats linked into the binary, but you will need to tweak the (quick hack) ljsyscall/examples/dl.c script which handles dlsym that the ffi uses, as static linking does not provide dlsym. Ask for help on github if you have issues. Justin