Kernel-level VM for languages?

I don’t know if this is a good idea or not, but it does make me wonder. There are all of these excellent virtual machine projects and architectures out there but they are mostly in userspace. The few that aren’t are geared specifically towards virtualizing operating
systems. It occured to me that something useful might be to put a virtual machine interface into the kernel which would allow dynamic languages to be compiled to a common format which could run closer to the OS and possibly yield a speed increase. If system calls and other execution can be managed from the kernel, wouldn’t that yield a speed increase? What I’m proposing is a kernel-level virtual machine aimed at providing an improved interface for running dynamic languages.

Imagine a workflow like this:

  1. The kernel has a module called the KLVM or something.
  2. You write a program in a language and compile it to some common bytecode or something.
  3. Then, you invoke an application to run it, like “vmrun program” and the instructions are executed in the KLVM.

I’m not an expert on this subject I’m thinking about how kernel traps, system calls and instruction thunking works and can’t figure out if there’s anything to this thought or not! Alternatively, this might be solved by tying something like LLVM into the kernel.

  1. I don’t see the point….

    Dynamic languages aim to be platform independent… a kernel module wouldn’t be. I doubt there would be any significant speed up, which probably wouldn’t be worth the effort (considering most of the services a kernel provides you would (my ignorance assumes) not be available to you as a kernel module… so presumably you’d have to duplicate quite a lot of ‘work’.

  1. No trackbacks yet.