John Lions Explained the Unix Kernel to Students in 1976. AT&T’s License Made the Book a Photocopy Classic.

The two original volumes, “A Commentary on the UNIX Operating System” by John Lions and “UNIX Operating System Source Code Level Six”, on a white table, beside the words “John Lions” and “The Unix kernel, explained”, with a stack of fading photocopied pages.


In May 1976, John Lions, who taught computing at the University of New South Wales (UNSW) in Sydney, produced a set of notes on Unix for his operating-systems students. The notes were meant “purely to assist students,” in UNSW’s words, but in 1979 AT&T, which owned Unix, banned that kind of classroom use.

By 1977 the notes had become two bound volumes: the source code of the Sixth Edition Unix kernel, roughly 9,000 to 10,000 lines, and a commentary explaining how it worked. After the ban, the book circulated as photocopies until the code’s later owner allowed a 1996 edition. Those copies carried one of the best-remembered comments in Unix: “You are not expected to understand this.”

A working operating system as course material

UNSW had obtained the Unix source code in 1975, after Ken Robinson of the university wrote away for it. The Sixth Edition, often called V6, was the current version, and its kernel was compact enough to print and explain line by line. Lions did exactly that. One volume reproduced the kernel code with numbered lines; the other walked through it, so students could study a real operating system that was running on real machines rather than a simplified model.

The books traveled well beyond Sydney. Andrew Tanenbaum, a computer scientist in Amsterdam, later wrote that he was “teaching a course on operating systems and using John Lions’ book on UNIX Version 6.” Bell Labs, where Unix had been written, noticed too. Salon’s 1999 profile of Lions quotes Dennis Ritchie, who created Unix with Ken Thompson, on the books: “We were much impressed by the quality of the work and highly flattered by its very existence.”

In 1978, according to the “About the author” note in the book’s 1996 edition, Doug McIlroy of Bell Labs phoned Lions to say the labs would like to take over distributing the notes. Salon adds that, technically, the books had been available only to licensees of Sixth Edition Unix from the start.

AT&T’s license closed the classroom door

Seventh Edition Unix was released in 1979. According to Salon, “the seventh and subsequent licenses explicitly prohibited the kind of teaching that Lions had been doing.” UNSW’s account is blunter: AT&T had become uncomfortable with the Unix code being so openly analyzed and “banned classroom use in 1979.”

Not everyone at AT&T wanted the ban. Ritchie described “somewhat of a struggle” between the research group, “who saw the benefit in having the system readily available,” and the Unix Support Group (USG), AT&T’s internal Unix team. Even though Unix was not yet a commercial proposition in the 1970s, he said, “USG and the lawyers were cautious.” His verdict was short: “At any rate, we in research lost the argument.”

For Andrew Tanenbaum in Amsterdam, the ban changed his course. When AT&T decided to forbid the teaching of Unix internals, Tanenbaum recalled, he decided to write his own version of Unix, “free of all AT&T code and restrictions,” so he could teach from it. That system became MINIX.

How the book survived the ban as photocopies

The ban did not make the book disappear. The Seventh Edition arrived, Salon noted, “at about the same time that photocopiers were becoming affordable,” and the Lions books “were secretly copied and passed from hand to hand.” In Salon’s phrase, “Fourth- and fifth-generation photocopies became treasured possessions.” UNSW describes underground demand for the book that continued for two decades.

The story behind “You are not expected to understand this”

The comment sits in the kernel’s process-switching code. The line is often quoted, Ritchie noted, as “a slur on the quantity or quality of the comments” in Bell Labs’ Unix code. Ritchie said it was meant “in the spirit of ‘This won’t be on the exam.’” He also admitted: “The real problem is that we didn’t understand what was going on either.”

The commented code depended on switching to a previously saved stack frame and then running the return code of a different function from the one that had saved that state. That worked on the PDP-11 minicomputer because its compiler always used the same context-save mechanism. When Ritchie and his colleague Steve Johnson moved the kernel to an Interdata computer, whose compiler produced different return code depending on which registers a function had saved, they spent about a week on the problem before deciding that the kernel’s process-switching mechanism itself was wrong. They rewrote it, but the comment remains in the Sixth Edition code that Lions had printed.

How the book was cleared for publication in 1996

By the mid-1990s, the old Unix code belonged to the Santa Cruz Operation (SCO). Ritchie, helped by the Unix historian Peter Salus and the author Berny Goodheart, pressed SCO to allow publication. He already knew Mike Tilson, an SCO executive, and recalled that Tilson drafted the “grant of permission” letter himself, “to save the legal people from doing the work!”

In 1996, Peer-to-Peer Communications published both volumes together as Lions’ Commentary on UNIX 6th Edition, with Source Code. Ken Thompson and Ritchie wrote the forewords. UNSW says the book went on to sell around 15,000 copies.

Where Lions’s method lives on

Lions died on December 5, 1998, aged 61. UNSW dedicated the Lions Garden outside its Computer Science Building in 2002, and in 2006 a group of alumni established the John Lions Chair of Operating Systems.

His approach outlived the license dispute. When the Massachusetts Institute of Technology (MIT) created an operating-systems course in 2002, the class worked through Sixth Edition Unix, in MIT’s words, “using John Lions’s famous commentary.” In 2006 the course replaced V6 with xv6, a new teaching system modeled on V6 but written in ANSI C — the standardized version of the language — for multiprocessor Intel x86 machines.

A clear guide to real code kept finding readers, whatever AT&T’s license said. Notes written “purely to assist students” in Sydney reached Tanenbaum’s classroom in Amsterdam, survived as photocopies of photocopies and, 26 years after Lions wrote them, were on the syllabus at MIT.

Related stories

Sources

Share this article
FacebookThreadsLinkedInX

Leave a Reply

Your email address will not be published. Required fields are marked *