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.

78<br />

since <strong>the</strong> representation might not be <strong>the</strong> same in <strong>the</strong> kernel <strong>and</strong> <strong>the</strong> hypercall<br />

library. Even different versions <strong>of</strong> NetBSD have different representations, for<br />

example due to increasing time_t from 32bit to 64bit. <strong>The</strong>refore, to have<br />

a well-defined interface when running on a non-native host, <strong>the</strong> hypercall<br />

interface should only use data types which are <strong>the</strong> same regardless <strong>of</strong> ABI. For<br />

example, <strong>the</strong> C99 constant width type uint64_t is preferred over time_t.<br />

Since <strong>the</strong> hypercall executes in <strong>the</strong> same process as <strong>the</strong> rump kernel, byte<br />

order is not an issue, <strong>and</strong> <strong>the</strong> native one can be used.<br />

3. A separate interface helps future investigation <strong>of</strong> running rump kernels on<br />

non-POSIX platforms, such as microkernels. This investigation, however,<br />

will require adjustments to <strong>the</strong> hypercall interface. While <strong>the</strong> need for adjustments<br />

is foreseeable, <strong>the</strong> exact forms <strong>of</strong> <strong>the</strong> adjustments are not, <strong>and</strong> that<br />

is <strong>the</strong> reason <strong>the</strong>y are not already in place.<br />

<strong>The</strong> header file sys/rump/include/rump/rumpuser.h defines <strong>the</strong> hypercall interfaces.<br />

All hypercalls by convention begin with <strong>the</strong> string “rumpuser”. This prevents<br />

hypercall interface references in <strong>the</strong> rump kernel from falling under <strong>the</strong> jurisdiction<br />

<strong>of</strong> symbol renaming.<br />

We divide <strong>the</strong> hypercall interfaces into m<strong>and</strong>atory <strong>and</strong> optional ones. <strong>The</strong> routines<br />

that must be implemented by <strong>the</strong> rumpuser library are:<br />

• memory management: allocate aligned memory, free<br />

• thread management: create <strong>and</strong> join threads, TLS access<br />

• synchronization routines: mutex, read/write lock, condition variable.<br />

This class is illustrated in Figure 3.3.<br />

• exit: terminate <strong>the</strong> host container. In a POSIX environment depending on<br />

<strong>the</strong> parameters termination is done by calling ei<strong>the</strong>r abort() or exit().

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

Saved successfully!

Ooh no, something went wrong!