Settings

Theme

Lions' Commentary on Unix: Why It Was Secretly Copied for 20 Years

fosscomics.com

272 points by joonehur · 75 comments

Reader

18 threads
CalChris

Lions Commentary was used as evidence in the USL vs BSDI lawsuit to undermine USL’s claims of trade secret misappropriation and unrestricted publication without copyright notice.

It was my licensed original copy which I bought from Western (!) Electric. Technically, it was part of a Western Electric UNIX source license. I lent my copy to Sam Leffler for the lawsuit. It was entered as evidence and I got it back a couple of years later.

hidroto

This story reminds me of "The Real Book".

[1] https://en.wikipedia.org/wiki/The_Real_Book [2] https://www.youtube.com/watch?v=dD0e5e6wI_A

  • tda
    • lelandfe

      I remember being deeply confused seeing a “Fake Books” section in Powell’s in Portland, and it all being music.

    • analog31

      >>> The other big problem with these fake books at this point was that the music inside felt really out of date. The fake books hadn’t changed since the mid-40s, but jazz had.

      Amusingly, the "contemporary" tunes in the Real Book are now 50+ years old.

      I got a Real Book around 1982, and it was revelatory. Of course I was picking up tunes by ear before that, as a bassist, and I still do today. But the RB made some of the more "weird" tunes approachable, and allowed bands to form for gigs even if we didn't all know 4 hours of material.

      • scarecrowbob

        I play a lot of low-rent jazz, and I like mostly early jazz, so a weird-to-me thing is that much of the real book is newer than the music that I generally enjoy playing with jazz bands.

        I of course play all kinds of stuff (pedal steel and bass in country bands, keys in rock bands), but the jazz I enjoy is mostly pre-1955ish. I've gotten a lot more miliage out the the blue book and the django book, but the Bb real books made getting into clarinet performance much, much easier. I'm almost done weaning myself off written music for the clarinet.

  • shermantanktop

    That Wikipedia page is wild. I never knew the detailed history. It explains why the Real Book has so many Steve Swallow tunes!

JdeBP

By the time I got hold of a copy when the book came out, the Deitel and Kogan book on OS/2 had been out for 2 years, as had the Goodheart+Cox Magic Garden book, the Leffler+McKusic+Karels+Quarterman book on 4.3BSD had been out for 7 years, the Bach book had been out for 10 years, and the Xinu books had been out for 12 years.

The Lions book wasn't really very useful by 1996.

