/rustkpi

Sources to the Master's thesis: Safe Kernel Programming with Rust

Primary LanguageC++

Safe Kernel Programming with Rust

Master Thesis Project
Johannes Lundberg
KTH, Stockholm, Sweden
2017-2018

Introduction

TODO: Fix compile warnings and write introduction.

How To

Preliminary

  1. Clone this repo (to folder we will call $ROOT) on a FreeBSD 12 machine
  2. Install rustup (https://www.rust-lang.org/en-US/install.html)
  3. Set toolchain
    1. rustup toolchain link rustkpi $ROOT/rust/toolchains/x86_64-unknown-freebsd-1.25-nightly
    2. cd $ROOT
    3. rustup override set rustkpi
  4. Build RustKPI
    1. cd $ROOT/rust/kmod-rustkpi
    2. make
  5. Build Hello World module
    1. cd $ROOT/rust/kmod-helloworld
    2. make
  6. Test
    1. cd $ROOT/rust/
    2. sudo kldload kmod-rustkpi/rustkpi.ko
    3. sudo kldload kmod-helloworld/rustkpi-hello.ko
    4. dmesg

For the e1000 driver in kmod-e1000 the following devices are supported

  • bhyve with e1000 nic emulation
  • I218 (found in Intel Broadwell laptops)
  • I219-LM (found in Intel Skylake laptops)

kmod-e1000 is built the same way as described above.