Second Edition Unix
Release Date: June 12, 1972
Released By: Bell Labs Research
Source Code: some source code is in the Unix Archive, browsable in the Unix Tree
Documentation: 2nd Edition man pages
The Second Edition of Unix was developed for the PDP-11/20 at Bell Labs by Ken Thompson, Dennis Ritchie and others. It extended the First Edition with more system calls and more commands. This edition also saw the beginning of the C language, which was used to write some of the commands.
The Second Edition, like the first, was only designed to run on the unprotected PDP-11/20 and requires the Extended Arithmetic Element to simulate some operations which would later be supported natively on the PDP-11/45 and other models. This would be the last PDP-11/20 unprotected version of UNIX, as the following Third Edition represents an intermediary PDP-11/45 assembly version of the system and the kernel is rewritten in C before the Fourth Edition.
The code in the Unix Archive is only the source to some of the commands, some of the library functions, and the C compiler. The files in c/ come from the last1120c.tar.gz tape, and form a working C compiler for Second Edition Unix.
The files in lib/ come from the libc.sa file which is on the last1120c.tar.gz tape, and form the C library for the compiler.
The files in cmd/ are recreated from the text fragments found on the file s1-bits.gz. These were reconstructed by Doug Merritt and Warren Toomey, and form the source code to some of the commands in Second Edition Unix.
Another archive, s2-bits.tar.gz, contains what appears to be a dump of the root filesystem of a Second Edition UNIX installation. The contents include binaries of three different formats: those that explicitly call brk upon start, those with a magic number of 405(8), the First Edition a.out(V) format, and those with a magic number of 407(8), the Second Edition a.out(V) format. These format discrepancies may imply the rough linking time of the various objects present.
Changes include:
- Exit/wait now support returning a status
- Many system limits are increased (e.g. mounts, buffer sizes)
- The hog, kill, sleep, and sync syscalls are added
- Added mount command to the INIT tape
- Dropped chown, cp, ln, mv, rm, rmdir, stat commands from INIT tape
- The init system now uses getty and login
- The shell now supports [ ] character class matches, appending with >>
- The shell has expanded programming support with control flow (provided by programs) and error messages
- Many commands add diagnostics
- The stty command is added to set terminal characteristics
- The cp and mv commands no longer operate on pairs
- The ds, istat, and salv filesystem tools are added
- NROFF is allegedly added or very close, as it is in the manual TOC but the page is absent
- The assembler and linker now support relocation and segmentation
- The bc B interpreter replaces the old B system
- The cc C compiler is introduced
- The m6 macro processor is introduced
- The tmg compiler-compiler is introduced
- The fc Fortran compiler replaces the old for compiler
- The linker now supports the Explor language
- Libraries move from /etc to /usr/lib
- The floating point simulator is improved
- The atan, hypot, and sqrt math functions are added
- The salloc string library is added
- The qsort algorithm is added
- Connectivity to GECOS via the 201 data phone is added
- IBM 2741 support is added
- Magtape support is added
- The motd file is added
- Removed the binary punched paper tape format and utilities
- Removed many device-specific commands (e.g. dtf, rkf)
The following papers are mentioned in SEE ALSO sections in the manual:
- Users' Reference to B - K. Thompson
- C Reference Manual - D.M. Ritchie
- M6 Manual - A.D. Hall
- ROFF Manual - J.F. Ossanna
- The UNIX Time-sharing System - D.M. Ritchie, K. Thompson
For more information about Second Edition Unix, see The Evolution of the Unix Time-sharing System by Dennis Ritchie.