
Unix 哲学流传五十余年,仍影响现代操作系统设计
来源标题:The Unix Philosophy – F/OSS Comics
Unix 自 1971 年首次发布至今已超过五十年,其哲学、API 设计和工具仍存在于各类 Unix 及类 Unix 系统中。Android、Debian、Ubuntu、Arch Linux 使用 Linux 内核,macOS 和 iOS 基于 Unix,Windows 也可通过 WSL 运行 Linux 环境。Unix 经 BSD、System V 等分支演化出 macOS、iOS、Solaris 等系统,并间接影响了 Linux 的发展。
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Share options
↗Copy link fFacebook @Threads BBluesky XX •••More sharing options…
Unix's Legacy Today
Information technology has changed and evolved at an incredible pace. But Unix has been around for more than five decades, and its philosophy, API design, and tools still live on in Unix and Unix-like operating systems.
First released in 1971
"When do I get to retire?"
Unix's legacy is still all around us. Android and Linux distributions such as Debian, Ubuntu, and Arch Linux use the Linux kernel. Apple's macOS and iOS, which run on Macs and iPhones, are Unix-based too. Even Windows can run a Linux environment through the Windows Subsystem for Linux (WSL).
%%{init: {"look": "handDrawn", "theme": "neutral"}}%% flowchart TB Unix([Unix]) --> BSD([BSD]) Unix --> SystemV([System V]) BSD --> NeXTSTEP([NeXTSTEP]) BSD --> FreeBSD([FreeBSD]) BSD --> SunOS([SunOS]) SunOS --> Solaris([Solaris]) SystemV -- SVR4 base --> Solaris Solaris --> OpenSolaris([OpenSolaris]) NeXTSTEP --> MacOSX([Mac OS X]) MacOSX --> macOS([macOS]) MacOSX --> iOS([iOS]) MINIX([MINIX]) -. influenced development .-> Linux([Linux]) Linux -. runs on Windows through .-> WSL([WSL])
MINIX was developed as a small Unix-like system for teaching operating system design. For a more detailed family tree, see Wikipedia.
In 1979, the Unix V7 license prohibited using its source code in the classroom. In response, Professor Tanenbaum developed MINIX to teach operating system design and released it in 1987.
"Maybe I should build a simple OS for my students."
In 1991, Linus Torvalds was using MINIX on his newly purchased Intel 386 PC. While reading Tanenbaum's Operating Systems: Design and Implementation, he began developing the Linux kernel.
"Long winter break... I think I'll read this MINIX book."
The Linux kernel did not use MINIX or Unix source code. It implemented POSIX-style standard interfaces so that source code for existing Unix programs could be compiled and run without modification, and the Linux 0.01 release already came with a port of the Bash shell[5].
"I started implementing the system calls I needed to get Bash running."
"How has Unix continued to shape the tech world for so long?"
To find the answer, we need to understand the Unix philosophy. But Unix did not start with a grand philosophy. Eric S. Raymond later summed it up with a familiar design principle:
"Keep it simple, stupid."[1]
"Come on, you must be joking. Tell me the real philosophy."
According to Wikipedia, "The Unix philosophy, originated by Ken Thompson, is a set of cultural norms and philosophical approaches to minimalist, modular software development. It is based on the experience of leading developers of the Unix operating system."[2]
"Think of small, modular programs. The philosophy grew out of the early Unix developers' experience."
In 1978, Doug McIlroy formally documented the philosophy:[3]
Peter H. Salus later summarized the philosophy once more:[4]
Like LEGO bricks, Unix programs can be connected through their inputs and outputs to build more complex tools. Unix was later rewritten largely in C, making it much easier to port to different computers.
A compiler translates C source code into machine code for its target processor. Of course, hardware-specific code and low-level assembly routines still need to be adapted for each platform.
"Back then, kernels were usually written in assembly. Developing C and using it to rewrite an OS kernel—that was quite an idea!"
"Unix influenced many operating systems for more than just technical reasons. Its source code had a way of traveling. But that's a story for another time..." "Where are you going?"
"That's a secret." (Unix source code on magnetic tape.)
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。