Have you already gotten started with your LLM of choice, and need something more?
https://www.packtpub.com/authors/kaiwan-n-billimoria
I’m halfway into their first Linux Kernel Programming book and like it so far.
Linux kernel and its insides (https://0xax.gitbooks.io/linux-insides/content/index.html)
Designing BSD Rootkits
https://nostarch.com/rootkits.htm
FreeBSD Device Drivers
https://nostarch.com/bsddrivers.htm
Playing Games With Kernel Memory ... FreeBSD Style
Also get a random raspberry pi and a simple peripheral for it: some 1 wire temperature sensor or something on i2c.
Then ignore the existing drivers and do your own. Do a character device and have a read from it trigger a read in kernel and copying of the data to user space, maybe in human readable form.
Should be good practice.
And for general embedded Linux development you also want to take a look at Yocto.
Although it's based on 3.x kernel, it still is pretty relevant.
Good Luck!
If you want to try out VFIO, you could try writing a userspace program that interfaces with some simple PCI device, like a serial card.
QEMU is nice for learning because you can more easily debug kernel code with gdb.
More than half the value was in sending mails and getting feedback, but it's still a great introduction that gradually gets you used to more and more complicated kernel dev
There are solutions lying around on the internet for the various tasks, but I'd advise not looking. The kernel is sparsely documented (some areas, rigorously undocumented), so a bit of experience searching and figuring out how to get the information on your own is genuinely valuable
Both systems have code bases and build systems that will build root filesystem and kernels for a wide range of devices.
By following development of a device (aka target) that interests you, you will see how drivers are stabilized with various patches applied over time.
https://man7.org/tlpi/ This book is considered the best overview of linux kernel interface. Its old, but still gives a broad coverage of topics.
https://lkml.org/ Browsing LKML is really helpful since it shows you where current development is happening and how kernel devs think. Some conversations get very advanced and nuanced.
https://kernelnewbies.org/ is a good starting place for starting to compile and deploying kernel builds
Other than that, reading and tracing the source is probably the most productive thing to do for an experienced dev to do
If also choose some class of device and get to know it. Many Linux drivers are very similar across a class of devices. For example CSI cameras on top of V4L. Thankfully the code in the Linux kernel is very readable. Also it is well documented online.
I definitely recommend a good ide too.
978-0672329463
- Still trying to find the How To Build a Formally Verified Kernel Module from Zero tut
Edit:
- /? Kernel module https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
- "Linux Kernel Module written in Scratch (a visual programming language for kids)" (2022) https://news.ycombinator.com/item?id=31921996 (EduBlocks is Scratch with Python blocks and/or text code)