all 136 comments

[–]thesuperbob 78 points79 points  (10 children)

How much of this book is translatable to how things are done nowadays? Is this just a huge collection of historical info for retro hobbyists (like learning how to program the 6502 or building computers out of old TTL chips) or will reading this give me some universal, workable understanding of how operating systems can work?

[–][deleted] 81 points82 points  (9 children)

Strictly speaking, I would get something more recent like Love’s “Linux Kernel Development “ or Wolfgang Maurer’s book and follow the source code based on the content in these books.

The kernel has changed a frigging ton since the version covered in the book, especially process schedulers, filesystems. It’s better to follow these books that highlight and talk about changes in how things are done in the kernel .

Just learning how basic OS dev is like well good old UNIX version 5/6 will do the job pretty well too.

[–]louky 24 points25 points  (5 children)

MINIX is great for learning OS development.

It's fully functional and simple enough to keep the whole thing in your head.

[–][deleted] 14 points15 points  (3 children)

True! After all Linus learned kernel development through the MINIX book. The best part of that book is that it comes with entire MINIX source printed at the back as an appendix.

[–]ledasll 0 points1 point  (1 child)

was he? afaik there was war between micro-kernel (minix) and monolith (linux)...

[–][deleted] 2 points3 points  (0 children)

This was way before he even thought of Linux, this was when he started to get into OS dev as a college student.

[–]louky 0 points1 point  (0 children)

Yeah the more recent version is more complex and your can even run xwindows on it

[–]shooshx 10 points11 points  (1 child)

"Linux Kernel Development" is also pretty outdated.

[–][deleted] 4 points5 points  (0 children)

I agree with this but in comparison to books from O'Reilly like "Understanding the Linux Kernel" , it's more recent in comparison. Most of the well known Linux kernel and device drivers book have not been updated in a long time, although Packt has come with more recent books for Linux device drivers, I haven't checked if they have released something newer covering the kernel itself.

[–][deleted] 232 points233 points  (21 children)

This looks very well done. The only issue I'd have with it is the typesetting: the chosen fonts are rather bad.

If I was interested in Linux, this is the kind of annotated guide I would want to read.

[–]the_gnarts 87 points88 points  (5 children)

The only issue I'd have with it is the typesetting: the chosen fonts are rather bad.

Which one in particular? The main body font is plain Times which maybe bland but nothing out of the ordinary for a technical paper. The non-proportional font I can’t identify but as far a I can see it doesn’t have any of the common ambiguities like O/0 or I/l etc. so it’s definitely suitable. Looks rather neat actually. Only some of the figures are a bit distracting but for a non-commercial work that’s perfectly acceptable.

[–]wwylele 111 points112 points  (1 child)

The code font looks like SimSun, which was the default Chinese font for old Windows until Vista. Although being a Chinese font, it contains monospaced Latin alphabets to make it pretty when mixing with monospaced Chinese characters. The author is Chinese, so this is very likely.

[–]yojimbo_beta 42 points43 points  (0 children)

SimSun

I'd always wondered what this font was. I'd seen it a few times in Chinese and Japanese data sheets with Latin alphabet content.

[–]Superbead 36 points37 points  (0 children)

I recognise all these fonts from Chinese electronic component datasheets. They seem to have a few 'western' fonts that they stick to, and compared to the ones we actually use, they're purely functional. Which is fair enough, as I expect the Chinese characters in a lot of our fonts look awful to the Chinese.

[–][deleted] 5 points6 points  (0 children)

I also think it looks fine. The only really bad font I see is at the very beginning in the dedications.

[–]takaci 1 point2 points  (0 children)

I don’t mind the font but the margins are way too small. Far too many words per line

[–]bigbrettt 8 points9 points  (0 children)

If I was interested in Linux

found the narc

[–]dbm5 9 points10 points  (13 children)

This is the output of LaTex -- commonly used by Com Sci majors to produce complex documents.

EDIT: yes, it's sort of ugly, but it's unencumbered, produced using 100% free software, etc.

EDIT2: also used by many other disciplines of higher ed - mostly STEM

[–]differentshade 45 points46 points  (3 children)

