
Linux Inside – How the Linux Kernel Works - SebNag_
https://0xax.gitbooks.io/linux-insides/content/
======
classybull
Every time I start to fall into the conceit that I'm an exceptionally good
developer, I look at things like kernels or low level hardware programming and
eat a big ol' slice of humble pie.

~~~
ams6110
Why? It's just a different level of detail than you're used to. It's not
magic.

~~~
kpxxx
As someone that used to do kernel and RTOS development for many years and then
migrated into web and app dev for a living because it allowed a more flexible
lifestyle for paying the bills - this equivocation is disingenuous.

There is some room for disagreement, but I agree with most of the following.
[https://developer.apple.com/library/content/documentation/Da...](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/keepout/keepout.html)

Kernel development, similar to algorithmic trading (incl HFT), some types of
games, various embedded, actual production compilers etc requires a higher
level of rigorous understanding from a variety of areas compared to the vast
majority of webapps (often CRUD) and most software that IT professional work
on. Kernel dev similar to other performance critical or safety critical
systems has a much reduced set of tradeoffs and more numerous constraints, for
one.

Of course, most applications require knowledge in disciplines such as design
and domain specific knowledge that kernel development does not require, but
that is besides the point. It requires a different type of thinking overall
(one that is more unforgiving to lack of rigor and not as open to subjectivity
cf. design) that low-level systems development/engineering and most app
development are virtually unrelated disciplines outside of trivial
similarities relating to them both targeting computers.

I don't say this to discourage anyone. But these reductions are unhelpful and
outright condescending to those that might struggle to learn (oh it's just a
slightly different domain than your JS TODO app....um no it's not.. it's
harder for you to learn because it is actually harder and more complex).

~~~
appleflaxen
> this equivocation is disingenuous

i'm super confused. what equivocation are you refering to?

~~~
rolandog
I think he may have meant equiparation.

------
WhoBeI
Nice. Way back in the day, maybe 20-25 years ago, I had a first look at the
boot process and wish I'd had something similar to the first chapter then.
Man, it was hard to find information and ones you did you realized
understanding it meant learning an entirely new subject.

Those were the days really. Barely having started my English studies I went
looking for a single piece of information and found so much else on the way..
The tinkering and nights of frustration gave insights and a feeling of
accomplishment that set me on the path to the profession I have today.

Then I started high school and someone showed me a shaded and textured cube
they had rotating on their screen and I found out what math is good for :)

------
dom0
Besides some scattered text files and the Linux man pages, there is this:
[https://www.kernel.org/doc/html/latest/](https://www.kernel.org/doc/html/latest/)

It's fairly new - started about a year ago, but there's quite a lot of stuff
in there already (bootstrapped from the old XML stuff, I believe).

~~~
SunnySkies
... That guide is actually fucking hilarious.

'However, that’s not too bad, because even the makers of GNU indent recognize
the authority of K&R (the GNU people aren’t evil, they are just severely
misguided in this matter)'

~~~
mindcrime
_but the preferred way, as shown to us by the prophets Kernighan and Ritchie,
is to put the opening brace last on the line, and put the closing brace first,
thusly:_

So much for the idea that kernel developers are super-smart programming
"gods". Formatting code that way is brain-dead and Kernighan and Ritchie are
false prophets. The _real_ prophet, Allman, tells us the Truth - curly braces
go on a line by themselves, aligned vertically and indented to the same level
as their corresponding control structure.

~~~
int_19h
These theories were ultimately settled by trial by combat between the
champions representing each: Linux and BSD. Linux has clearly won this battle,
and thus, the gods have spoken. ~

------
rimher
I've taken a class in college about the Linux kernel, and it's still amazing
to see how complicated it actually is.

I've got a fairly good idea of how many pieces work, but the whole thing
together still puzzles me at times.

I think that it's one of the biggest achievements of the internet as a tool
for progress, and it shows that good intentions and pragmatism (together with
some good Linus insults as well) can go a long way

~~~
amluto
> I've taken a class in college about the Linux kernel, and it's still amazing
> to see how complicated it actually is.

Complexity doesn't necessarily mean it's a masterpiece. A lot of it is just
old and has been incrementally changed without being simplified in the mean
time.

As a concrete example, the guide goes through the rather complicated mess of
how syscalls worked. That complexity was the result of a series of
optimizations and features added over time, but it wasn't a good design. These
days Linux syscalls (on x86_64 anyway) are a good deal simpler than they are
in the guide.

(Hey 0xAX, I don't suppose you'd like to update the guide?)

~~~
jcrben
I'm not 0xAX, but care to make a pull request to get the ball rolling?

------
chris_wot
I love this work, it inspired me to work on Inside LibreOffice.

[https://www.gitbook.com/book/chrissherlock1/inside-
libreoffi...](https://www.gitbook.com/book/chrissherlock1/inside-
libreoffice/details)

~~~
pcunite
_In fact, StarView was in essence what we now call the Visual Components
Library (VCL)_

Any relation to the Borland/Delphi VCL?

~~~
oneweekwonder
Does not look like it.

[https://github.com/LibreOffice/core/tree/master/vcl](https://github.com/LibreOffice/core/tree/master/vcl)

But I can see clear lines for confusion.

~~~
dkarapetyan
clear lines. confusion.

------
i_have_to_speak
Oh my God, the first article has a link to Ralph Brown's Interrupt List. Good
ol' days!

[1] [http://www.ctyme.com/intr/int.htm](http://www.ctyme.com/intr/int.htm)

~~~
marcelnita
Holy shit, yeah. Last time I looked at those pages was like 15 years ago.

------
Lasokki
Torvald's thesis on portability of Linux is also a quite interesting article

[https://www.cs.helsinki.fi/u/kutvonen/index_files/linus.pdf](https://www.cs.helsinki.fi/u/kutvonen/index_files/linus.pdf)

------
adamzegelin
Is there any documentation that talks about x86_64 and the modern UEFI boot
process? This guide still talks about BIOSs, MBRs, real mode, 16-bit
registers, etc.

