Live data from Hacker News

Ask HN: Recommended resources to learn the Linux kernel and OS theory?

news.ycombinator.com

81–84 of 84 posts

Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?

#81
post #52

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…

£50 on kindle! Looks like a great book, but that’s punchy. (Maybe that’s standard for a text book like this, not something I would normally buy)

It's a huge book (1552 pages), much larger than even your average OS textbook. It's more like a Linux encyclopedia.

Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?

#82

The 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…

> modular-monolitic kernel This sounds like a bit of an oxymoron. What is a modular-monolithic kernel?

"Monolithic" refers more to the way drivers and the kernel interact, i.e. if drivers live in the kernel address space, can read/write all kernel memory, call functions in other drivers, etc., then it's a monolithic kernel. If instead each driver is its own process with address space, and calls into the kernel via syscalls like any other process, then it is a microkernel.

"Modular" refers to linkage and overall design. The Linux kernel is mostly "statically" linked (there is DKMS but it isn't so widely used) with most major systems in the "kernel" itself, and something similar is true in the FreeBSD world.

Haiku, on the other hand, has a rather small (2.2MB binary on i386) kernel with no drivers built in at all (not even PCI); and loads all its drivers as relocateable shared-objects. This means unloading and reloading kernel modules at runtime (or boot) is very easy; so as long as you don't crash or hang the system, you can keep reloading drivers as much as you like without rebooting.

I know macOS also uses dynamic kernel modules, but I'm not as familiar with that system.

Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?

#83
post #66

Earlier quoted context omitted.

I and most of the other developers hang out on Freenode#haiku, and of course on our mailing lists. Come say hello and get involved, indeed. More than happy to teach :)

I really love to see this kind of stuff within the community. I'd really love to take you up on this offer sometime :)

Hey, please do! Onboarding new people and teaching skills is fun, and learning them while working on a project people actually use for day-to-day work is even more fun.

I idle in #haiku on Freenode, so ping me there and I'll usually reply soon enough. :)

Re: Ask HN: Recommended resources to learn the Linux kernel and OS theory?

#84
post #44

The 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…

> I'd recommend maybe not working on Linux if you are trying to learn kernel development and OS internals. Could you also tell why ?

Complexity.

Start with something where you can substantially wrap your head around the whole thing, like XV6 or Minix, and it's vastly easier to look at chucks of something like Linux and see "oh, this fits into the mental picture here". For me, in the mists of the old days, learning Unix V6 out of the Lyons books (very slim volumes of annotation...wonderful stuff) make it easy to understand what was going on in V7, which made 4.2BSD and progeny accessible, which made SVR[234] somewhat weird and different, but still conceptually understandable, which made most everything Unix-ish afterword (including Linux) something you still had the vernacular to understand.

Now...to be fair...this leaves out a lot of really valuable OS knowledge. There's no IBM large system OS (e.g VM/370->z/OS, VM/CMS, TPF). No Seven Dwarfs OS (DEC VMS, Burroughs B-series, DG Nova, CDC NOS, etc.). Nothing for the really interesting Lisp or Smalltalk machines, the Perq or the Mesa/Cedar workstations. No interesting small systems OS: OS/2, classic MacOS, OS-9, much less the Windows NT family. Much less any of the embedded/RTOS world.

But you can still learn alot.

Post reply on HN