Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
A Commentary on the UNIX Operating System
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|1976 book by John Lions}} {{Infobox book | name = A commentary on the Unix operating system | image = Lions Commentary Unix (cropped).jpeg | caption = | author = [[John Lions]] | country = {{ubl|Australia {{small|(original)}}|United States {{small|(1996 reprint)}}}} | language = English; also available in Chinese and Japanese | subject = [[Unix]] operating system | genre = [[Computer Science]] | publisher = [[University of New South Wales]] | pub_date = 1976 | pages = | isbn = | oclc = 36099640 | dewey = 005.43 | congress = 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'''''<ref name="wcCommentary">{{cite book |url=http://www.lemis.com/grog/Documentation/Lions/ |title=''A commentary on the Sixth Edition UNIX Operating System'' |date=1976β1977 |first=John |last=Lions |publisher=University of New South Wales: Department of Computer Science |oclc=494684468}}</ref><ref name="wcSource">{{cite book |title=''Unix operating system source code level six'' |url=https://www.worldcat.org/oclc/494684460 |date=1976β1977 |publisher=University of New South Wales: Department of Computer Science|oclc=494684460 }}</ref> and commonly referred to as the '''Lions Book''') is a highly influential<ref>Jonathan Corbet [https://lwn.net/Articles/881431/ Brian Kernighan on the origins of Unix] LWN.net. January 17, 2022.</ref> 1976 publication containing analytical commentary on the [[source code]] of the [[Version 6 Unix|6th Edition]] [[Unix]] [[computer]] [[operating system]] "resident nucleus"<ref name=UN77-03>{{cite magazine |url=https://archive.org/details/unix_news_march-1977/page/n3/mode/2up |title=NEW BOOK |magazine=UNIX News |publisher=USENIX |date=Mar 1977 }}</ref> (i.e., [[kernel (operating system)|kernel]]) [[software]], plus copy formatted and indexed by Lions, of said source code obtained from the authors at [[AT&T]] [[Bell Labs]]. 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.<ref name="lehey">{{cite web |url=http://www.lemis.com/grog/Documentation/Lions/ |title=''Commentary on the Sixth Edition UNIX Operating System'' |date=2015-09-14 |first=Greg |last=Lehey |publisher=Greg Lehey, Warren Toomey}}</ref> It is suspected to be the most frequently photocopied book in [[computer science]].<ref name="978-1-57398-013-5"/>{{rp|p=xi}} 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,<ref name="978-1-57398-013-5"/> and has been circulated, recreated or reconstructed variously in a number of media by other parties.<ref name="lehey" /> ==History== [[File:Johnlions.jpg|thumb|left|upright|[[John Lions]] with his students in 1980]] [[File:Lions Commentary Unix.jpeg|thumb|left|upright|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<ref name="UN77-03" /> 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 obtained [[History of Unix#1970s|UNIX]] source code in 1975, in response to Ken Robinson's 1974 query to Dennis Ritchie at Bell.<ref>{{cite web |title=Remembering Ken Robinson |first=(Dean) |last=Faculty of Engineering, UNSW |publisher=University of New South Wales: Engineering |date=2020-09-18 |archive-date=2020-10-20 |url=https://www.engineering.unsw.edu.au/computer-science-engineering/news-events/news/remembering-ken-robinson |archive-url=https://web.archive.org/web/20201020153121/https://www.engineering.unsw.edu.au/computer-science-engineering/news-events/news/remembering-ken-robinson }}</ref> Bell Labs was a subsidiary of AT&T, due to the [[Bell_System#1956_Consent_Decree|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]], 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]]'s newsletter, ''UNIX News'', of March 1977, announced the availability of the book to UNIX licensees.<ref name="UN77-03" /> Difficulty in keeping pace with the book's popularity, meant that by 1978 it was available only from AT&T [[Bell Labs]].<ref name="Daemon-GNU-Penguin">[https://web.archive.org/web/20100505073306/http://www.groklaw.net/article.php?story=20050414215646742 The Daemon, The GNU and the Penguin - Chapters 2 & 3] ([[Peter H. Salus]])</ref> When AT&T announced [[Version 7 Unix|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 software|open source]] had a treasured multiple-generation photocopy.{{cn|date=June 2024}} Other follow-on effects of the license change included [[Andrew S. Tanenbaum]] creating [[Minix]]. As Tanenbaum wrote in ''Operating Systems'' (1987): {{quote|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}}).<ref name="978-1-57398-013-5"/> The reissue includes commentary from Michael Tilson (SCO), Peter Salus, Dennis Ritchie, [[Ken Thompson (computer programmer)|Ken Thompson]], Peter Collinson, Greg Rose, [[Mike O'Dell]], Berny Goodheart and [[Peter Reintjes]]. == Contents == [[File:Lions Commentary on UNIX 6th Edition with Source Code.jpg|thumb|''Lions Commentary on UNIX 6th Edition with Source Code'' 1996 reissue<ref name="978-1-57398-013-5">{{cite book |last1=Lions |first1=John |title=Lions' Commentary on UNIX 6th Edition with Source Code |date=1996 |publisher=Peer-to-Peer Communications |isbn=978-1-57398-013-5 |language=en}}</ref>]] ''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. [[File:Brian Kernighan in 2012 at Bell Labs 2.jpg|[[Brian Kernighan]] holding a copy of Lions's ''Commentary''|thumb]] 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, [[Digital Equipment Corporation|DEC]] hardware manuals and so on), a section on the architecture of the PDP-11 and a chapter on how to read [[C (programming language)|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.<ref>{{cite web|url=https://github.com/dspinellis/unix-history-repo/blob/Research-V6/usr/sys/ken/slp.c#L325|title= unix-history-repo/usr/sys/ken/slp.c |author=Ken Thompson|website= [[GitHub]] |access-date=2018-10-12}}</ref> The source code reads:<ref name="odd">{{cite web |url=https://www.bell-labs.com/usr/dmr/www/odd.html |title=Odd Comments and Strange Doings in Unix|author=Dennis Ritchie |date=2002-06-22 |access-date=2021-05-14}}</ref><ref>https://swtch.com/unix/ {{Bare URL inline|date=August 2024}}</ref> <syntaxhighlight lang="c"> /* * 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); } </syntaxhighlight> 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|Version 7 UNIX]].<ref>{{Cite journal |doi = 10.1002/j.1538-7305.1978.tb02141.x|title = UNIX Time-Sharing System: Portability of C Programs and the UNIX System |url=https://www.bell-labs.com/usr/dmr/www/portpap.pdf |archive-url=https://ghostarchive.org/archive/20221009/https://www.bell-labs.com/usr/dmr/www/portpap.pdf |archive-date=2022-10-09 |url-status=live |journal = Bell System Technical Journal|volume = 57|issue = 6|pages = 2021β2048|year = 1978|last1 = Johnson|first1 = S. C.|last2 = Ritchie|first2 = D. M.|s2cid = 17510065 }}</ref> [[Dennis Ritchie]] later explained the meaning of this remark:<ref name="odd"/> {{quote|"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 == * {{anl|xv6}} ==References== {{refs}} == Further reading == * [[Andrew S. Tanenbaum]], ''Operating Systems: Design and Implementation'', ([[Prentice Hall]], {{ISBN|0-13-637331-3}}, June 1987) * [[Brian W. Kernighan]] and [[Dennis Ritchie]], ''[[The C Programming Language]]'', {{ISBN|0-13-110362-8}} == External links == * [https://pdos.csail.mit.edu/6.828/2006/v6.html] * [https://dl.acm.org/doi/10.5555/238143] * [https://www.salon.com/1999/11/30/lions_2/ Code Critic] (Rachel Chalmers, ''[[Salon (website)|Salon]]'', 30 November 1999) * [https://www.groklaw.net/article.php?story=20050502114023686 The Daemon, The GNU and the Penguin - Ch. 6: 1979] ([[Peter H. Salus]]) {{DEFAULTSORT:Commentary on the UNIX Operating System, A}} [[Category:1976 non-fiction books]] [[Category:Unix books]] [[Category:Computer programming books]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anl
(
edit
)
Template:Bare URL inline
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite magazine
(
edit
)
Template:Cite web
(
edit
)
Template:Cn
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox book
(
edit
)
Template:Quote
(
edit
)
Template:Refs
(
edit
)
Template:Rp
(
edit
)
Template:Short description
(
edit
)