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.

72<br />

e.g. <strong>the</strong> routine for mapping a process ID number (pid_t) to <strong>the</strong> structure describing<br />

it (struct proc *). We were interested in being able to extract this code. However,<br />

<strong>the</strong> same file also contained <strong>the</strong> definition <strong>of</strong> <strong>the</strong> lwp0 variable. Since that definition<br />

included references to <strong>the</strong> scheduler (“concept not supported in a rump kernel”), we<br />

could not extract <strong>the</strong> file as such. However, after moving <strong>the</strong> definition <strong>of</strong> lwp0 to<br />

kern_lwp.c, where it arguably belongs, kern_proc.c could be extracted.<br />

3.1.2 Providing Components<br />

On a POSIX system, <strong>the</strong> natural way to provide components to be linked toge<strong>the</strong>r<br />

is with libraries. <strong>Rump</strong> kernel components are compiled as part <strong>of</strong> <strong>the</strong> regular<br />

system build <strong>and</strong> installed as libraries into /usr/lib. <strong>The</strong> kernel base library is<br />

called librump <strong>and</strong> <strong>the</strong> hypervisor library is called librumpuser. <strong>The</strong> factions<br />

are installed with <strong>the</strong> names librumpdev, librumpnet <strong>and</strong> librumpvfs for dev,<br />

net <strong>and</strong> vfs, respectively. <strong>The</strong> driver components are named with <strong>the</strong> pattern<br />

librump_driver, e.g. librumpfs_nfs (NFS client driver). <strong>The</strong> faction<br />

part <strong>of</strong> <strong>the</strong> name is an indication <strong>of</strong> what type <strong>of</strong> driver is in question, but it does<br />

not convey definitive information on what <strong>the</strong> driver’s dependencies are. For example,<br />

consider <strong>the</strong> NFS client: while it is a file system driver, it also depends on<br />

networking.<br />

By default, NetBSD installs two production variants <strong>of</strong> each library: a static library<br />

<strong>and</strong> a shared library. <strong>The</strong> system default is to produce dynamically linked executables<br />

which use shared libraries, <strong>and</strong> this approach is also used when linking rump<br />

kernels. In custom built rump kernels <strong>the</strong> choice is up to <strong>the</strong> user. Shared libraries<br />

allow <strong>the</strong> host to load <strong>the</strong> components into physical memory only once irrespective<br />

<strong>of</strong> how many rump kernel instances are started, but shared libraries have worse performance<br />

due to indirection [39]. Figure 3.1 illustrates <strong>the</strong> speed penalty inherent<br />

to <strong>the</strong> position independent code in shared libraries by measuring <strong>the</strong> time it takes

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

Saved successfully!

Ooh no, something went wrong!