Friday, May 2, 2008

The History of UNIX

In the mid-1960s, AT&T Bell Laboratories (among others) was participating in an effort to develop a new operating system called Multics. Multics was intended to supply large-scale computing services as a utility, much like electrical power. Many people who worked on the Bell Labs contributions to Multics later worked on UNIX.

In 1969, Bell Labs pulled out of the Multics effort, and the members of the Computing Science Research center were left with no computing environment. Ken Thompson, Dennis Ritchie, and others developed and simulated an initial design for a file system that later evolved into the UNIX file system. An early version of the system was developed to take advantage of a PDP-7 computer that was available to the group.

An early project that helped lead to the success of UNIX was its deployment to do text processing for the patent department at AT&T. This project moved UNIX to the PDP-11 and resulted in a system known for its small size. Shortly afterward, the now famous C programming language was developed on and for UNIX, and the UNIX operating system itself was rewritten into C. This then radical implementation decision is one of the factors that enabled UNIX to become the open system it is today.

AT&T was not allowed to market computer systems, so it had no way to sell this creative work from Bell Labs. Nonetheless, the popularity of UNIX grew through internal use at AT&T and licensing to universities for educational use. By 1977 commercial licenses for UNIX were being granted, and the first UNIX vendor, Interactive Systems Corporation, began selling UNIX systems for office automation.

Later versions developed at AT&T (or its successor, Unix System Laboratories, now owned by Novell) included System III and several releases of System V. The two most recent releases of System V, Release 3 (SVR3.2) and Release 4 (SVR4; the most recent version of SVR4 is SVR4.2) remain popular for computers ranging from PCs to mainframes.

All versions of UNIX based on the AT&T work require a license from the current owner, UNIX System Laboratories.

Berkeley Software Distributions

In 1978 the research group turned over distribution of UNIX to the UNIX Support Group (USG), which had distributed an internal version called the Programmer's Workbench. In 1982 USG introduced System III, which incorporated ideas from several different internal versions of and modifications to UNIX, developed by various groups. In 1983 USG released the original UNIX System V, and thanks to the divestiture of AT&T, was able to market it aggressively. A series of follow-on releases continued to introduce new features from other versions of UNIX, including the internal versions from the research group and the Berkeley Software Distribution.

While AT&T (through the research group and USG) developed UNIX, the universities that had acquired educational licenses were far from inactive. Most notably, the Computer Science Research Group at the University of California at Berkeley (UCB) developed a series of releases known as the Berkeley Software Distribution, or BSD. The original PDP-11 modifications were called 1BSD and 2BSD. Support for the Digital Equipment Corporation VAX computers was introduced in 3BSD. VAX development continued with 4.0BSD, 4.1BSD, 4.2BSD, and 4.3BSD, all of which (especially 4.2 and 4.3) had many features (and much source code) adopted into commercial products. Various later releases from UCB have attempted to create a publicly redistributable version of UNIX (prior releases had source code available only to source licensees). Notably, the "Second Networking Release" (Net2) was intended to make available all the parts of the Berkeley Software Distribution that were not subject to license restrictions. UNIX System Laboratories (USL) brought a lawsuit against the University and a company called Berkeley Software Design, Incorporated (BSDI). USL claimed license infringements by the BSD releases and BSDI's BSD/386 product, which was based in part on the BSD code. Recently the lawsuit was settled; the result is that BSDI is shipping BSD/386, and a new 4.4-Lite release of BSD, which requires no license from USL, will be available from UCB.

UNIX and Standards

Because of the multiple versions of UNIX and frequent cross-pollination between variants, many features have diverged in the different versions of UNIX. With the increasing popularity of UNIX in the commercial and government sector came the desire to standardize the features of UNIX so that a user or developer using UNIX could depend on those features.

The Institute of Electrical and Electronic Engineers created a series of standards committees to create standards for "An Industry-Recognized Operating Systems Interface Standard based on the UNIX Operating System." The results of two of the committees are important for the general user and developer. The POSIX.1 committee standardizes the C library interface used to write programs for UNIX. POSIX.2 committee standardizes the commands that are available for the general user.

In Europe, the X/Open Consortium brings together various UNIX-related standards, including the current attempt at a Common Open System Environment (COSE) specification. X/Open publishes a series of specifications called the X/Open Portability Guide, currently at Version 4. XPG4 is a popular specification in Europe, and many companies in the United States supply versions of UNIX that meet XPG.

The United States government has specified a series of standards based on XPG and POSIX. Currently FIPS 151-2 specifies the open systems requirements for federal purchases.

UNIX for Mainframes and Workstations

Many mainframe and workstation vendors make a version of UNIX for their machines. The best way to get information on these is directly from the manufacturer.

UNIX for Intel Platforms

Thanks to the great popularity of personal computers, there are a great number of UNIX versions available for Intel platforms. Choosing from the versions and trying to find software for the version you have can be a tricky business because the UNIX industry has not settled on a complete binary standard for the Intel platform. There are two basic categories of UNIX systems on Intel hardware, the SVR4-based systems and the older, more established SVR3.2 systems.

