This is widely considered the "gold standard" for beginners. It focuses on the basics of Loadable Kernel Modules (LKMs). Hello World modules filesystem, system calls, character device drivers, and interrupt handlers : Actively maintained for 5.x and 6.x kernel versions.
For dynamic tracing without modifying code. linux kernel programming pdf github high quality
Published by O'Reilly and made available as a free PDF download under the Creative Commons license, "LDD3" is the definitive manual for writing drivers. Note that you will need to cross-reference its code samples with modern GitHub repositories, as API signatures for functions like alloc_chrdev_region have changed since publication. This is widely considered the "gold standard" for beginners