linux_kernel_hacking / 0.0_Basic /
@Harvey Phillips Harvey Phillips authored on 2 Jun 2020
..
Makefile test case for make 4 years ago
README.md add link 4 years ago
example.c basic lkm 4 years ago
README.md

Linux Kernel Hacking

0.0: Basic LKM Example

This is about as simple as it gets.

To use:

  • Build with make
  • Load with insmod example.ko
  • Check output in kernel buffer with dmesg
  • See the module loaded in lsmod | grep example
  • Unload with rmmod example.ko
  • Check the second output in the kernel buffer with dmesg

Alternatively:

  • Run make test and observe the two outputs as the module is loaded/unloaded.

NOTE: You'll need build-essential and linux-headers-$(uname -r) installed.

Followed along from here.