SVR4 vendors include NCR, IBM, Sequent, SunSoft (which sells Solaris for Intel), and Novell (which sells UnixWare). The Santa Cruz Operation (SCO) is the main vendor in the SVR3.2 camp. Vendors in the first camp are working toward cleaning up the standards to gain full "shrink-wrap portability" between their versions of UNIX. The goal is that this will make UNIX-on-Intel applications available, shrink-wrapped for any version of UNIX, just as you can now buy applications for MS-DOS or Microsoft Windows. SCO UNIX currently has a much larger base of available applications and is working to achieve binary compatibility with UnixWare.

Source Versions of "UNIX"

Several versions of UNIX and UNIX-like systems have been made that are free or extremely cheap and include source code. These versions have become particularly attractive to the modern-day hobbyist, who can now run a UNIX system at home for little investment and with great opportunity to experiment with the operating system or make changes to suit his or her needs.

An early UNIX-like system was MINIX, by Andrew Tanenbaum. His books Operating Systems: Design and Implementations describes MINIX and includes a source listing of the original version of MINIX. The latest version of MINIX is available from the publisher. MINIX is available in binary form for several machines (PC, Amiga, Atari, Macintosh, and SPARCStation).

In addition to the BSD386 product from BSDI, there is a free version of UNIX also based on the BSD releases, and called, confusingly, 386BSD. This is an effort by Bill and Lynne Jolitz to create a system for operating system research and experimentation. The source is freely available, and 386BSD has been described in a series of articles in Dr. Dobbs' Journal.

Another popular source version of UNIX is Linux. Linux was designed from the ground up by Linus Torvalds to be a free replacement for UNIX, and it aims for POSIX compliance. There are current efforts to make Linux reliably run both SVR3.2 and SVR4 binaries. There is also a project called WINE to create Microsoft Windows emulation capability for Linux.

Making Changes to UNIX

Many people considering making the transition to UNIX have a significant base of PC-based MS-DOS and Microsoft Windows applications. There have been a number of efforts to create programs or packages on UNIX that would ease the migration by allowing users to run their existing DOS and Windows applications on the same machine on which they run UNIX. Products in this arena include SoftPC and SoftWindows from Insignia, WABI from SunSoft, and WINE for Linux and 386BSD.

Introduction to the UNIX Philosophy

As described in the section "The History of UNIX," UNIX has its roots in a system that was intended to be small and supply orthogonal common pieces. Although most UNIX systems have grown to be fairly large and monolithic applications are not uncommon, the original philosophy still lives in the core commands available on all UNIX systems. There are several common key items throughout UNIX:

  • Simple, orthogonal commands

  • Commands connected through pipes

  • A (mostly) common option interface style

  • No file types

Simple, Orthogonal Commands

The original UNIX systems were very small, and the designers tried to take every advantage of those small machines by writing small commands. Each command attempted to do one thing well. The tools could then be combined (either with a shell script or a C program) to do more complicated tasks. One command, called wc, was written solely to count the lines, words, and characters in a file. To count all the words in all the files, you would type wc * and get output like that in Listing 1.1.

    Using a simple command.
$ wc *

351 2514 17021 minix-faq

1011 5982 42139 minix-info

1362 8496 59160 total


Commands Connected Through Pipes

To turn the simple, orthogonal commands into a powerful toolset, UNIX enables the user to use the output of one command as the input to another. This connection is called a pipe, and a series of commands connected by pipes is called a pipeline. For example, to count the number of lines that reference MINIX in all the files, one would type grep MINIX * | wc and get output like that in Listing 1.2.

    Using a pipeline.
$ grep MINIX * | wc

105 982 6895


A (Mostly) Common Option Interface Style

Each command has actions that can be controlled with options, which are specified by a hyphen followed by a single letter option (for example, -l). Some options take option arguments, which are specified by a hyphen followed by a single letter, followed by the argument (for example, -h Header). For example, to print on pages with 16 lines each all the lines in the file minix-info that mention Tanenbaum, you would enter wc minix-info | pr -l 16 and get output like that in Listing 1.3.

    Using options in a pipeline.
$ grep Tanenbaum minix-info | pr -l 16

The bad news is that some UNIX commands have some quirks in the way they handle options. As more systems adopt the standards mentioned in the section "The History of UNIX," you will find fewer examples of commands with quirks.

No File Types

UNIX pays no attention to the contents of a file (except when you try to run a file as a command). It does not know the difference between a spreadsheet file and a word processor file. The meaning of the characters in a file is entirely supplied by the command(s) that uses the file. This concept is familiar to most PC users, but was a significant difference between UNIX and other earlier operating systems. The power of this concept is that any program can be used to operate on any file. The downside is that only a program that understands the file format can fully decode the information in the file.


UNIX has a long history as an open development environment. More recently, it has become the system of choice for both commercial and some personal uses. UNIX performs the typical operating system tasks, but also includes a standard set of commands and library interfaces. The building-block approach of UNIX makes it an ideal system for creating new applications.


No comments: