November 07, 2012 posted by Antti Kantee
The unique anykernel capability of NetBSD allows the creation of
rump kernels, which are
partially paravirtualized kernels running on top of a high-level
hypervisor. This technology e.g. enables running the
same file system driver in the monolithic kernel or as a
microkernel style server in userspace. POSIX-compatible
systems have been more or less supported as rump kernel hypervisors for
the past 5 years. A long-time goal has been to extend hypervisor
support further, for example to embedded systems. This would bring the
solid driverbase of NetBSD available to such systems with only the cost of
implementing the hypervisor.
To see how far things can go, last week I started toying with the
manually implement the hypervisor. After some
emscripten, which translates C into
mature, but there is also extensive support for the POSIX API. This meant that
could also compile the existing POSIX hypervisor and have it work.
tree. This contrasts the approach taken by
another similar experiment,
where an x86 Linux is run inside a x86 machine emulator running
I have thrown together a small proof-of-concept demo of how to build a
web service with the capability to access file system images using
kernel with support for the FFS, tmpfs and kernfs file systems. This
rump kernel backend is tied to a lightweight web page which passes
requests from forms to the rump kernel and displays results. When the
bootstraps a rump kernel, and mounts the FFS image r/o at /ffs.
The status can be further manipulated with interactive commands.
The demo is available
I've tested it to work with Firefox and tested it to not work
with Internet Explorer. YMMV with other browsers. Note,
size, so the page may load for a few moments over a slow link --
whitespace removal was the only size reduction technique I used.
sources, you can also look at the
unoptimized version (14MB).