7 ms·
Question, where does one start, when planning to read the Linux kernel? There is so much code. I have read it, but randomly. I have read contents of net/ kernel
by ryanmccullagh 8y ago
Question, where does one start, when planning to read the Linux kernel? There is so much code. I have read it, but randomly. I have read contents of net/ kernel.
I have read the main method where it attempts to launch pid1 of /bin/bash, etc.
Is there a really good place to start reading? For example how does Linux talk to the hard drive?
What's the first thing that happens in the kernel?
- seotut2 8y agoWell, some famliarity with the hardware doesn't hurt. Years ago when I studied the Linux kernel myself, I started with qemu, and the gdb stub, and walked line-by-line through the boot process. But as others suggest, taking an older version, or even simpler unices(xv6,netbsd) might be easier.
- varjag 8y agoStart skimming through the included documentation files. You don't have to do a thorough read, but the Documentation folder is structured in a way mirroring the organization of the kernel. They will help you to understand the structure, and you can get deeper understanding of the essential parts that way. Once you have mental map of major areas of the kernel it will be easier to relate to the sourcetree. There used to be a number of great books on fairly esoteric issues of the kernel (like, comprehensive explanations of network stack). However most of them seem to be stuck at 2.6 and are no longer very up to date.