-
Clone the stable kernel
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git -
Create a new branch and make changes in that branch. Commit your changes.
-
Create a config file for your distro, and then compile and install your kernel to make sure everything works.
-
To submit your changes, you need to make a patch out of your commit. Each subsystem of the kernel has its own maintainer(s). To find out the maintainer for your subsystem, you can use the 'get_maintainer.pl' script bundled with the kernel.
-
To get your patch ready, use the following command. After a patch is generated, you need to add details to it explaining why changes are required.
git format-patch -1 --to= --to= --cc= --cc=
While learning about the kernel, I have come across various resources apart from main documentation.
- LDD3 book : https://lwn.net/Kernel/LDD3/
- Linux kernel development book (3rd edition)
- LKMPG : https://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html#AEN121
- LKMPG latest version : https://github.com/sysprog21/lkmpg
- https://blog.cloudflare.com/the-tale-of-a-single-register-value/
- https://blog.twitter.com/engineering/en_us/topics/open-source/2020/hunting-a-linux-kernel-bug
- http://www.vegardno.net/2016/08/sync-debug.html
- https://www.desmondcheong.com/blog/2021/06/02/decoding-stack-traces-in-the-linux-kernel/
- https://www.datastax.com/blog/how-we-tracked-down-linux-kernel-bug-fallout
- https://engineering.skroutz.gr/blog/uncovering-a-24-year-old-bug-in-the-linux-kernel/
- https://netflixtechblog.com/debugging-a-fuse-deadlock-in-the-linux-kernel-c75cd7989b6d
IMAGE="/home/gautam/fun/linux/programming/image"
qemu-system-x86_64
-m 4G
-smp 2
-kernel /opt/linux/arch/x86/boot/bzImage
-append "console=ttyS0 root=/dev/sda earlyprintk=serial net.ifnames=0 kasan.fault=report"
-drive file=$IMAGE/buster.img,format=raw
-net user,hostfwd=tcp::10021-:22 -net nic
-enable-kvm
-usb -device qemu-xhci,id=xhci -device usb-host,hostdevice=/dev/bus/usb/001/003 -nographic -pidfile vm.pid 2>&1 | tee vm.log