Whereas Vahalia's and Pate's books on Unix, which also came out in 1996 but covered things that had happened in the intervening decades, were a lot more useful.

  • pjmlp

    The usefulness of the book was helping to widespread UNIX on university campus during its early days, afterwards, just like the K&R C first edition, it became an historical artifact.

  • kragen

    The Lions book wasn't useful as a guide to the kernel of your operating system anymore in 01996, but it was very useful in understanding why C and Unix were the way they were. A lot of Unix's Chesterton's Gates are justified in it, which is what you need to tear them down. And it was also very useful for writing a new operating system, because it includes enough source code to compile into a pretty complete multiprocess timesharing operating system supporting multiple terminals, multiple user accounts, a hierarchical filesystem, and the still-familiar Unix system call interface.

    I don't think any of those other excellent books are really an adequate replacement. Deitel and Kogan obviously don't include the OS/2 source code; Bach https://abhyass.wordpress.com/wp-content/uploads/2016/09/the... and Goodheart & Cox are mostly pseudocode, with no kernel source code; the Devil Book is almost but not completely devoid of kernel source code; the Xinu book https://willendless.github.io/assets/os_arm_doc/Operating%20... is great (and clearly owes a lot to Sixth Edition Unix), but Xinu lacks, for example, users and subdirectories.

    Most of these, though not the Xinu book, cover operating systems that are much too big and complicated to explain fully in a single book, so they confine themselves to conceptual overviews. In my view, this reinforces the syndrome Comer critiques in the preface to the Xinu book:

    > Students form the impression that an operating system is a black box, and textbooks reinforce the misimpression by explaining operating system features and focusing on how to use operating system facilities. More important, because they only learn how an operating system appears from the outside, students are left with the feeling that an operating system consists of a set of interface functions that are connected by a morass of mysterious code containing many machine-dependent tricks.

    By contrast, in the Lions book's commentary volume https://cs3210.cc.gatech.edu/r/unix6.pdf (note, this PDF doesn't include the source-code volume!) we find line-by-line commentaries like:

    > It is now time to take a good look at the procedure which creates new processes as (almost exact) replicas of their creators.

    > 1841: “mpid” is an integer which is stepped through the values 0 to 32767. As each new process is created, a new value for “mpid” is created to provide a unique distinguishing number for the process. Since the cycle of values may eventually repeat, a check is made that the number is not still in use; if so a new value is tried;

    > 1846: A search is made through the “proc” array for a null “proc” structure (indicated by “p stat” having a null value); 1860: At this point, the address of the new entry in the “proc” array is stored as both “p” and “rpp”, and the address of “proc” entry for the current process is stored both as “up” and “rip”; [...]

    Even the Xinu book doesn't go into that level of detail. It is, in my view anyway, much less accessible than Lions, requiring a great deal more previous knowledge of programming.

    If a relatively new programmer felt that a kernel was "a morass of mysterious code containing many machine-dependent tricks", I don't think they could retain that feeling after working through the Lions book, although it does contain some machine-dependent tricks.

    I have the strong impression that all of Bach, Goodheart & Cox, and the Devil Book authors wanted to include the kernel source code they were commenting on, because in many cases they discuss specific functions, struct fields, and variables, and then, in most cases, describe algorithms in pseudocode. My inference is that they were forced into this exigency by legal threats from the Death Star, not that they thought the pseudocode was actually didactically superior to the actual source code. Comer didn't have this problem because Xinu didn't include any Unix source code and wasn't even Unix-compatible at the system call level.

    What was an adequate replacement in 01996 was Linux, which came with full source code and a mailing list full of people who were eager to discuss it.

    But, even then, Linux was not ideal as a teaching system. Which is why, in 02006, the PDOS folks rewrote Sixth Edition Unix in ANSI C and have been using it for teaching ever since: https://github.com/mit-pdos/xv6-riscv

    • sergio-gdr

      What about the MINIX book, by Tanenbaum?

      • kragen

        I haven't read it! I hear it's great, and of course Linux grew out of Minix. My wife has his "Modern Operating Systems" textbook, which is wonderful in the parts I've read.

pjmlp

Yes, many forget that books like the Lions' Commentary on Unix, or later Andrew Tanenbaum on Minix, are the reason UNIX alongside C, won over the big bucks alternatives universities had to pay for.

