Skip to content
 
 

Repository files navigation

Linux kernel modules in safe Rust

  1. Install cargo-xbuild and the rust-src rustup component:
cargo install cargo-xbuild
rustup component add --toolchain=nightly rust-src
  1. cd to one of the examples
cd hello-world
  1. Build the static object with cargo xbuild, pointing it at our custom target
RUST_TARGET_PATH=$(pwd)/.. cargo xbuild --target x86_64-linux-kernel-module

  1. Build the kernel module using the Linux kernel build system (kbuild)
make
  1. Load and unload the module!
sudo insmod helloworld.ko
sudo rmmod helloworld
dmesg | tail

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages