28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

46<br />

(some exceptions to <strong>the</strong> file system rule exist, such as Bluetooth <strong>and</strong> E<strong>the</strong>rnet interfaces<br />

which are accessed via sockets on NetBSD). To access a /dev file system node<br />

in a rump kernel, file systems must be supported. Despite file system access being<br />

<strong>the</strong> st<strong>and</strong>ard way to access a device, it is possible to architect an application where<br />

<strong>the</strong> device interfaces are called directly without going through file system code. Doing<br />

so means skipping <strong>the</strong> permission checks <strong>of</strong>fered by file systems, calling private<br />

kernel interfaces <strong>and</strong> generally having to write more fragile code. <strong>The</strong>refore, it is not<br />

recommended as <strong>the</strong> default approach, but if need be due to resource limitations, it<br />

is a possibility. For example, let us assume we have a rump kernel running a TCP/IP<br />

stack <strong>and</strong> we wish to use <strong>the</strong> BSD Packet Filter (BPF) [67]. Access through /dev<br />

is presented in Figure 2.2, while direct BPF access which does not use file system<br />

user interfaces is presented in Figure 2.3. You will notice <strong>the</strong> first example is similar<br />

to a regular application, while <strong>the</strong> latter is more complex. We will continue to refer<br />

to <strong>the</strong>se examples in this chapter when we go over o<strong>the</strong>r concepts related to rump<br />

kernels.<br />

<strong>The</strong> faction divisions allow cutting down several hundred kilobytes <strong>of</strong> memory overhead<br />

<strong>and</strong> milliseconds in startup time per instance. While <strong>the</strong> saving per instance is<br />

not dramatic, <strong>the</strong> overall savings are sizeable in applications such as network testing<br />

[44] which require thous<strong>and</strong>s <strong>of</strong> virtual instances. For example, as we will later<br />

measure in Chapter 4, a virtual TCP/IP stack without file system support is 40%<br />

smaller (400kB) than one which contains file system support.<br />

2.1.3 Hosting<br />

A rump kernel accesses host resources through <strong>the</strong> rumpuser hypercall interface.<br />

<strong>The</strong> hypercall layer is currently implemented for POSIX hosts, but <strong>the</strong>re is no reason<br />

why it could not be adapted to suit alternative hosting as well, such as microkernels.<br />

We analyze <strong>the</strong> requirements for <strong>the</strong> hypercall interface in more detail

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!