I am a beginner learning about the Linux kernel, any advice?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a beginner learning about the Linux kernel, any advice?
So, I jut started learning about the Linux kernel. I have setup a GDB environment and want to learn more about the system internals of the kernel. Basically, I am interested in taking apart the the machine and putting it back together. All while understanding what is going on internally. Any advice for someone like me? Somebody who wants to learn how the kernel works. Is GDB even necessary?
Kernel is the OS. I suggest you get acquainted with it first. IMHO the best way to do it is getting sources and then starting with minimal configuration 'make allnocnfig'. From there start adding options and functions until you have a working kernel, read up on every option, don't rush. Then you will have vital knowledge of kernel structure and functionality and can start diving deeper.
> understanding everything, from the *very bottom up*!!!
Sounds like me, although I'm barely 2% of the way along the full Journey.
My idea is two directions:
1) study documentation on the syscalls and use strace (man 2 intro)
I think you would want to understand what the kernel is and does, before you start to build/configure/modify it
> understanding everything, from the *very bottom up*!!!
Sounds like me, although I'm barely 2% of the way along the full Journey.
My idea is two directions:
1) study documentation on the syscalls and use strace (man 2 intro)
I think you would want to understand what the kernel is and does, before you start to build/configure/modify it
Go get a book - which one depends on what you intend to do/learn. The kernel is ridiculously dynamic - just look at the patchlist for each release. Any book you get is instantly out of date, but will be useful none-the-less.
I haven't looked recently, but let's say in round numbers the kernel is 25 million (yep, you read that right) lines of code. Pick something that interests you and concentrate on that - could be scheduler, block device drivers, swap, memory management, boot, whatever. Whatever you pick will be getting updates all the time, which can be bloody frustrating when you are trying to learn the code. Stick with it.
As it happens there are now some really quite good tracing tools for the kernel that make life much easier to get involved without knowing all the gory details of the code - I couldn't believe my luck when BPF became available.
Tip: You need to go thru all options and when you are finished you have to repeat, during first round you enabled options and these made more options visible. And then third round. After third you should have a working kernel.
You didn't think you can get it done in one afternoon, did you?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.