其他
《UNIX 传奇:历史与回忆》杂感
Unix 最初是“草根”操作系统
"UNIX is very simple, it just needs a genius to understand its simplicity." --- Dennis Ritchie
Perhaps the most important achievement of Unix is to demonstrate that a powerful operating system for interactive use need not be expensive either in equipment or in human effort: it can run on hardware costing as little as $40,000, and less than two man-years were spent on the main system software. We hope, however, that users find that the most important characteristics of the system are its simplicity, elegance, and ease of use. --- https://www.bell-labs.com/usr/dmr/www/cacm.html
BYTE in 1984 reported that the PC's Intel 8088 microprocessor outperformed the PDP-11/23 when running Unix. --- https://en.wikipedia.org/wiki/PDP-11#Decline
MS-DOS was a pretty pathetic operating system. --- Brian Kernighan https://youtu.be/O9upVbGSBFo?t=2421
图片来源:https://en.wikipedia.org/wiki/Ken_Thompson
图片来源:https://www.bell-labs.com/usr/dmr/www/picture.html
Unix 早期历史
ken
和 dmr
,分别存放二人各自维护的源文件。到了 V7 才根据功能划分——而非源码作者——组织内核源文件。30岁的 Ken 和 32 岁的 dmr 在 1973 年夏天用 C 语言重写了 Unix 内核,即 Unix v4; 30 多岁的 Douglas Comer 在 1981 年发布了 XINU; 三个 Waterloo 大学的学生花两年的时间写了一个名叫 Coherent 的 Unix-clone 操作系统,在 1983 年发售; 1983 年,有人出版了一本讲 TUNIS 系统的书,讲他自己重写的 Unix-like 系统; 43 岁的 Andrew Tanenbaum 在 1987 年发布了 Minix 1.0(花了他用 3 年业余时间),然后与人合作在 1997 年发布了 Minix 2.0; 21 岁的 Linus Torvalds 在 1991 年 9 月发布了 Linux 0.01 (开发用了不到一年时间)。跟前五个最初都是面向 16-bit 硬件有所不同,Linux 0.01 直接在 32-bit 的 80386 上开发。
参考资料
维基百科:https://en.wikipedia.org/wiki/History_of_Unix 和 https://en.wikipedia.org/wiki/Research_Unix 早期历史可看 dmr 亲自写的:https://www.bell-labs.com/usr/dmr/www/hist.html 稍后几年的历史发展可以参考:http://www.darwinsys.com/history/hist.html Marshall Kirk McKusick 写了 Unix 在 Berkeley 的 20 年:https://www.oreilly.com/openbook/opensources/book/kirkmck.html
Unix 的遗产
printn()
函数,打印 b 进制的整数 n,其中最后一句是:C 语言 示范了操作系统的接口应该是什么样子的
open()
它两次,拿到两个 fd;或者 open 一次,再 dup()
一次拿到两个 fd,这两种情况在读写的时候有何区别?普通文件的 inode 有什么内容,为什么文件名不在里边?fork
/exec
/wait
/kill
这套管理进程的系统调用在多线程时代显得有些过时,我比较同意微软的人写的这篇文章:《A fork() in the road》。《Unix 传奇:历史与回忆》是一本有趣的闲书
void main()
这样的谭浩强式 C 语言写法,但愿不要有人拿这当例子说明 void main()
是对的——“你看大名鼎鼎的 Kernighan 自己都这么写哦!”。这本书讲了很多人和事,历史总是不断重复的,书上的故事情节竟然也在自己身边发生着,让人不禁感叹太阳底下没有新鲜事。Kernighan massively downplays his role in projects he's worked on, every single time. --- https://www.youtube.com/watch?v=O9upVbGSBFo&lc=UgylDUW5edZ_3h417XJ4AaABAg
bwk 是计算机科学家,他拿了普林斯顿的博士学位,从贝尔实验室退休之后回到普林斯顿当教授。他早年和 Shen Lin 合作写了关于图划分问题与旅行商问题的两篇经典论文。 Unix 这个名字是 bwk 给取的。 合作设计了 awk 和 AMPL 语言。尽管写了 K&R 一书,但是 C 语言的设计和实现跟 bwk 没有关系,把 bwk 称为“C 语言之父”是不恰当的。bwk 自己说过:BWK: I had no part in the birth of C, period. It's entirely Dennis Ritchie's work. I wrote a tutorial on how to use C for people at Bell Labs, and I twisted Dennis's arm into writing a book with me. 写了很多文档和教程,为 Unix 的早期传播与推广做出了巨大贡献。包括 Troff 排版教程、eqn 排版教程、pic 排版教程、C 语言教程 (后来扩展成了 K&R 一书的正文部分)、Unix 操作教程(后来成了《Unix 编程环境》一书)等等。请参考 1979 年 Unix 第 7 版的程序员手册第 2 卷:https://s3.amazonaws.com/plan9-bell-labs/7thEdMan/bswv7.html。 写了早期 Unix 的许多应用程序,包括 cron、awk、eqn、pic、ditroff、m4 等等。 Adison-Wesley 出版社 Professional Computing 系列丛书的顾问编辑,这个系列包括了 W. Richard Stevens 的《APUE》《TCP/IP 详解》、Scott Meyers 的《Effective C++》、GoF 的《设计模式》等经典著作。 2002 年入选美国国家工程院院士 (NAE)
推 荐 阅 读
《风格的要素:简明英语写作圣经》读书笔记
《操作系统之编程观察》清华大学出版社
软件故事:谁发明了那些经典的编程语言?