Skip to content

immunant/linux-kernel-module-rust

 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 83.2%
  • Makefile 8.5%
  • Python 6.7%
  • C 1.6%