Thanks to visit codestin.com
Credit goes to github.com

Skip to content

numpy1314/linux-kernel-module-rust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

270 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Kernel Module in Rust

Old introduction: See old readme.

System requirements

  • kernel version: 6.6 or 6.8

Building hello-world

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

Reference

About

Framework for writing Linux kernel modules in safe Rust

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 96.0%
  • Linker Script 1.6%
  • Other 2.4%