A little kernel driver example written in rust.
You will need:
rustup
to download the latest nightly rust toolchainlinux-headers
for the kernel headersllvm
(which should come with rust i think) andclang
just build with
make
and you will get a hellokernel.ko
directly on the root of the project.
the insert the module (must have root privileges):
insmod hellokernel.ko
and see the messages with:
dmesg
or, to get the messages in real time:
dmesg -W
Mostly inspired from the linux-kernel-module-rust repo, which gives a lot of informations, but is no longer working.