HOME

TheInfoList



OR:

''A Commentary on the Sixth Edition UNIX Operating System'' by John Lions (later reissued as ''Lions' Commentary on UNIX 6th Edition'' and commonly referred to as the Lions Book) is a highly influential 1976 publication containing analytical commentary on the
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
of the 6th Edition
Unix Unix (, ; trademarked as 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, a ...
computer A computer is a machine that can be Computer programming, programmed to automatically Execution (computing), carry out sequences of arithmetic or logical operations (''computation''). Modern digital electronic computers can perform generic set ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
"resident nucleus" (i.e.,
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
)
software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
, plus copy formatted and indexed by Lions, of said source code obtained from the authors at
AT&T AT&T Inc., an abbreviation for its predecessor's former name, the American Telephone and Telegraph Company, is an American multinational telecommunications holding company headquartered at Whitacre Tower in Downtown Dallas, Texas. It is the w ...
Bell Labs Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, Murray Hill, New Jersey, the compa ...
. 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. It is suspected to be the most frequently photocopied book in
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
. 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, and has been circulated, recreated or reconstructed variously in a number of media by other parties.


History

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 for Lions's
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
courses (6.602B and 6.657G, mentioned in the introduction of the book) at the
University of New South Wales The University of New South Wales (UNSW) is a public research university based in Sydney, New South Wales, Australia. It was established in 1949. The university comprises seven faculties, through which it offers bachelor's, master's and docto ...
. UNSW had obtained
UNIX Unix (, ; trademarked as 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, a ...
source code in 1975, in response to Ken Robinson's 1974 query to Dennis Ritchie at Bell. Bell Labs was a subsidiary of AT&T, due to the 1956 Consent Decree AT&T was not permitted to conduct business in any other field hence couldn't sell the software, though it was required, paradoxically, to license its inventions, such as Unix and the transistor.
Western Electric Western Electric Co., Inc. was an American electrical engineering and manufacturing company that operated from 1869 to 1996. A subsidiary of the AT&T Corporation for most of its lifespan, Western Electric was the primary manufacturer, supplier, ...
, another AT&T subsidiary, administered the licensing. From 1977, with the v7 & later licenses, AT&T forbade code commentaries for teaching and allowed only one copy of the Lions Commentary, printed, per license. The UNIX User's group,
USENIX 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 confe ...
's newsletter, ''UNIX News'', of March 1977, announced the availability of the book to UNIX licensees. Difficulty in keeping pace with the book's popularity, meant that by 1978 it was available only from AT&T
Bell Labs Nokia Bell Labs, commonly referred to as ''Bell Labs'', is an American industrial research and development company owned by Finnish technology company Nokia. With headquarters located in Murray Hill, New Jersey, Murray Hill, New Jersey, the compa ...
.The Daemon, The GNU and the Penguin - Chapters 2 & 3
( Peter H. Salus)
When AT&T announced UNIX Version 7 at
USENIX 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 confe ...
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 Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
had a treasured multiple-generation photocopy. Other follow-on effects of the license change included Andrew S. Tanenbaum creating
Minix MINIX is a Unix-like operating system based on a microkernel Software architecture, architecture, first released in 1987 and written by American-Dutch computer scientist Andrew S. Tanenbaum. It was designed as a clone of the Unix operating syste ...
. As Tanenbaum wrote in ''Operating Systems'' (1987): Various UNIX people, particularly Peter H. Salus,
Dennis Ritchie Dennis MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was an American computer scientist. He created the C programming language and the Unix operating system and B language with long-time colleague Ken Thompson. Ritchie and Thomp ...
and Berny Goodheart, lobbied Unix's various owners (AT&T,
Novell Novell, Inc. () was an American software and services company headquartered in Provo, Utah, that existed from 1980 until 2014. Its most significant product was the multi-platform network operating system known as NetWare. Novell technolog ...
, the
Santa Cruz Operation The Santa Cruz Operation, Inc. (usually known as SCO, pronounced either as individual letters or as a word) was an American software company, based in Santa Cruz, California, that was best known for selling three Unix operating system variants ...
) 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 Ancient history is a time period from the beginning of writing and recorded human history through late antiquity. The span of recorded history is roughly 5,000 years, beginning with the development of Sumerian cuneiform script. Ancient hi ...
"), and the full code plus the 1977 version of the commentary was published by Peer-To-Peer Communications (). The reissue includes commentary from Michael Tilson (SCO), Peter Salus, Dennis Ritchie,
Ken Thompson Kenneth Lane Thompson (born February 4, 1943) 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 (programmi ...
, Peter Collinson, Greg Rose, Mike O'Dell, Berny Goodheart and Peter Reintjes.


Contents

''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 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
/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 SIMH is a free and open source, multi-platform multi-system emulator. It is maintained by Bob Supnik, a former DEC engineer and DEC vice president, and has been in development in one form or another since the 1960s. History SIMH was based o ...
. ''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. The source code reads: /* * 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) 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 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
saved registers in procedure calls. This code failed when ported to other machines and had to be redesigned in
Version 7 UNIX 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 commerc ...
.
Dennis Ritchie Dennis MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was an American computer scientist. He created the C programming language and the Unix operating system and B language with long-time colleague Ken Thompson. Ritchie and Thomp ...
later explained the meaning of this remark:


See also

*


References


Further reading

* Andrew S. Tanenbaum, ''Operating Systems: Design and Implementation'', (
Prentice Hall Prentice Hall was a major American publishing#Textbook_publishing, educational publisher. It published print and digital content for the 6–12 and higher-education market. It was an independent company throughout the bulk of the twentieth cen ...
, , June 1987) * Brian W. Kernighan and
Dennis Ritchie Dennis MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was an American computer scientist. He created the C programming language and the Unix operating system and B language with long-time colleague Ken Thompson. Ritchie and Thomp ...
, ''
The C Programming Language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming langu ...
'',


External links






Code Critic
(Rachel Chalmers, '' Salon (website), Salon'', 30 November 1999)
The Daemon, The GNU and the Penguin - Ch. 6: 1979
( Peter H. Salus) {{DEFAULTSORT:Commentary on the UNIX Operating System, A 1976 non-fiction books Unix books Computer programming books