Re: LuaJIT-on-Xen?

  • From: Javier Guerra Giraldez <javier@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 5 May 2013 00:09:48 -0500

On Sat, May 4, 2013 at 11:22 PM, Alexander Gladysh <agladysh@xxxxxxxxx> wrote:
>
> There are several projects that aim to launch an application framework
> as a Xen VM instance without OS.
>
.....
>
> This kind of feat should be possible with LuaJIT too, and it looks
> like an interesting and potentially very useful project.


I see a few different ways to architect this:

- JeOS (pronouced "juice").  not really a "VM without an OS", but a
minimal OS. a few distros have some kind of JeOS variant.  Of course,
since this is a "generic minimal", it's not so minimal...

- LFS (Linux From Scratch).  it's not supposed to be a minimal system,
but when you compile everything, you can leave out anything you don't
want.

- busybox.  I've done this for small physical boxes. it's an easy way
to get a bootable system on a few megabytes.  just a Linux kernel, the
busybox executable, a few support files and many symlinks makes a very
lean and efficiend OS in 30 or so MB.  Still an OS, but now it's
really minimalistic.  In my case, I've make it work both on readonly
flash media and on a PXE-loaded initramfs image that never loaded a
"true" system.

- Linux kernel + LuaJIT + ljsyscall + scripts.  now we're getting to
the "no OS" level, but the kernel is a standard one, so it's more like
a LuaJIT-OS.  the kernel can launch LuaJIT instead of the "init"
process on PID #1.  from there, you can do anything.  the downside is
that you can't just install many supporting programs, because they
might depend on some other utilities available.

- LuaJIT "kernel" + some "ljxencall" (like ljsyscall but for Xen
syscalls instead of Unix ones).  Now there's really no OS!  not even
ljsyscall would work on such an image, but the FFI can do all the
Xen-provided syscalls.  the downside is that these are _very_ low
level, more like some high-level hardware than some low-level system.
 AFAIK, there's no filesystem, no TCP/IP, no processes, no threads...
What you _do_ get is a high-speed channel to communicate with other
VMs, and some calls to manage CPU states and interrupts.


so... which would you like?   myself, i'd go the busybox way, if
feeling hardcore maybe the "LuaJIT as init" way.  the last one (LuaJIT
as kernel) would be more realistic if you add a TCP/IP stack.  maybe
the µIP library... or even better, rewrite it on LuaJIT+FFI!  but I
think the Xen syscalls don't include even a packet-level device, just
an inter-VM channel that is used to talk to the Dom0 daemons.

--
Javier

Other related posts: