From Berkeley to Bell Labs
Source 08:24At Vintage Computer Festival East, Brian Kernighan asks Ken Thompson about the work that led to Unix, its tools and his chess computers. The two had worked at Bell Labs for decades, with offices across the hall from one another.
Thompson recalls having access to Berkeley's main computer after it shut down for the night. “I loved them,” he says of computers; he worked intensely without a particular career goal. A teacher from Bell Labs helped him get into graduate school; Thompson says he did not apply himself because he did not think he was good enough.
When Bell Labs later invited him to interview, he initially declined. He did not want a job at a commercial institution and thought it wrong to take the travel money. He agreed to visit, warning that his answer would be no. Walking down the research corridor, he recognized the names on the doors. After an offer caught up with him during a trip down the East Coast, he reconsidered and accepted.
After Multics, a smaller system
Source 17:06At Bell Labs, Thompson worked on Multics, the time-sharing project involving MIT, Bell Labs and General Electric. He remembers it as too large and over-engineered; he was doing programming work, but not building a system he wanted to use. Bell Labs eventually withdrew, leaving management disinclined to fund another operating system.
Thompson found a PDP-7 used for engineering work and took it over for experiments, including a space game. He also became interested in its disk. To test a disk-scheduling algorithm under load, he began writing programs to drive it.
Three weeks on the PDP-7
Source 21:27As those programs accumulated, Thompson realized he was roughly three weeks away from an operating system: he needed an editor to write code, an assembler to make it executable, and a small kernel. His wife took their young child to visit family in California for three weeks. He stayed behind and built the three pieces: “One week, one week, one week, and we had Unix.”
That is Thompson's compressed recollection of the beginning, not a claim that a complete modern Unix was built in three weeks. He describes a small system on a slow machine with two terminals. Dennis Ritchie, Doug McIlroy and Robert Morris were among its early users.
A patent office proposal brought the next machine
Source 24:48The group asked for a PDP-10 to run Unix and was refused. Thompson recalls that Joe Ossanna then proposed a different use: the patent department needed to prepare documents with specific formatting and numbering requirements. The team argued that it could do the work and save money.
They obtained a PDP-11, brought Unix over and developed formatting tools. Patent staff used the machine during the day; the researchers worked on it at night. Thompson adds that they avoided risky work during the day because the machine was not protected against a crash.
Pipes changed how the tools fit together
Source 30:41McIlroy had proposed connecting programs. Thompson says his first attempt on the PDP-7 let cooperating processes communicate but was awkward and went unused. He worried that queues in a general network of processes would grow or run empty, and he did not yet see a useful application for it.
Later, he says, the idea of pipes came to him. Unix already supported input and output redirection, so he put the mechanism into the operating system and tried it in the shell. He and Ritchie then rewrote their tools to behave as filters: read input, process it, and write output without status messages getting in the way.
One experiment connected a calculator to a program that turned numbers into words and then to a speech synthesizer. Kernighan remembers the period as a frenzy of discovering combinations. Thompson remembers “interconnections of things that were never meant to be in the same room together.”
Grep was already in Thompson's directory
Source 35:34Kernighan asks about grep, a program people had been using since the early 1970s. Thompson says he had already written it and kept it in his own directory. He did not want to decide unilaterally which of his programs belonged in the shared bin directory.
When McIlroy asked for a way to search files, Thompson said he would think about it overnight. In his telling, he spent at most about an hour fixing bugs and finishing things he had intended to do, then presented grep the next day. It moved into bin; its name eventually became a verb.
From B to C, and a kernel rewrite
Source 41:09Thompson also recounts writing B under the PDP-7's tight memory constraints. He says an early attempt at a Fortran implementation was far too large, so he kept cutting it down. As he added features, he used a disk-based version to work on the compiler when it grew beyond the space available in memory.
Ritchie later developed a new version of B and, as Unix moved to the PDP-11 with more memory, turned it into C. Types were a major addition. Thompson credits Ritchie with that conversion and says his own attempts to rewrite the kernel in the evolving language failed three times. After structures were added, he says, the rewrite worked.
A chess machine that did not reach Moscow
Source 46:26Thompson's interest in chess led him from a software program to dedicated hardware. He describes early tournament losses, a faster machine, and later work with Joe Condon, whose hardware design tools helped build a more serious system. Thompson says their machine became a world champion in 1980.
He was subsequently invited to demonstrate it in Moscow. He delivered the computer to the freight terminal before his flight, but it did not arrive with him. After repeated inquiries and a newspaper story, he learned that it had been held in the United States. Thompson recalls paying a fine through Bell Labs and getting the machine back; the planned demonstration had already failed. This is his account of the episode in the interview.
This article is adapted from the Vintage Computer Federation's “VCF East: Ken Thompson interviewed by Brian Kernighan.”