The first project is the minimal, loadable kernel module, and so it is called boilerplate. It will just print a message when the module is loaded and another message when it is unloaded.
In the boilerplate folder, there are the following source files:
- Cargo.toml: The build directives for the Rust project
- src/lib.rs: The Rust source code
- Makefile: The build directives to generate and compile the C language glue code and to link the generated object code into a kernel module
- bd: A shell script to build a debug configuration of the kernel module
- br: A shell script to build a released configuration of the kernel module
Let's start with building the kernel module.
Building and running the kernel module
To build the kernel module for debugging purposes, open the boilerplate folder and type in this command:
./bd
Of course, this file must have executable permissions. However, it should already have them when it is installed from the GitHub repository.
The first time...