28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

127<br />

<strong>The</strong> bootstrap procedure iterates over all <strong>of</strong> <strong>the</strong> modinfo structures. This approach<br />

is not directly applicable to a dynamically linked environment because <strong>the</strong> dynamic<br />

linker cannot generate a combined section like static linking can — consider e.g. how<br />

loading <strong>and</strong> unloading would affect <strong>the</strong> section contents at runtime. Still we, need a<br />

mechanism for locating driver init routines when <strong>the</strong> rump kernel is bootstrapped.<br />

This task <strong>of</strong> locating <strong>the</strong> init routines is done by <strong>the</strong> rumpuser_dl_bootstrap()<br />

hypercall. It iterates over all <strong>the</strong> dynamic shared objects present <strong>and</strong> ga<strong>the</strong>rs <strong>the</strong><br />

contents <strong>of</strong> all <strong>the</strong> modules sections individually.<br />

A related problem we discovered was <strong>the</strong> GNU linker changing its behavior in generating<br />

<strong>the</strong> __start_section <strong>and</strong> __end_section symbols. Older versions generated<br />

<strong>the</strong>m unconditionally. In newer versions <strong>the</strong>y are generated only if <strong>the</strong>y are referenced<br />

at link time (<strong>the</strong> “PROVIDE” mechanism). Since individual components do<br />

not use <strong>the</strong>se symbols, <strong>the</strong>y do not get generated when <strong>the</strong> components are linked as<br />

shared libraries. To address this regression, we created <strong>the</strong> component linker script<br />

sys/rump/ldscript.rump which forces <strong>the</strong> generation <strong>of</strong> <strong>the</strong> symbols in shared<br />

library components <strong>and</strong> restores desired behavior.<br />

3.8.2 Modules: Loading <strong>and</strong> Linking<br />

Runtime loading <strong>and</strong> linking in a rump kernel includes two distinct scenarios. First,<br />

shared objects can be loaded <strong>and</strong> linked by <strong>the</strong> host’s dynamic linker. Second, static<br />

objects can be loaded <strong>and</strong> linked by code in <strong>the</strong> rump kernel. We will discuss both<br />

approaches next.

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

Saved successfully!

Ooh no, something went wrong!