A Commentary on the UNIX Operating System

Last updated
A commentary on the Unix operating system
Brian Kernighan in 2012 at Bell Labs 2.jpg
Brian Kernighan holding a copy of Lions's Commentary
Author John Lions
LanguageEnglish; also available in Chinese and Japanese
Subject Unix operating system
Genre Computer Science
Publisher University of New South Wales
Publication date
1976
Publication place
  • Australia (original)
  • United States (1996 reprint)
OCLC 36099640
005.43
LC Class QA 76.76 .O63 L56

A Commentary on the Sixth Edition UNIX Operating System by John Lions (later reissued as Lions' Commentary on UNIX 6th Edition [1] [2] and commonly referred to as the Lions Book) is a highly influential [3] 1976 publication containing analytical commentary on the source code of the 6th Edition Unix computer operating system "resident nucleus" [4] (i.e., kernel) software, plus copy formatted and indexed by Lions, of said source code obtained from the authors at AT&T Bell Labs.

Contents

Itself an exemplar of the early success of UNIX as portable code for a publishing platform, Lions's work was typeset using UNIX tools, on systems running code ported at the University, similar to that which it documented. [5]

It was commonly held to be the most copied book in computer science.[ citation needed ] Despite its age, Lions's book is still considered an excellent commentary on simple, high quality code.

Lions's work was most recently reprinted in 1996 by Peer-To-Peer Communications, [6] and has been circulated, recreated or reconstructed variously in a number of media by other parties. [5]

History

John Lions with his students in 1980 Johnlions.jpg
John Lions with his students in 1980
A Japanese reprinting of John Lions A commentary on the Unix operating system and accompanying formatted source code displaying a license for use by certain licensees, and a directive to those licensees to restrict use by other parties, Unix operating system source code level six Lions Commentary Unix.jpeg
A Japanese reprinting of John Lions A commentary on the Unix operating system and accompanying formatted source code displaying a license for use by certain licensees, and a directive to those licensees to restrict use by other parties, Unix operating system source code level six

The source code and commentary were printed in book form in 1977, after first being assembled in May 1976, as a set of lecture notes [4] for Lions's computer science courses (6.602B and 6.657G, mentioned in the introduction of the book) at the University of New South Wales.

UNSW had actually obtained UNIX source code in 1975, in response to Ken Robinson's 1974 query to Dennis Ritchie at Bell. [7] Bell Labs was a subsidiary of AT&T, under restrictions owing to its monopolistic nature as a national telecommunications infrastructure provider, and not permitted to conduct business in any other field,[ citation needed ] and so was not at liberty to profit from sale of software,[ citation needed ] however UNIX was being provided under license by another AT&T subsidiary, Western Electric at least by 1977.[ clarification needed ]

The UNIX User's group, USENIX's newsletter, UNIX News, of March 1977, announced the availability of the book to UNIX licensees. [4]

Difficulty in keeping pace with the book's popularity, meant that by 1978 it was available only from AT&T Bell Labs. [8]

When AT&T announced UNIX Version 7 at USENIX in June 1979, the academic/research license no longer automatically permitted classroom use. However, thousands of computer science students around the world spread photocopies. As they were not being taught it in class, they would sometimes meet after hours to discuss the book. Many pioneers of UNIX and open source had a treasured multiple-generation photocopy.[ citation needed ]

Other follow-on effects of the license change included Andrew S. Tanenbaum creating Minix. As Tanenbaum wrote in Operating Systems (1987):

When AT&T released Version 7, it began to realize that UNIX was a valuable commercial product, so it issued Version 7 with a license that prohibited the source code from being studied in courses, in order to avoid endangering its status as a trade secret. Many universities complied by simply dropping the study of UNIX, and teaching only theory.

Various UNIX people, particularly Peter H. Salus, Dennis Ritchie and Berny Goodheart, lobbied Unix's various owners (AT&T, Novell, the Santa Cruz Operation) for many years to allow the book to be published officially. In 1996, the Santa Cruz Operation finally authorised the release of the twenty-year-old 6th Edition source code (along with the source code of other versions of "Ancient UNIX"), and the full code plus the 1977 version of the commentary was published by Peer-To-Peer Communications ( ISBN   978-1-57398-013-5). [6] The reissue includes commentary from Michael Tilson (SCO), Peter Salus, Dennis Ritchie, Ken Thompson, Peter Collinson, Greg Rose, Mike O'Dell, Berny Goodheart and Peter Reintjes.

Contents

Lions Commentary on UNIX 6th Edition with Source Code 1996 reissue Lions Commentary on UNIX 6th Edition with Source Code.jpg
Lions Commentary on UNIX 6th Edition with Source Code 1996 reissue

UNIX Operating System Source Code Level Six is the kernel source code, lightly edited by Lions to better separate the functionality — system initialization and process management, interrupts and system calls, basic I/O, file systems and pipes and character devices. All procedures and symbols are listed alphabetically with a cross reference.

The code as presented will run on a PDP-11/40 with RK05 disk drive, LP11 line printer interface, PCL11 paper tape writer and KL11 terminal interface, or a suitable PDP-11 emulator, such as SIMH.

A Commentary on the UNIX Operating System starts with notes on UNIX and other useful documentation (the UNIX manual pages, DEC hardware manuals and so on), a section on the architecture of the PDP-11 and a chapter on how to read C programs. The source commentary follows, divided into the same sections as the code. The book ends with suggested exercises for the student.

As Lions explains, this commentary supplements the comments in the source. It is possible to understand the code without the extra commentary, and the reader is advised to do so and only read the notes as needed. The commentary also remarks on how the code might be improved.

"You are not expected to understand this"

The infamous program comment "You are not expected to understand this" occurs on line 2238 of the source code (Lions' Commentary, p. 22) at the end of a comment explaining the process exchange mechanism. It refers to line 325 of the file slp.c. [9] The source code reads: [10] [11]

/*         * If the new process paused because it was         * swapped out, set the stack level to the last call         * to savu(u_ssav).  This means that the return         * which is executed immediately after the call to aretu         * actually returns from the last routine which did         * the savu.         *         * You are not expected to understand this.         */if(rp->p_flag&SSWAP){rp->p_flag=&~SSWAP;aretu(u.u_ssav);}

A major reason why this piece of code was hard to understand was that it depended on a quirk of the way the C-compiler for the PDP-11 saved registers in procedure calls. This code failed when ported to other machines and had to be redesigned in Version 7 UNIX. [12] Dennis Ritchie later explained the meaning of this remark: [10]

"You are not expected to understand this" was intended as a remark in the spirit of "This won't be on the exam", rather than as an impudent challenge.

See also

Related Research Articles

<span class="mw-page-title-main">Brian Kernighan</span> Canadian computer scientist

Brian Wilson Kernighan is a Canadian computer scientist. He worked at Bell Labs and contributed to the development of Unix alongside Unix creators Ken Thompson and Dennis Ritchie. Kernighan's name became widely known through co-authorship of the first book on the C programming language with Dennis Ritchie. Kernighan affirmed that he had no part in the design of the C language.

B is a programming language developed at Bell Labs circa 1969 by Ken Thompson and Dennis Ritchie.

QED is a line-oriented computer text editor that was developed by Butler Lampson and L. Peter Deutsch for the Berkeley Timesharing System running on the SDS 940. It was implemented by L. Peter Deutsch and Dana Angluin between 1965 and 1966.

Joseph Frank Ossanna, Jr. was an American electrical engineer and computer programmer who worked as a member of the technical staff at the Bell Telephone Laboratories in Murray Hill, New Jersey. He became actively engaged in the software design of Multics, a general-purpose operating system used at Bell.

<span class="mw-page-title-main">Unix philosophy</span> Software development philosophy

The Unix philosophy, originated by Ken Thompson, is a set of cultural norms and philosophical approaches to minimalist, modular software development. It is based on the experience of leading developers of the Unix operating system. Early Unix developers were important in bringing the concepts of modularity and reusability into software engineering practice, spawning a "software tools" movement. Over time, the leading developers of Unix established a set of cultural norms for developing software; these norms became as important and influential as the technology of Unix itself, and have been termed the "Unix philosophy."

<span class="mw-page-title-main">USENIX</span> Organization supporting operating system research

USENIX is an American 501(c)(3) nonprofit membership organization based in Berkeley, California and founded in 1975 that supports advanced computing systems, operating system (OS), and computer networking research. It organizes several conferences in these fields.

<span class="mw-page-title-main">Version 7 Unix</span> 1979 minicomputer operating system

Version 7 Unix, also called Seventh Edition Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercialization of Unix by AT&T Corporation in the early 1980s. V7 was originally developed for Digital Equipment Corporation's PDP-11 minicomputers and was later ported to other platforms.

<i>The C Programming Language</i> Book by Brian Kernighan and Dennis Ritchie

The C Programming Language is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming language, as well as co-designed the Unix operating system with which development of the language was closely intertwined. The book was central to the development and popularization of C and is still widely read and used today. Because the book was co-authored by the original language designer, and because the first edition of the book served for many years as the de facto standard for the language, the book was regarded by many to be the authoritative reference on C.

<span class="mw-page-title-main">John Lions</span> Australian computer scientist (1937–1998)

John Lions was an Australian computer scientist. He is best known as the author of Lions' Commentary on UNIX 6th Edition, with Source Code, commonly known as the Lions Book.

The Programmer's Workbench (PWB/UNIX) was an early, now discontinued, version of the Unix operating system that had been created in the Bell Labs Computer Science Research Group of AT&T. Its stated goal was to provide a time-sharing working environment for large groups of programmers, writing software for larger batch processing computers.

UNIX/32V is an early version of the Unix operating system from Bell Laboratories, released in June 1979. 32V was a direct port of the Seventh Edition Unix to the DEC VAX architecture.

<span class="mw-page-title-main">UNIX System III</span> Discontinued UNIX variant

UNIX System III is a discontinued version of the Unix operating system released by AT&T's Unix Support Group (USG).

<span class="mw-page-title-main">Version 6 Unix</span> 6th Edition of Research Unix alias UNIX Time-Sharing System

Sixth Edition Unix, also called Version 6 Unix or just V6, was the first version of the Unix operating system to see wide release outside Bell Labs. It was released in May 1975 and, like its direct predecessor, targeted the DEC PDP-11 family of minicomputers. It was superseded by Version 7 Unix in 1978/1979, although V6 systems remained in regular operation until at least 1985.

<span class="mw-page-title-main">History of Unix</span> Operating system

The history of Unix dates back to the mid-1960s, when the Massachusetts Institute of Technology, AT&T Bell Labs, and General Electric were jointly developing an experimental time-sharing operating system called Multics for the GE-645 mainframe. Multics introduced many innovations, but also had many problems. Bell Labs, frustrated by the size and complexity of Multics but not its aims, slowly pulled out of the project. Their last researchers to leave Multics – among them Ken Thompson, Dennis Ritchie, Doug McIlroy, and Joe Ossanna – decided to redo the work, but on a much smaller scale.

Research Unix are early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC).

<span class="mw-page-title-main">Berkeley Software Distribution</span> Unix operating system

The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley. The term "BSD" commonly refers to its open-source descendants, including FreeBSD, OpenBSD, NetBSD, and DragonFly BSD.

<span class="mw-page-title-main">Unix</span> Family of computer operating systems

Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.

<span class="mw-page-title-main">Ken Thompson</span> American computer scientist, co-creator of the Unix operating system

Kenneth Lane Thompson is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B programming language, the direct predecessor to the C language, and was one of the creators and early developers of the Plan 9 operating system. Since 2006, Thompson has worked at Google, where he co-developed the Go language.

The history of the Berkeley Software Distribution begins in the 1970s.

<span class="mw-page-title-main">Software Tools Users Group</span>

The Software Tools Users Group (STUG) was a technical organization started in 1976, in parallel with Usenix. The STUG goal was to develop a powerful and portable Unix-like system that could be implemented on top of virtually any operating system, providing the capabilities and features of Unix in a non-proprietary system. With its focus on building clean, portable, reusable code shared amongst multiple applications and runnable on any operating system, the Software Tools movement reestablished the tradition of open source and the concepts of empowering users to define, develop, control, and freely distribute their computing environment.

References

  1. Lions, John (1976–1977). A commentary on the Sixth Edition UNIX Operating System. University of New South Wales: Department of Computer Science. OCLC   494684468.
  2. Unix operating system source code level six. University of New South Wales: Department of Computer Science. 1976–1977. OCLC   494684460.
  3. Jonathan Corbet Brian Kernighan on the origins of Unix LWN.net. January 17, 2022.
  4. 1 2 3 "NEW BOOK". UNIX News. USENIX. Mar 1977.
  5. 1 2 Lehey, Greg (2015-09-14). "Commentary on the Sixth Edition UNIX Operating System". Greg Lehey, Warren Toomey.
  6. 1 2 3 Lions, John (1996). Lions' Commentary on UNIX 6th Edition with Source Code. Peer-to-Peer Communications. ISBN   978-1-57398-013-5.
  7. Faculty of Engineering, UNSW, (Dean) (2020-09-18). "Remembering Ken Robinson". University of New South Wales: Engineering. Archived from the original on 2020-10-20.
  8. The Daemon, The GNU and the Penguin - Chapters 2 & 3 (Peter H. Salus)
  9. Ken Thompson. "unix-history-repo/usr/sys/ken/slp.c". GitHub . Retrieved 2018-10-12.
  10. 1 2 Dennis Ritchie (2002-06-22). "Odd Comments and Strange Doings in Unix" . Retrieved 2021-05-14.
  11. https://swtch.com/unix/ [ bare URL ]
  12. Johnson, S. C.; Ritchie, D. M. (1978). "UNIX Time-Sharing System: Portability of C Programs and the UNIX System" (PDF). Bell System Technical Journal. 57 (6): 2021–2048. doi:10.1002/j.1538-7305.1978.tb02141.x. S2CID   17510065. Archived (PDF) from the original on 2022-10-09.

Further reading