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.
In 1979, Ritchie described the group's vision for Unix:
1960s
Multics
In the late 1960s, Bell Labs was involved in a project with MIT and General Electric to develop a time-sharing system, called Multics, allowing multiple users to access a mainframe simultaneously. A key concept of the Multics system was the use of a single-level store. In this concept, there is no directly accessible file system. Instead, programs simply refer to data as if it is already in memory, if it is not, the virtual memory (VM) system loads it automatically. This means programs do not have to write code to explicitly read and write data from files into memory to manipulate it, the operating system does this all invisibly.
The Multics project began to bog down, and it became clear to the Bell team that the system was unlikely to deliver a working operating system in the near term, let alone a reasonably performant one. Bell Labs management ultimately withdrew from the project, and it seemed likely the company was going to end their lease on the very expensive GE 645 mainframe. Ken Thompson, a programmer in the Labs' computing research department, enjoyed the flexibility of Multics and began considering a new operating system that could run on less sophisticated machines.
New system
The basic concept was to use Multics' hierarchical file system but remove the single-level store. Thompson felt that the idea of a single-level store was ultimately a bad one as it treats all memory the same, whether program code or data, when in actual use they were treated very differently. Program code is rarely modified at runtime, may be placed in a read-only area of memory, and is randomly accessed due to branching. In contrast, data is almost always writable as runtime modification of file data is often the entire point of the program, and sequential access, as opposed to random, is a normal means of access. While his new system would require programmers to write their own routines to load and save data, that did not appear to be unreasonable.
Thompson began writing simulations of the new system under Multics, to understand the paging performance of the system. As this appeared promising, Thompson began writing the system for the GE 645, starting with a new custom assembler language. But it soon became clear that the 645 would be gone in some months, and the work was abandoned. Throughout this period, Thompson also repeatedly petitioned management to purchase a smaller system than the GE 645 in order to build a similarly programmer-friendly operating system. Management refused all of these requests.
Space Travel, move to PDP-7
In 1969, Thompson had also written a video game, Space Travel, under the GECOS operating system on the smaller GE 635 machine. This had the undesirable problem that a typical game cost $75 worth of billable CPU runtime. When he learned that another department had a small PDP-7 that was largely unused, he began to rewrite the game for this machine. This was initially performed by building a binary for the PDP-7 using a cross compiler on the 635, and then moving the resulting code to the PDP-7 using paper tape.
This became tedious, and Thompson began considering writing his new operating system on the new machine. This was aided by a timely vacation by his wife, leaving him with a month to work on it full time. Aided by Ritchie and Rudd Canaday, they implemented a version of the hierarchical file system Thompson had studied on the 645. The ability to start programs stored in that file system soon followed, and then small programs to copy, delete, print and edit those files, along with a command-line interpreter to allow the user to perform all of these operations interactively. With these in place, a new assembler was written for the machine, and Space Travel moved entirely to the new platform.