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.

125<br />

source loading linking initiated by<br />

builtin external external external toolchain<br />

bootloader external kernel bootloader<br />

file system kernel kernel syscall, kernel autoload<br />

Table 3.3: Kernel module classification. <strong>The</strong>se categories represent <strong>the</strong> types<br />

<strong>of</strong> kernel modules that were readily present in NetBSD independent <strong>of</strong> this work.<br />

being converted. A modular driver knows how to attach to <strong>the</strong> kernel <strong>and</strong> detach<br />

from <strong>the</strong> kernel both when it is statically included <strong>and</strong> when it is loaded at runtime.<br />

NetBSD divides kernel modules into three classes depending on <strong>the</strong>ir source <strong>and</strong><br />

when <strong>the</strong>y are loaded. <strong>The</strong>se classes are summarized in Table 3.3. Builtin modules<br />

are linked into <strong>the</strong> kernel image when <strong>the</strong> kernel is built. <strong>The</strong> bootloader can load<br />

kernel modules into memory at <strong>the</strong> same time as it loads <strong>the</strong> kernel image. <strong>The</strong>se<br />

modules must later be linked by <strong>the</strong> kernel during <strong>the</strong> bootstrap process. Finally,<br />

at runtime modules must be both loaded <strong>and</strong> linked by <strong>the</strong> kernel.<br />

<strong>The</strong> fundamental steps <strong>of</strong> loading a kernel module on NetBSD at runtime are:<br />

1. <strong>The</strong> kernel module is loaded into <strong>the</strong> kernel’s address space.<br />

2. <strong>The</strong> loaded code is linked with <strong>the</strong> kernel’s symbol table.<br />

3. <strong>The</strong> module’s init routine is run. This routine informs o<strong>the</strong>r kernel subsystems<br />

that a new module is present. For example, a file system module at a<br />

minimum informs <strong>the</strong> VFS layer that it is possible to mount a new type <strong>of</strong><br />

file system.<br />

onward are incompatible with <strong>the</strong> old LKM scheme. <strong>The</strong> reasons why LKM was retired in favor<br />

<strong>of</strong> <strong>the</strong> new system are available from mailing list archives <strong>and</strong> beyond <strong>the</strong> scope <strong>of</strong> this document.

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

Saved successfully!

Ooh no, something went wrong!