|
|
|
|
|
by lucaslee
2760 days ago
|
|
I saw the Linux kernel was recommended many times here, but how many people actually read it? Where do you even start? The Linux kernel has around 60,000 files and 25 million lines of code... I think smaller projects are better for learning purposes. If you are interested in reading some smaller projects, check out my project here https://github.com/CodeReaderMe/awesome-code-reading. |
|
Some ways you can start:
- Here is start_kernel(), the kernel entry point after booting up and handling the lowest level stuff in asm: https://github.com/torvalds/linux/blob/v4.19/init/main.c#L53...
- grep for SYSCALL_DEFINE to find definitions of syscalls, e.g. this is open(): https://github.com/torvalds/linux/blob/v4.19/fs/open.c#L1076
(understanding how the I/O and networking system calls work is quite helpful for application developers, even if you work in node.js, python or another high level language)
- this is the struct that represents each process in the system, you can pick some interesting field and search for where it is used and where updated: https://github.com/torvalds/linux/blob/v4.19/include/linux/s...
Finally, the linux-insides book is pretty helpful: https://0xax.gitbooks.io/linux-insides/