Had UNIX been a commercial product from the start, history would have taken a quite different timeline for both of them.

  • FLeXMurphy

    I went through the MINIX book not too long ago. To me there is a notable difference in style and where the attention is given, mostly because Tanenbaum was the author of MINIX and the author of the book. The "three main" pillars or whatever he called them are covered carefully. UNIX commentary is a commentary on something someone else did; it's like an archeological dig of sorts. "You are not expected to understand this" is not part of a kernel developers repertoire.

    My only gripe is we are unlikely to see a new MINIX book and I do not foresee something of the sort with xv6; the appetite isn't there likely in the age of AI, and anyone pursing it would be doing so a kind of "work of art", perhaps as a flex against AI, not sure.

    • ferguess_k

      I found this for Linux 0.12:

      https://download.oldlinux.org/ECLK-5.0-WithCover.pdf

      xv6 also has two books: one for the explanation and one for the full source code. I kinda prefer books with full list of source code over Lion's book or the Minix book.

      The Linux one above is my fav. It contains both explanation and source code.

    • pjmlp

      Yeah, there was the re-edition for MINIX 3, the microkernel rewrite with NetBSD userland, and that was it, nothing has happened since 2016, apparently.

      • avadodin

        Tannenbaum was born before the atom bomb.

        You just can’t expect people to stick around forever to serve you as "content creators".

    • pessimizer

      If AI stops sucking, it could write the new MINIX book. Humans still have to understand how stuff works in order to steer stupid AIs. I'll believe we don't once somebody uses vibe-coding to finish and ship HERD.

      • kragen

        Do you mean the Hurd? Some people have been running Debian on the Hurd since 02011.

        Claude Opus 5.5 is capable of writing a bootable unikernel without much steering, but it doesn't seem to be capable of getting all the way from a single prompt to a full-fledged multiprocess operating system just yet. I wouldn't be surprised if a swarm of Fable agents could do it, though, because I was able to elicit a bootable multiprocess ocap-based microkernel with memory protection, running the Ethernet driver, the TCP/IP stack, and an HTTP server in three separate processes, within a few days. (The project is called KokalOS, and I haven't put a decent writeup online yet.)

  • intrasight

    > Had UNIX been a commercial product

    I'm confused. Was't UNIX a commercial product?

    • msh

      No. AT&T was not allowed to sell software due to their phone monopoly

      • ndiddy

        Unix was commercialized in the sense that AT&T sold source code licenses to universities and companies through its existing IP licensing organization. These licenses were quite expensive (~$20,000). They just couldn't run a traditional software business where they would directly sell Unix to end users and provide support. Unix was never public-domain or freely redistributable.

        • pjmlp

          UNIX source tapes were available already for $200 for universities, which was kind of pennies when compared to anything coming from IBM, DEC, GE and co, and basically the cost to copy and send the tapes.

          The price that you mention was only for commercial entities.

          • ndiddy

            You're right that pre-1983 Unix was significantly cheaper for universities than its alternatives, but from looking at the actual figures that doesn't seem to have resulted in significant adoption during the minicomputer era. In 1980, around 100,000 PDP-11s had been sold, but only 2,000 of them were running Unix (see https://publications.gc.ca/collections/collection_2025/isde-... pg 14).

            Unix's long-term success was because it was a portable, production-grade operating system that wasn't dependent on any one hardware manufacturer. Once microprocessors like the 68000 and 80286 came out, this meant that companies could make relatively inexpensive servers and workstations and port Unix rather than making a new operating system from scratch. The portability let Unix escape the minicomputer era while its competitors declined along with the hardware platforms that they targeted.

      • AlecSchueler

        That's also why they had to put so much time and money into research in the first place.

dctoedt

Amusing in the preface about nroff, the early text-markup language that Lions used to produce his book: "The co-operation of the “nroff” program must also be mentioned. Without it, these notes could never have been produced in this form. However it has yielded some of its more enigmatic secrets so reluctantly, that the author’s gratitude is indeed mixed. Certainly “nroff” itself must provide a fertile field for future practitioners of the program documenter’s art."

(Emphasis added.)

And so it was: IIRC, nroff was largely obviated by Brian Reid's SCRIBE, a forerunner of LaTeX.

https://en.wikipedia.org/wiki/Nroff

https://en.wikipedia.org/wiki/Scribe_(markup_language)

https://en.wikipedia.org/wiki/Brian_Reid_(computer_scientist...

ferguess_k

Recommending the same treatise on Linux 0.12 (The authors meticulously translated everything into English a few years ago):

https://download.oldlinux.org/ECLK-5.0-WithCover.pdf

The whole website is dedicated to old Linux. (https://oldlinux.org/)

acomjean

I took the Linux Kernel Internals class at redhat as my company was switching from HPUX and Solaris. HPUX had some great tools for semi real time and we needed OS info. They gave us a tome that was really useful, but slowly went out of date….

Thankfully Linux has no such restrictions.

  • markus_zhang

    I just checked and they don’t offer RHD236 anymore.

    Would you say that internal class had in-depth information, or was it more like a general Linux kernel overview class?

turtleyacht

Programmers know the value of books.

  • sirtaj

    Interestingly, Plan 9 was already being distributed as books with source at the same time. So Thompson, Pike et al were already on board with this idea.

    Have to appreciate the little irony of SCO being the first to allow publishing of the book.

    • tankenmate

      I'm pretty sure that it was "Santa Crus Operation" (i.e. "Good SCO") that gave permission for the book to be published (Unix Support Group (USG) was sold to Novell and then to "Good SCO"). "Bad SCO" was "SCO Group" (Darl McBride, et al) which was ex Caldera.

      And I just looked up his name because I had forgotten it, Peter Salus (Unix historian) along with Dennis Ritchie and Berny Goodheart (author of "The Magic Garden Explained", SVR4 kernel primer) who pushed for "Good SCO" to publish the Commentary.

      • jibalt

        Santa Cruz (a city in California).

        I worked for a competitor, Interactive Systems Corporation, so for us they were always "bad".

      • sirtaj

        I thought so too, but by 1996 Novell had already sold (some subset of, as we found out) Unix to "Bad SCO"... or what eventually became ex-Caldera Bad SCO.

        That whole story is such a shame. I recall pining for Xenix as a young geek.

        • tankenmate

          Novell bought USL from AT&T in 1993, Novell sold USL (minus USG) to Santa Cruz Operation 1995, Santa Cruz Operation sold their server and profession services divisions to Caldera (After that SCO renamed themselves to Tarantella Inc), in 2002 Caldera changed its name to "The SCO Group". Darl McBride was appointed CEO after Caldera acquired the Unix assets from "old SCO". And of course McBride was the one who lead the SCO vs IBM lawsuit.

    • EdwardDiego

      That irony regarding SCO struck me too. "Wait, SCO? That SCO? Huh."

mkarliner

I still have my bootlegged photocopy from around 1985

  • emmelaich

    I have my older brother's original copy; he did the Lions course at UNSW in 1978 or '79.

    I probably should wrap it in plastic to preserve it ...

  • kps

    Me too. Two ‘volumes’, one for the source and one for the commentary, to have them open side by side.

    (I spent so much on the departmental copier as a bored intern.)

Ericson2314

Ugh, have mixed feelings about this one, because Unix was far from the best design deserving to win.

  • kjs3

    Some people care more about documenting stuff people actually use.

  • fortran77

    Deserving has nothing to do with it. You could photocopy the whole kernel and read it on the train. Try that with Multics.

jibalt

I got my hands on the Lions book at some point, but I worked for Interactive Systems Corporation, a UNIX development shop, and had already seen the code.

ajasmin

Is there a good modern reprint of Lions` book?

ape4

Is there a definitive equivalent about Linux?

torginus

Why is Unix so great? I have worked with Linux for many-many years, and I feel like I understand most of the programming model of how to write applications as K&R intended, yet I am unimpressed.

Just what is so good about Unix/Linux that has allowed people to be so incorrigibly smug bout themselves?

Multiuser? The PC has deprecated the Terminal-Server model by the 90s.

Piping together C programs? I think this model has kinda sorta failed as well. Most people would agree shells are better implemented as a fast scripting-language, rather than a chain of C programs passing text around.

I was taught that the Unix philosophy is writing a shell script and gluing these small programs together, orchestrated via a shell script. But this model has failed to scale up in complexity, even inside the Unix world. There are no more web servers that handle requests like this. Instead of lex/bison grammars, GCC people have made their compiler into a monolith. The Linux kernel is a huge monolith.

It's the typical sanctimonious religious mentality - people preaching things they do not themselves follow, repeated at every level of the clergy

Unix design lends itself to scheduling programs interacting via pipes/files written in a synchronous, blocking manner, but tying IO to threads has been accepted as a performance mistake for various reasons, and nowadays io_uring is what the cool kids use.

But if you don't code like this, and nobody really does nowadays, what does that make fork(), other than a cool novelty?

I don't wanna shill Windows, but at no point in my life did anyone doing things on Windows, but people still built stuff on it, and other people used said stuff without major complaints. Yet Linux/Unix has been always presented as this morally and technically superior environment and shilled hard.

But when I asked the question of 'Why is Linux better?', the few people who have offered me something other than smug condescension, said things like 'fork() is cool', 'every config is a textfile', 'you can tunnel everything through SSH'

Yes these things are cool, but computers can do a lot of stuff other than this, and there are no magical Linux specific answers to be found for those.

  • solyin

    > Piping together C programs? I think this model has kinda sorta failed as well. Most people would agree shells are better implemented as a fast scripting-language, rather than a chain of C programs passing text around.

    I think you missed the point, which wasn't the C part, but the piping together part. it doesn't matter the language, the point is to be able to pipe programs at each other.

    • torginus

      I don't think so. Piping together stuff is neat, but it's not something to base an entire OS around. Also, if you were to pipe stuff together, C is one of the best languages, thanks to its lax memory model, you can memcpy stuff between stdin and stdout, and many programs like cat don't even need a heap.

      It's one of the reasons why Rust's coreutils has trouble matching the old C ones in performance.

      But as I said, piping programs together, which was sold as 'the Unix way', doesn't scale to complex apps, as not even the most hardcore FOSS people, like Stallman write code like that.

      Btw something similar exists for Windows, where it used to be that every button and textbox sent and received messages, and had OS level identity, but nowdays even MS's own toolkits dont work like that anymore.

knorker

This article is like the hospital reception scene in Idiocracy.

It makes me sad. This is what we've come to, in order for people to be able to read?

  • pessimizer

    Yours is a bizarre sentiment. This is what we have come out of. It should cheer you up. This once holy grail is now a throwaway link at the bottom of a comic describing how it was once the holy grail.

    When I was a kid, I would spend years looking for particular books in order to own them, and have to use interlibrary loans that might take weeks just to read things. If anybody should be nostalgic, it's the people remembering when knowledge used to be difficult to find and exclusionary, and you were motivated to read things because you knew that no one else would have gone through to work to be able to read them. Back in the day, you had to find and borrow a copy of one of the ten copies in existence, then commission a scribe and buy the skin of a bunch of dead goats to have it copied. They would think we were horribly spoiled to have had photocopiers, mimeograph machines, and thin, white paper made from trees.

    Now everything is accessible to everyone anytime, anywhere, and the only people who don't read are the people who don't bother to read. It's a good time.

    • knorker

      I have no idea what you're talking about. I can't make sense of it at all.

      I'm talking about the degenerate basically patronizing style of turning a simple message into a messy cartoon, in what appears to be an attempt to dangle something shiny in order to keep the reader's attention to read it. And it does the opposite to me.

      It's just a terrible way to try to convey a message. It's like when someone turns a series of steps into a serious of "hey[…]" statements. Like "Let's go over to them and say hey, we want to have this jacket in a smaller size, and if they say hey, see we only have this, then we'll say hey, this other employee over there said hey, you do have other sizes". It's illiterate. This "hey" first person way of trying to communicate also gets in the way.

      (if you haven't noticed hey-speak before, maybe you will now. Sorry about that)

      This has absolutely nothing to do with access to information.

      It's bad enough when only used lightly with some comic breaks, but this post just gives up on being written intelligently or coherently completely.

      > This once holy grail is now a throwaway link at the bottom of a comic describing how it was once the holy grail.

      It's taking what could have been easy to find, and hiding it under a pile of garbage. I think we were better off having to ride for two days to beg the monks for access to the library. Then it was more accessible than in this post.

dboreham

Lucky to have an original copy. Since nobody in my family understands it's significance, I've attached a postit "Valuable, do not throw out" for when the grim reaper arrives.

mapcars

One more reason to acknowledge the internet and sharing of knowledge it brought.

  • kjs3

    Unix v6 and the Lion Book significantly predate the internet.

jeffrallen

"You are not expected to understand this."

:)

  • jibalt

    For good reason -- it was buggy! It used the wrong stack. They fixed it in V7.

    I was a UNIX kernel hacker working for Interactive Systems Corporation. I studied and hand simulated that code, understood it, and saw that it was buggy, but I don't remember whether that was before or after I saw the fix in the V7 kernel code.

    • mesrik

      And the comment was as Wikipedia page explains, just a Lions note his students not to worry being asked in exam.

      https://en.wikipedia.org/wiki/A_Commentary_on_the_UNIX_Opera...

      • kps

        No, the comment wasn't Lions', it was in UNIX.

        • mesrik

          Yes, you are correct. It was Richie who wrote it. My bad. But Richie intention was same, viewing from Lions point it was perhaps same. He didn't expect his students to understand that part.

    • Taniwha

      Not really, they just didn't have setjmp/longjmp yet, they used something else. The real thing you weren't meant to understand was why a routine that was never called returning a value and mostly didn't return a value had to return "1" at that particular point

      https://www.taniwha.com/~paul/not.html

      (I worked for another competitor, UniSoft, SCO ripped us off too, on the 286 port)

      • jibalt

        Yes really, naysayer. They had to fix it in V7 because the code didn't work on the Interdata ... the V6 code only happened to work because of specifics of the PDP-11's calling convention.

        • Taniwha

          Oh totally, I think I made it clear in the writeup that it depended on the pdp11 calling conventions, but it wasn't broken on the pdp11 (and I was able to make it work on my V6 Vax port)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection