One important part about learning how the Linux kernel works is understanding the details of the system's interface the kernel provides. In my opinion, there is no better book out there than the "Linux Programming Interface" by Michael Kerrisk: http://man7.org/tlpi/ It provides extremely detailed information about everything going on in Linux, as well as example programs and exercises to help you further your knowled…
Ask HN: Recommended resources to learn the Linux kernel and OS theory?
51–60 of 84 posts
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#52One important part about learning how the Linux kernel works is understanding the details of the system's interface the kernel provides. In my opinion, there is no better book out there than the "Linux Programming Interface" by Michael Kerrisk: http://man7.org/tlpi/ It provides extremely detailed information about everything going on in Linux, as well as example programs and exercises to help you further your knowled…
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#53The OSDev wiki can probably teach you anything you need to know about "OS theory" (and practice, mostly on x86): https://wiki.osdev.org/Expanded_Main_Page Depending on your style of programming, I'd recommend maybe not working on Linux if you are trying to learn kernel development and OS internals. Have you looked at Haiku ( https://www.haiku-os.org/ )? We have a very well organized and commented modular-monolitic ke…
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#54The OSDev wiki can probably teach you anything you need to know about "OS theory" (and practice, mostly on x86): https://wiki.osdev.org/Expanded_Main_Page Depending on your style of programming, I'd recommend maybe not working on Linux if you are trying to learn kernel development and OS internals. Have you looked at Haiku ( https://www.haiku-os.org/ )? We have a very well organized and commented modular-monolitic ke…
Function with 9 arguments, 200 lines. Mix of abstraction levels. Basically untestable. Could use RAII.
That's nothing, let me show you some of the ones in the VM...
> Mix of abstraction levels
What are you referring to here?
> Basically untestable.
Unit-testable, no. Integration-testable, absolutely; POSIX testsuites are not so hard to write. And this function is called (tens of) thousands of times per hour while you are using the OS, remember.
> Could use RAII.
It is already using RAII reference and lock objects, what improvement do you think could be had here? There are no exceptions in the kernel, so that's not a concern.
If this is your criticism of Haiku's kernel code ... go take a look at some of the equivalents in the BSDs or Linux, then. We are by far and away better than those by your metrics (especially as, you know, those are C and this is C++.)
But do these specific metrics matter? Probably not. "9 arguments" is not a mark against a function in all cases, neither is length or abstraction mixing. Those can and usually are bad, but kernels are a different ballgame altogether.
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#55Here's something I put together some years ago - it's about 5,000 lines of code and supports a number of key Unix features. There's a PDF of lecture notes accompanying it.
http://adelaideos.sourceforge.net/
Once you've gone through this you'll be in a better position to tackle the Linux kernel and books on OS architecture. My personal favorite is "The Design of the UNIX Operating System" by Maurice J. Bach. It's an old book but explains things well, and I believe it was one of the references Linux Torvalds relied on when creating Linux.
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#56The main thing I've done over the years to get reasonably 'good' at the Linux kernel (and quite a few other things) has been to read every technical article appearing in https://www.lwn.net/, every week, in full, even if I didn't really understand the material. I've been doing that since 1997, and it's paid off quite well.
Also: please buy a membership, even though you don't have to. It's well worth supporting.
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#57Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#58Also, Redox OS is an OS written in Rust and has a ton of wonderful documentation on it that's been helping me get into systems development: https://www.redox-os.org/docs/
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#59I learned more about OS from this book than any academic material used at the university and gave me a good foundational handle on *NIX's.
Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?
#60There is a textbook that goes along with it: https://www.pearson.com/us/higher-education/program/Tanenbau...
The author famously had interactions with Linus Torvalds when he was starting Linux!
And, Minix is inside every modern Intel CPU (https://www.zdnet.com/article/minix-intels-hidden-in-chip-op...).