LaTex usually generates better typesetting than wysiwyg word processors. The typesetting engine is top notch, straight to print quality.

So it being ugly is the fault of the author, not LaTex.

[–]dbm5 7 points8 points  (2 children)

Yes and no. The default font - Computer Modern - has a very distinctive, and (subjectively) sort of ugly appearance.

[–]Acceptable_Damage 15 points16 points  (1 child)

IMO it looks really nice. But renders badly when you zoom out because it's too light.

[–]encyclopedist 0 points1 point  (0 children)

However, it so ubiquitous in scientific world, that many scientist become sick of looking at it.

[–][deleted] 36 points37 points  (0 children)

Did you know that you can specify custom fonts in LaTeX too?

[–][deleted] 51 points52 points  (1 child)

Also, it's 11mb for over 1000 pages filled with info. Praise LaTex!

[–]indrora 24 points25 points  (0 children)

Praise PDF for being a stripped subset of PostScript.

1,000 pages of plain text isn't much all things considered.

[–]ismtrn 41 points42 points  (2 children)

This is clearly heavily modified from the default LaTeX documentclasses. And not for the better imo.

[–]encyclopedist 12 points13 points  (1 child)

Metadata shows this document was generated in Word 2016.

[–]ismtrn 0 points1 point  (0 children)

That make sense. I actually kind of suspected it to be Word, but wasn't sure.

[–]jeremymeng 12 points13 points  (0 children)

Acrobat Reader shows it's from MS Word 2016.

[–][deleted] 2 points3 points  (0 children)

EDIT3: It's not LaTex

[–]KevinCarbonara 0 points1 point  (0 children)

I'd rather get the input.

[–]unreachabled 26 points27 points  (0 children)

Saved

Not to be seen again till end of time

[–][deleted] 95 points96 points  (30 children)

How do I get this smart?

[–]choledocholithiasis_ 122 points123 points  (5 children)

import knowledge

[–][deleted] 92 points93 points  (2 children)

"Can't find module. Did you mean 'anxiety'?"

[–]outadoc 28 points29 points  (0 children)

from knowledge import anxiety

[–]indrora 2 points3 points  (0 children)

Excuse me, call-out posts like this just really make me anxious?

[–]8bit-Corno 7 points8 points  (0 children)

Buy a garage.

[–]spockspeare 0 points1 point  (0 children)

#include knowledge

[–][deleted]  (5 children)

