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.

196<br />

<strong>the</strong> necessary tools such as make 15 <strong>and</strong> mtree is helpful. <strong>The</strong>se tools can be used,<br />

but <strong>the</strong> compiler should be replaced with <strong>the</strong> foreign host targeted compiler. Also,<br />

when building for a different version <strong>of</strong> NetBSD build.sh is helpful since occasionally<br />

features are implemented in <strong>the</strong> build tools after which <strong>the</strong> build process starts<br />

depending on <strong>the</strong>m. Older versions <strong>of</strong> NetBSD may not be able to build newer<br />

versions using native tools alone.<br />

<strong>The</strong> pkgsrc packaging system [5] provides support for building a rump kernel <strong>and</strong><br />

<strong>the</strong> rumpuser hypervisor library on Linux <strong>and</strong> FreeBSD. Support is provided by<br />

<strong>the</strong> package in pkgsrc/misc/rump. While as <strong>of</strong> writing this text <strong>the</strong> rump kernel<br />

version support from pkgsrc is older than <strong>the</strong> one described in this document, <strong>the</strong><br />

package can be used as a general guideline on how to build a NetBSD rump kernel<br />

targeted at a foreign host.<br />

Host Services<br />

To be able to run, a rump kernel uses <strong>the</strong> hypercall interface to access <strong>the</strong> necessary<br />

host services, e.g. memory allocation. We already touched <strong>the</strong> problems when<br />

discussing <strong>the</strong> hypercall interface in Section 3.2.3. To recap, <strong>the</strong> rump kernel <strong>and</strong><br />

<strong>the</strong> host must agree on <strong>the</strong> types being passed between each o<strong>the</strong>r. Commonly used<br />

but not universally constant types such as time_t cannot be used as part <strong>of</strong> <strong>the</strong><br />

hypercall interface <strong>and</strong> unambiguous types such as int64_t should be used instead.<br />

Compound types such as struct stat <strong>and</strong> struct timeval cannot generally be<br />

used, as <strong>the</strong> binary layout varies from one system to ano<strong>the</strong>r — in <strong>the</strong>se cases, both<br />

structures contain time_t which is enough to make <strong>the</strong>m non-eligible. Fur<strong>the</strong>rmore,<br />

system-defined macros such as O_RDONLY may not be used, since <strong>the</strong>ir representation<br />

will depend on <strong>the</strong> system <strong>the</strong>y are from. Since <strong>the</strong> hypercall interface is relatively<br />

small <strong>and</strong> used only for <strong>the</strong> specific purpose <strong>of</strong> interacting with <strong>the</strong> rump kernel<br />

15 <strong>The</strong> “flavour” <strong>of</strong> make required to build NetBSD is different from for example GNU make.

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

Saved successfully!

Ooh no, something went wrong!