-
Notifications
You must be signed in to change notification settings - Fork 3
rumprun unikernel environment
This documents the specific steps needed to build a runnable rumprun unikernel using QEMU, an open source machine emulator and virtualizer. A more generic rumprun tutorial can be read here.
The rumprun repository provides the rumprun unikernel for various platforms. Rumprun uses the drivers offered by rump kernels, adds a libc and an application environment on top, and provides a toolchain with which to build existing POSIX-y applications as rumprun unikernels.
Platforms currently support by rumprun are hw/x86 and Xen/x86+x64, with more being worked on. Platform support is modular with the maximal amount of code shared between platforms, and generally speaking only bootstrap code and glue to I/O devices and the clock are required for supporting a new platform.
First step is to copy the repo
git clone https://github.com/rumpkernel/rumprun.git
and install QEMU
sudo apt-get install QEMU
cd into rumprun directory.
./build-rr.sh platform -- -F ACFLAGS=-m32
NOTE: This is how you recompile and build the components after making a kernel src change
To compile a program consisting of a single C module for the hw platform:
rumprun-bmk-cc -o test test.c
baking is done using the rumpbake tool. (found in app-tools) It takes the binary produced by the compiler and produces a runnable image. The parameters are the output image and target name.
rumpbake hw_generic test.bin test
use rumpbake list to see the available targets. Or, to use your own target, you can edit the rumpbake.conf to add a new configuration with specific rump libraries.
The rumprun tool helps hide the details of running a unikernel from platform to platform, to provide a uniform experience.
rumprun hw -i prog
To debug you need to both start qemu paused and connecting to an a port. GDB will then connect to this port, find the right debug symbols and start the app through the continue command.
Terminal 1: From application directory $/app-tools/rumprun qemu -ip -D 1234
Terminal 2: From application directory
$gdb
$target remote:1234
$file <app>
$y
Set desired break points...
$c
'''