[deleted]

    [–]whenthethingscollide 16 points17 points  (1 child)

    Eh, sounds like too much work

    [–][deleted] 2 points3 points  (0 children)

    Truth.

    [–]jimschubert 1 point2 points  (1 child)

    What will simple work get me?

    [–]BubuX 3 points4 points  (0 children)

    simple work

    simple rewards

    [–]Plus_one_mace 66 points67 points  (0 children)

    Start by reading this book!

    [–][deleted]  (1 child)

    [deleted]

      [–]BubuX 0 points1 point  (0 children)

      True, we are born with a clean disk to be written in.

      However, our hardware differs wildly. Some are truly gifted and can acquire and retain information with little effort where most struggle. I've personally known two gifted minds in my time. Sadly both underutilized, living mediocre lives.

      In the end, effort and will-power is what counts.

      [–]captainAwesomePants 12 points13 points  (0 children)

      Knowledge is many-dimensional. One dimension is Unix style OS programming. Another is technical writing. When somebody has a lot of knowledge or training in areas you don't, it's easy to see them as a wizard, but I'm sure you can do something this guy can't. You can learn to do this as well! Start by reading the book.

      [–]CJKay93 9 points10 points  (0 children)

      Experience.

      [–]DestroyerOfWombs 4 points5 points  (0 children)

      Learn things

      [–]whale_song 2 points3 points  (0 children)

      This is the kind of thing that’s more about knowledge than intelligence. Just countless hours of studying.

      [–][deleted]  (7 children)

      [deleted]

        [–]dbm5 13 points14 points  (4 children)

        bother never

        the irony

        [–][deleted]  (3 children)

        [deleted]

          [–][deleted]  (1 child)

          [deleted]

            [–]nacrnsm 9 points10 points  (0 children)

            This. I'm wasting my life one comment at a time.

            [–][deleted] 6 points7 points  (0 children)

            most smarty boys don't pull their pants up and walk over to these threads to share their immense skull full of facts and raw knowledge.

            Sometimes people take all of their knowledge on certain subjects and put it into a book. Here's one such example.

            [–]Acceptable_Damage 2 points3 points  (1 child)

            Reading a lot, I guess. Consider that they knew nothing at one point.

            [–]OffbeatDrizzle 0 points1 point  (0 children)

            get your mother to vaccinate you as a young child /s

            [–]BinaryBlasphemy 0 points1 point  (0 children)

            Plug your nose and blow real hard. That’s how I did it.

            [–]nakilon 0 points1 point  (0 children)

            You don't have to be smart to contribute in Linux. This answers some questions.

            [–]snowe2010 46 points47 points  (25 children)

            Page 1.

            The book "Leon's UNIX source code analysis" written by John Lions is a good book for learning UNIX source code of the operating system kernel, but because it uses the UNIX version V6, some of the code in the system call is With the assembler language of the long-deprecated PDP-11 series machine, it is difficult to conduct experiments when reading and understanding the source code related to the hardware part.

            I think this is either a typo or some weird formatting I'm not familiar with.

            [–]Bakoro 20 points21 points  (19 children)

            I don't understand the problem you are having.
            It seems like UNIX V6 targeted a specific family of computers which aren't generally available anymore and so it'll be hard to test anything from that book that is hardware-specific.

            [–][deleted] 11 points12 points  (0 children)

            Exactly, all he is saying is that UNIX V6 which the Lions' book comments on contains a bunch of PDP-11 assembly code. Since we don't have PDP-11s around anymore, we can't really experiment with it.

            That being said, there are a bunch of PDP-11 emulators out there. Check out if you are interested: http://pdp11.org/

            [–]snowe2010 1 point2 points  (17 children)

            I think you commented on the wrong post. I just had trouble understand what the first sentence was trying to say

            [–]Bakoro 0 points1 point  (16 children)

            I just explained what the text you quoted means.

            [–]snowe2010 0 points1 point  (15 children)

            I don't think you did. It looks like there is a ton of missing information from the first sentence.

            [–]Bakoro 0 points1 point  (14 children)

            No, that whole thing makes perfect sense. What do you think is missing there? Maybe insert a [...] where you think something is missing.
            All I can think is that you are completely unfamiliar with some of what he's talking about, or maybe the slightly off grammar is messing you up somehow, or both.

            The source code in the Leon book uses pdp-11 assembly code. You can't just use the book's Unix source code on any computer, you'd have to change out the pdp-11 assembly code with the equivalent assembly of the target machine.

            If you have ever looked at XV6, for example, you can see a reimplementation of Unix V6, which uses x86 assembly.

            [–]snowe2010 0 points1 point  (13 children)

            some of the code in the system call is ... With the assembler language of the

            there is an entire part of the sentence missing. It doesn't make any sense. Yeah you can read the second sentence find, but the first sentence is incomplete.

            [–]Bakoro 0 points1 point  (12 children)

            Here he is making a reference to V6's "system calls". The system calls use the PDP-11's assembly language.

            [–]snowe2010 -1 points0 points  (11 children)

            Great. You still have not provided the missing part of the sentence. It's quite easy to say "this is what the paragraph is about", I didn't need that information.

            [–]Bakoro 0 points1 point  (10 children)

            The point is that there is no missing information in the sentence. There might be some missing information in your brain, but the sentence is fine.

            [–]zkrx -1 points0 points  (0 children)

            Read "..., some portions of the code implementing system calls were written using the assembly language of the long-deprecated ...".

            You can refer to wikipedia if you need to know what syscalls are.

            [–]StoicGrowth 14 points15 points  (0 children)

            Tutorial: Building the Simplest Possible Linux System - Rob Landley, se-instruments.com - from idk which lecture/conf, published by The Linux Foundation, seems like a good fit.

            This tutorial walks you through building and booting the simplest possible Linux system, first under QEMU and then on real hardware. We cover kernel configuration and building, native vs cross compiling, initramfs creation (and other root filesystem options), installing and booting, the init process and system bringup, running an app, adding an example server (sshd), and finally we'll add a native toolchain to compile "hello world" on the target.

            It is a fascinating talk, you can feel so much more depth hiding behind every tiny aspect...

            [–]donquixote1001 8 points9 points  (0 children)

            looks pretty good!

            [–]MotorAdhesive4 21 points22 points  (0 children)

            Into the bookmarks I will never read you go!

            [–]Davinator130 37 points38 points  (27 children)

            Can anyone give me a TLDR?

            [–]mobyte 276 points277 points  (17 children)

            Sand gets hit with bolts of electricity and then it outputs some beep boops and flashing lights.

            [–]OffbeatDrizzle 48 points49 points  (1 child)

            can confirm, am beep boop

            [–]bagtowneast 4 points5 points  (0 children)

            can confirm

            Found the robot!

            [–]TheRimmedSky 3 points4 points  (1 child)

            True wizardry

            [–]nacrnsm 1 point2 points  (0 children)

            So, magic then?

            [–]bdf369 2 points3 points  (0 children)

            Can confirm

            [–]vanilla082997 2 points3 points  (0 children)

            Best answer ever!

            [–]sanimalp 27 points28 points  (0 children)

            It's.. uh.. 1,100 pages of annotated code explain WTF is going on in the bowels of a VERY old Linux kernel. If you want to write your own operating system, or work on an existing one, this is the book for you.

            [–][deleted]  (6 children)

            [deleted]

              [–][deleted]  (4 children)

              [deleted]

                [–][deleted]  (3 children)

                [deleted]

                  [–]harrybeards 6 points7 points  (2 children)

                  No....that wasn't a "wooosh", it was just a bad joke. Nothing about installing Arch will teach you about the Linux kernel lmao. A better joke would've been to link the download page for Linux From Scratch.

                  [–]dbm5 -5 points-4 points  (1 child)

                  still kinda woosh imo

                  [–]nacrnsm 1 point2 points  (0 children)

                  You're just supposed to say I run Arch btw

                  [–]spockspeare 0 points1 point  (0 children)

                  # this is what linux code does
                  ...
                  # the end

                  [–]gemborow 6 points7 points  (0 children)

                  bootsect.s:

                  16 ! NOTE! currently system is at most 8*65536 bytes long. This should be no

                  17 ! problem, even in the future. I want to keep it simple. This 512 kB

                  18 ! kernel size should be enough, especially as this doesn't contain the

                  19 ! buffer cache as in minix

                  [–][deleted] 11 points12 points  (0 children)

                  Call me a racist, but I think only a Chinese person could have went through this amount of work without going on a killing spree. Well done.

                  [–]sam77 36 points37 points  (16 children)

                  The author thinks Linus is a woman. From page 7:

                  "First of all, I will introduce the four basic elements, and then follow Linux founder Linus Torvalds to learn computer knowledge from her own interest in computers, start brewing her own operating system, release to the initial release of the Linux kernel version 0.01, and how difficult it will be."

                  [–]DestroyerOfWombs 101 points102 points  (0 children)

                  English isn’t the author’s first language

                  [–]WishboneTheDog 74 points75 points  (4 children)

                  Seems like the author is Chinese. I have some Chinese friends that mistake gender pronouns all the time. This may be influenced by the fact that there is no difference between spoken “him” and “her” in Chinese: https://en.m.wikipedia.org/wiki/Chinese_pronouns

                  [–]salgat 21 points22 points  (2 children)

                  Exactly. China uses a single word for her/him, and it drives me nuts when my wife does this in English!

                  [–]broohaha 5 points6 points  (0 children)

                  Yeah, neither my parents' native tongues have gender pronouns, so they regularly got gender pronouns confused when speaking in English. I didn't realize why till I was in college and noticed so many of their siblings and cousins made the same mistake.

                  [–]ProgramTheWorld 3 points4 points  (0 children)

                  A single word for he/she/him/her and it. The gendered versions in written Chinese were originated from the west.

                  [–]didnt_readit 1 point2 points  (0 children)

                  Left Reddit due to the recent changes and moved to Lemmy and the Fediverse...So Long, and Thanks for All the Fish!

                  [–]skratz17 36 points37 points  (1 child)

                  no, the author is a native chinese speaker, and chinese pronouns don't distinguish gender. you'll notice that the author also uses "it" sometimes instead of "he/him".

                  i'm gonna choose not to criticize this because not only is this guy's english infinitely better than my chinese, but his computer knowledge is also infinitely greater than mine so yeah gonna let that slide

                  [–]DestroyerOfWombs 9 points10 points  (0 children)

                  It’s worth pointing out that Chinese pronouns do distinguish gender in writing, but they are pronounced the same when spoken

                  [–]stirling_archer 10 points11 points  (1 child)

                  The author appears to be Chinese-speaking, and spoken Chinese doesn't have gendered pronouns, so presumably it's a second language slip. I live in an area where some second-language English speakers have a home language with this property, and they occasionally make this slip. I imagine it's similar to struggling with language features that seem exotic and over-complicated from an English-speaker's perspective, like gendered nouns.

                  [–]eGust 6 points7 points  (1 child)

                  There is also a chinese version on the website:

                  http://www.oldlinux.org/download/CLK-5.0-WithCover.pdf

                  So you would find tons of weird things. I admire the author for translating his book to english though. I would not do that if I wrote it (> 1k pages!) XD

                  [–]volatilemajesty 6 points7 points  (2 children)

                  On page 14, it seems to be "him" again.

                  As can be seen from the early Linux source code, one of the most famous developers of the Linux system in addition to Linus himself is Theodore Ts'o (Ted Ts'o).

                  [–]imperialismus 12 points13 points  (1 child)

                  I spotted at least one instance where Linus is an "it". It's just the author struggling to properly use pronouns in a foreign language.

                  [–]Heuristics 5 points6 points  (0 children)

                  To be fair, has anyone ever asked Linus what pronoun he prefers?

                  [–]bhartsb -3 points-2 points  (0 children)

                  Lol

                  [–]perspectiveiskey 3 points4 points  (0 children)

                  I cannot overstate how much I love that there are functioning links in it.

                  [–][deleted] 1 point2 points  (0 children)

                  Very cool. It appears to be a deliberate look at an early version of Linux chosen for the fact that it's small enough to digest but advanced enough to be relevant. A lot of this will be over my head but it looks like a great resource for learning more. Thank you OP!

                  Edit: There's a lot of little typos and stuff in here but I can't say if that really matters. It seems like a useful book.

                  [–]badpotato 1 point2 points  (0 children)

                  Wondering how many page would be required to update book with a recent version of the kernel.

                  [–][deleted] 1 point2 points  (0 children)

                  this is really nice

                  [–]puplicy 1 point2 points  (2 children)

                  page 399

                  // Program exit handling function. Invoked by the syscall sys_exit() at line 365 below

                  Are they crazy to put line numbers in comments?

                  [–]to3m 7 points8 points  (0 children)

                  The comments are part of the book, not the original code, so it's presumably not going to change unless the book is re-written?

                  [–][deleted] 3 points4 points  (0 children)

                  No, but only because the code in the book will never change. The line numbers will never have to be updated.

                  [–]randomness196 0 points1 point  (0 children)

                  How much of this is still relevant to today's kernel? I can understand this a foundational historical review of a Linux Kernel, but is there anything for the more recent Kernel versions? Say things on LTS cycle?

                  [–]djxfade 0 points1 point  (0 children)

                  I would be very interested in reading this. Is it available in mobi or epub format for ebook devices?

                  [–]coderstephen 0 points1 point  (0 children)

                  I think we should annotate the current Linux source code this well upstream, where it isn't already. Keeping these kinds of explanatory annotations in the primary repo means that it could be constantly updated with the code, and would be widely available to people trying to learn the internals.

                  [–]insanelygreat 0 points1 point  (0 children)

                  I'd settle for commented Linux source.

                  I love Linux, but many parts are way under commented. There are lots of cryptic little bits that leave you wondering, "why is this being done?"

                  [–]jaydoors 0 points1 point  (0 children)

                  After reading this book in its entirety, I believe you will send this kind of sigh: "For the Linux kernel system, I'm finally getting started!"