Simple kernel module for embedded Linux distros based on Poky.
Tested on Yocto 4.2 (mickledore) with kernel version : 6.1.38-yocto-standard
-
Install Yocto. You can read how to install here .
-
Clone this repo.
-
cp MyFirstAwesomeKernelModule <poky directory>
-
source oe-init-bulid-env
-
Add layer
bitbake-layers add-layer ../MyFirstAwesomeKernelModule/
-
Add to end of your local.conf
IMAGE_INSTALL:append = " awesome-mod"
-
Build image with
bitbake <image name>
- Install module with
su insmod /lib/modules/$(uname -r)/extra/awesome_module.ko address=<breakpoint address>
- For change breakpoint address
For read
su echo <address> > /sys/kernel/address/address
cat /sys/kernel/address/address
https://martin.uy/blog/hardware-breakpoints-in-the-linux-kernel-through-perf_events/
https://embetronicx.com/tutorials/linux/device-drivers/sysfs-in-linux-kernel/
https://devarea.com/linux-kernel-development-kernel-module-parameters/