Old introduction: See old readme.
- kernel version: 6.6 or 6.8
- Install clang, kernel headers, and the
rust-src
andrustfmt
components fromrustup
:
apt-get install llvm clang linux-headers-"$(uname -r)" # or the equivalent for your OS
rustup component add --toolchain=nightly rust-src rustfmt
- cd to one of the examples
cd tests/hello-world
- Build the kernel module using the Linux kernel build system (kbuild), this
will invoke
cargo
to build the Rust code
make
- Load and unload the module!
sudo insmod helloworld.ko
sudo rmmod helloworld
dmesg | tail