Skip to content

Hello world "driver"

This is an example of how to load/unload a driver into the kernel. It's not a real driver, but a simulation.

How to?

Firstly, go to the project:

cd hello-world

Compile the "driver" by:

make

Then install it in the kernel:

sudo insmod hello-world.ko

To verify that it is loaded by the kernel, run:

dmesg | tail
and look for your output message from the __init hello_init function (in this case: Hello, World!)

To remove/unload it, run:

sudo rmmod hello_world
and check for your output message from the __exit hello_exit function (in this case: Goodbye, World!) with:
dmesg | tail

To clean up, run:

make clean