6 ms·
Ask HN: I'd like to start reading the Linux source code. Where should I start?
- LinuxBender 3y agoWithout more details I assume you just want the source code and documentation. One could either clone the repositories [1] or just browse the CDN access to the docs and kernels. [2] The latest kernel is in the v6.x directory. [1] - https://github.com/torvalds/linux https://github.com/torvalds/linux [2] - https://cdn.kernel.org/pub/linux/kernel/ https://cdn.kernel.org/pub/linux/kernel/
- rahimnathwani 3y agoThis older comment thread may be useful: https://news.ycombinator.com/item?id=19225268 https://news.ycombinator.com/item?id=19225268
- cf100clunk 3y agoHave you considered ''Linux From Scratch'' as an element of your research? https://www.linuxfromscratch.org/ https://www.linuxfromscratch.org/ Building a Linux kernel and system with your own specific configuration tweaks may reveal things that the best of books, manuals, courses, etc. might not cover.
- ginto 3y agoLinux Core Kernel Commentary: Guide to Insider's Knowledge on the Core Kernel of the Linux Code https://www.amazon.com/Linux-Core-Kernel-Commentary-Knowledge/dp/1576104699 https://www.amazon.com/Linux-Core-Kernel-Commentary-Knowledg... Understanding the Linux Kernel, Third Edition 3rd Edition https://www.amazon.com/Understanding-Linux-Kernel-Third-Daniel/dp/0596005652 https://www.amazon.com/Understanding-Linux-Kernel-Third-Dani...
- ftxbro 3y agofind something you don't like about linux and try to track down where that thing is to fix it
- deaddabe 3y agoAnd to track that down, use https://elixir.bootlin.com/linux/latest/source https://elixir.bootlin.com/linux/latest/source to ealisy browse between kernel version, functions, etc..
- molteanu 3y agoSince you do not mention if you're already a pro with OS internals and implementations, I will assume, maybe incorrectly, that you're not. So in that spirit, try the XinuOS. It has the complete source code for a minimal, clean and practical OS. Search for the book explaining it inside out. xv6, a re-implementation of Dennis Ritchie's and Ken Thompson's Unix Version 6 (v6) also comes to mind. And C. Don't forget to sharpen your C skills.
- 8589934591 3y ago> XinuOS Did you mean https://en.wikipedia.org/wiki/Xinuos https://en.wikipedia.org/wiki/Xinuos or https://www.amazon.in/Operating-System-Design-Approach-Second/dp/1498712436 https://www.amazon.in/Operating-System-Design-Approach-Secon... ?
- molteanu 3y agoYes, that's the book. The source code is open-sourced, https://xinu.cs.purdue.edu/ https://xinu.cs.purdue.edu/
- bombcar 3y agoUnderstanding the Linux Kernel, Third Edition is now horribly out of date, but it's a good place to start if you've never read it before.
- wmf 3y agoSomething I've done a couple times is trace the execution of a system call by reading the code. LXR is really helpful.
- Agingcoder 3y agoRead the Linux programming interface by Michael Kerrisk. It will tell you what Linux should be doing for you ( the api basically and what subsystems exist). Read lwn, kernel newbies to get a feel of what’s happening in the kernel. Get knowledge of operating systems ( I like the minix book by tanenbaum ). Learn about Linux internals ( I like linux kernel development by Robert love) Then, pick bits you’re interested in and jump !
- unmole 3y agoLinux Kernel Development by Robert Love. It's spectacularly out of date but is still a good starting point. And Elixir is very helpful for browsing the source code and comparing chnages across kernel version: https://elixir.bootlin.com/linux/latest/source https://elixir.bootlin.com/linux/latest/source