Summer 1969, Bell Labs, New Jersey.
A programmer sat before a small computer, cursor blinking on the screen. He was writing a game—Space Travel—simulating spacecraft movement in the solar system.
But the game ran too slowly. He needed a better computer.
He eyed the lab’s PDP-11, a newly arrived minicomputer. But the PDP-11 had no operating system and couldn’t run programs.
“Then I’ll write one myself,” he thought.
This programmer was Ken Thompson. He was about to write UNIX—the most important operating system in the software world.
Multics: The Failed Giant #
To understand UNIX, first understand its predecessor—Multics.
In the 1960s, Bell Labs, MIT, and General Electric collaborated on developing Multics—a “big and comprehensive” operating system. Multics aimed to support multi-user, multi-tasking, time-sharing, file systems, security mechanisms… almost every feature of modern operating systems.
But Multics was too complex. Development dragged on, features kept expanding, code grew larger. By 1969, Bell Labs decided to withdraw from the project.
Thompson and colleague Dennis Ritchie had both worked on Multics. They learned a lesson from Multics’ failure: Simple is better than complex.
The Birth of UNIX #
After withdrawing from Multics, Thompson asked management to buy a computer to continue developing an operating system. Management refused—they had just lost money on a failed OS project.
Thompson didn’t give up. He found an idle PDP-11 in a lab corner with only 24KB of memory.
In summer 1970, he began writing an operating system on this primitive machine.
He wrote the core parts in assembly language: kernel, file system, process management, shell. The entire system was simple and elegant, only a few thousand lines of code.
He named the system UNICS (Uniplexed Information and Computing Service), a pun on Multics—from “Multi” to “Uni”.
Later, UNICS was renamed UNIX.
The Birth of C Language #
UNIX was originally written in assembly language. But assembly language depends on specific hardware and is hard to port to other computers.
Ritchie thought: What if there were a high-level language that was as efficient as assembly yet as portable as high-level languages?
Based on Thompson’s B language, he designed C language.
C language’s characteristics:
- Simple: Only 32 keywords, simple and clear syntax
- Efficient: Generated code approaches assembly language efficiency
- Portable: Same code can be compiled and run on different machines
- Flexible: Can directly manipulate memory, suitable for systems programming
In 1973, Thompson and Ritchie rewrote UNIX in C. This was the first operating system written in a high-level language in history.
This rewrite was significant: UNIX could be easily ported to different hardware platforms. This laid the foundation for UNIX’s widespread adoption.
The UNIX Philosophy #
UNIX is not just an operating system; it’s a design philosophy.
1. Small is Beautiful
Each program should do one thing and do it well. Don’t write big, comprehensive programs; write small, focused tools.
2. The Power of Composition
One program’s output can become another program’s input. Through pipes, simple tools can be combined into powerful functions.
For example, counting lines containing “error” in a file:
cat log.txt | grep "error" | wc -lThree simple commands combined to complete a complex task.
3. Text is the Universal Interface
Use text as the communication format between programs. Text is human-readable, easy to debug, and flexible to process.
4. Silence is Golden
Programs shouldn’t output unnecessary verbiage when successful. Only speak up when there’s an error.
5. Avoid Interactive Interfaces
Command lines are better than menus. Commands can be scripted and automated; interactive menus cannot.
These principles are called the “UNIX Philosophy” and are still followed by software engineers today.
The Spread of UNIX #
Bell Labs was a subsidiary of AT&T. Due to antitrust agreements with the government, AT&T couldn’t sell software.
So, Bell Labs provided UNIX source code to universities almost for free.
This was a historic decision.
Computer science departments at universities worldwide began using UNIX. Students learned UNIX, modified UNIX, extended UNIX. UNIX became the standard platform for computer education.
Among them, the University of California, Berkeley made the greatest contribution. They developed BSD UNIX (Berkeley Software Distribution), adding TCP/IP networking support, the vi editor, virtual memory, and other important features.
UNIX’s Descendants #
UNIX’s influence extends far beyond itself. Almost all modern operating systems are influenced by UNIX:
Linux: In 1991, Finnish student Linus Torvalds wrote the Linux kernel, combining it with GNU tools to form a complete operating system. Linux inherited UNIX’s design philosophy and became mainstream for servers and embedded systems.
macOS/iOS: Apple’s operating systems are based on BSD UNIX. macOS’s terminal can directly run UNIX commands.
Android: Android is based on the Linux kernel, inheriting UNIX’s file system and process management.
Today, the vast majority of smartphones, servers, and supercomputers run operating systems with UNIX heritage.
The Turing Award #
In 1983, Thompson and Ritchie received the Turing Award—the highest honor in computer science.
The award citation read: “The development of the UNIX system demonstrated principles of software engineering: simplicity, elegance, portability. It created a paradigm for software development that influenced generations of programmers.”
Ritchie was called the “Father of UNIX,” Thompson the “Mother of UNIX”—because Ritchie designed C language, Thompson wrote the initial kernel.
Ritchie’s Passing #
In 2011, news of Steve Jobs’ death dominated headlines. But almost no one noticed that a few days later, Dennis Ritchie also passed away.
Ritchie was low-key throughout his life, not seeking fame or fortune. The C language and UNIX he created influenced the entire computer world. But he never showed off his achievements.
Programmer Rob Pike wrote: “Jobs was a shining star; Ritchie was a quietly dedicated scientist. When Jobs was on stage showing off the iPhone, Ritchie was in a corner at Bell Labs writing code. But Ritchie’s work made Jobs’ work possible.”
Next Step: The Internet #
Operating systems made computers easy to use. But computers were still isolated—each machine ran independently, not connected to others.
In the 1960s, the U.S. Department of Defense began a project: building a communications network that could survive a nuclear war.
This project was called ARPANET. It would become the precursor to the Internet.
Tomorrow, we’ll discuss the birth of the Internet.
Today’s Key Concepts #
Operating System Software that manages computer hardware resources and provides services to applications. Core functions include process management, memory management, file system, device drivers, and user interface. UNIX is the ancestor of modern operating systems.
Kernel The core part of an operating system, responsible for managing hardware resources and scheduling program execution. The kernel runs in privileged mode and can directly access hardware. Applications interact with the kernel through system calls.
Pipe
An important UNIX concept that allows one program’s output to become another program’s input. Through pipes, simple tools can be combined into powerful functions. For example: ls | grep ".txt" | wc -l counts the number of txt files in the current directory.
Discussion Questions #
- The UNIX Philosophy emphasizes “small is beautiful” and “the power of composition.” Can you think of examples in modern software that follow this philosophy?
- Without UNIX and C language, what do you think computers would be like today?
Tomorrow’s Preview: The Origins of the Internet—how was ARPANET born during Cold War rivalry and become a network that changed the world?