Contributing to the mainline kernel
In this book, we typically perform kernel development outside the kernel source tree, via the LKM framework. What if you are writing code within the kernel tree, with the explicit goal of upstreaming your code to the mainline kernel? This is a laudable goal indeed – the whole basis of open source stems from the community’s willingness to put in work and contribute upstream to the project.
Getting started with contributing to the kernel
The most frequently asked question, of course, is how do I get started? To help you precisely with this, a long and detailed answer lies within the official kernel documentation here: HOWTO do Linux kernel development: https://www.kernel.org/doc/html/latest/process/howto.html#howto-do-linux-kernel-development.
As a matter of fact, you can generate the full Linux kernel documentation (via the make pdfdocs
command, in the root of the kernel source tree); once successful, you will find this...