理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)

{"type":"doc","content":[{"type":"heading","attrs":{"align":null,"level":1}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/26/2633533a6af811379f0dcc436a0bf6eb.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“打印机事件”以后,理查德斯托曼觉得:软件本该共享。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“如果我喜欢一个程序,我必须与其他喜欢它的人一起共享它。软件销售商想分割用户并统治他们,让每一个用户同意不与其他人共享软件。我拒绝以这样的方法破坏与其他用户的团结。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"他担心如果专有软件成为社会主流,会出现少数强力人物统治计算机工业的局面。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这种局面早在1949年奥威尔的小说《1984》里早有描写。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"“BIG BROTHER IS WATCHING YOU”","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/c3/c31c49fe6a9de75c39c7be9ccf98a175.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"《1984》是英国左翼作家乔治·奥威尔于1949年出版的长篇政治小说。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在这部作品中奥威尔刻画了一个令人感到窒息的恐怖世界,在假想的未来社会中,独裁者以追逐权力为最终目标,人性被强权彻底扼杀,自由被彻底剥夺,思想受到严酷钳制,人民的生活陷入了极度贫困,下层人民的人生变成了单调乏味的循环。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"本篇是理查德斯托曼的第二篇。想查看上一期请在后台回复 RMS001","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"为了捍卫自由,我决定写一个操作系统","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"斯托曼可不想让这种事情发生。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"但现实中的斯托曼却面临两种抉择:加入一家专有软件公司或者离开这个黑客圈子。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"面包与理想。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"或者,斯托曼想,是否有第三种方法,可以解决目前遇到的问题?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"同时维护自己珍视的黑客文化。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"答案显而易见:写一个操作系统,一个自由的操作系统。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"斯托曼的 DNA 动了。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"操作系统作为软件和硬件数据交换的应用程序,非常重要。如果没有操作系统,斯托曼什么也做不了。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"操作系统不仅仅是一个只能运行其他程序的内核。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在70年代,任何排得上号的操作系统都包括有命令解释器、汇编器、编译器、调试器、文本编辑器和电子邮件软件包等等。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"开发一个操作系统是一个巨大的工程,耗时良久。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"为了能够实现这些目标,理查德斯托曼成立了自由软件基金会(Free Software Foundation,简写为 FSF),为 GNU 募集基金。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/c3/c38a83f748f12d8dc970121cf464328e.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“我作为操作系统的开发人员,我拥有的技能正适合这项工作。尽管我不认为成功唾手可得,但是我觉得这是我的天赋。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“我决定将系统设计的与 Unix 兼容以便移植,同时也便于 Unix 用户移植到新的操作系统上来。我按照黑客的传统选择了 GNU 这个名字”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU是“GNU is Not Unix” 的递归同义词。它是g发音的单音节字,就像“grew”,但要用字母“n”替换掉“r”,普通话类似“哥怒”,代表动物是一个牛羚。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1983年,理查德斯托曼宣布建立 GNU 工程(GNU Project)。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/02/020263c7be5a45be1285be1f2d2785ed.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"自由是无价的","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件的英文是:free software,free 在英文中使用最多的两个意思是:免费和自由。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不是免费啤酒(free beer)的“ free” 而是言论自由(free speech)的“free”。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件这个词有比较高的教育成本,斯托曼也曾想更换一个准确的词语来替换 free,例如 unfettered、liberated、freedom 和 open。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“但是这样的代替词要么词义不对,要么就是存在其他缺陷。”斯托曼说。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"很多人认为 GNU 工程的精神就是不该对软件发行的副本收费,或者应只收取很少的钱——只要是成本价即可。这是一种误解。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“自由软件无关价格”。也就是说你可以免费提供,也可以为软件开发收取一定的费用。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“我们鼓励重新发布自由软件的人尽可能多的收取他们想要的费用。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"什么是自由软件?理查德制定了“自由软件四项基本原则”:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度0:无论用户出于何种目的,必须可以按照用户意愿,自由地运行该软件。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度1:用户可以自由地学习并修改该软件,以此来帮助用户完成用户自己的计算。作为前提,用户必须可以访问到该软件的源代码。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度2:用户可以自由地分发该软件的拷贝,这样就可以助人。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度3:用户可以自由地分发该软件修改后的拷贝。借此,用户可以把改进后的软件分享给整个社区令他人也从中受益。作为前提,用户必须可以访问到该软件的源代码。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我们来理解一下:","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度0说明的是一个软件的基本要求:可运行。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度1说明的是软件必须公开源代码。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度2说明的是,源码可以自由分发。","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由度3说明的是,软件作者和使用软件的用户都必须将修改后的程序源代码代码公开,并且可以再次分发。","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果一个软件满足这“自由软件四项基本原则”,那它就是自由软件。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"GNU 软件与 GNU 系统","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU 工程并不是 GNU 软件的集合,考虑到项目的可行性,GNU 工程中包含了GNU 软件和符合“自由软件四项基本原则”的其他自由软件。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这个过程很有意思,斯托曼在列出一个操作系统所需的软件后,第一时间不是去写,而是在想现在有哪些自由软件可以加入到 GNU 工程当中。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU 工程的编译器模块,斯托曼本来想通过这种方式整合到工程中。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当时斯托曼听说荷兰自由大学有一种编译器软件包 VUCK,它是为处理多种语言而设计的编译器,支持当时的 C 语言和 Pascal,支持多种硬件。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"斯托曼给作者写了一封信,作者却回复到:“大学是自由的,但是 VUCK 不是”。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"编译器是非常重要的模块,它主要的目的是将便于人编写、阅读、维护的高级计算机语言所写作的源代码程序,翻译为计算机能解读、运行的低阶机器语言的程序,也就是可执行文件。它能够将人类能看懂的语言编译成机器可以识别的指令,就像软件和硬件之间的一个翻译官,没有它的话,程序就无法让机器识别,机器没法干活。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“因此我决定为 GNU 开发第一个程序是一个支持多语言、多平台编译器”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这个编译器的名字叫做 GCC —— GNU编译器套装( GNU Compiler Collection)","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/12/12e488b3bf7d62ca30446e18239608e7.jpeg","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不会有人不知道 GCC 吧?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"欲善其事,先利其器 —— GNU Emacs","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"代码编辑器很重要。不过当时还没有 VS Code。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“在完成 GCC 之前,我先完成了 GNU Emacs”","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/31/319801758f36b3681be1fb9de8ed4f86.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“我开发 GNU Emacs 的工作开始于1984年,1985年初 GNU Emacs 便可以开始使用了。这使得我可以在 Unix 机器上进行编辑工作。而在此之前,因为没有兴趣使用 vi 或者 ed,我的文本编辑器工作都是在其他系统上完成的”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Vim 和 Emacs 至今为止都是非常受欢迎的编辑器,为什么这么多人喜欢使用 Vim 和 Emacs?,知乎上一个回答是这样的:","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“作为一个程序员来说,或者作为一个立志成为黑客的人来说,编辑器是你的基础工具,是你必须得绝对熟练掌握的东西,你必须绝对地完全地熟练掌握它,它将伴随你很多年。——一个优秀的设计必须是从一开始就具有优秀的机制,容易被无限的扩展而不丧失兼容。而 vim/Emacs 这样的工具,一旦你掌握,在未来的三十年里你都不用再操心编辑器的问题。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“一旦你掌握,在未来三十年里你都不用操心编辑器的问题。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这或许就是人们喜欢 Vim 和 Emacs 的原因吧。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"宇宙的尽头可能是 Vim 或者 Emacs。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当时的人开始中意 Emacs,那么该如何让 Emacs“飞入寻常百姓家”,让更多人使用呢?专业一点的话,这个词应该叫做“软件发行”。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"当时斯托曼已经辞去了麻省理工学院的职务,作为 GNU 发行大本营的 FTP 服务器在 MIT,它随着机器被淘汰也不能使用了。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“寄给我一盘磁带和一个邮资已付的回信信封,我会把 Emacs 寄回给你,一份150美元。”斯托曼更想使用 Emacs 的用户说。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这个磁带可以理解成现在的 U 盘,是存储程序的介质。斯托曼会把 GNU Emacs 程序拷贝到磁带中,然后邮寄给用户,并收取一定的服务费用。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"因为当时斯托曼没有工作,他想通过自由软件挣钱。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"软件免费,服务收费。这不就是红帽软件的盈利模式之一吗?","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/c6/c6b83219ae929a2c092d2f110b525144.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"确实是这样,斯托曼说:“这(指销售 Emacs 的这种模式)也是当今众多销售完成的、基于 Linux 的 GNU 系统的公司的滥觞”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件无关价格,但是“自由软件” 不表示 “非商业化”。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件必须可以商用、可以商业开发、可以商业发布。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"作为个人用户,你可能花钱购买了自由软件的拷贝,也可能免费拿到。但是无论你如何获得你的拷贝,你都有自由复制和修改该软件,乃至出售该软件的拷贝的权利。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"自由软件基金会","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU Emacs 的火热开始让越来越多的人们加入到 GNU 工程当中,斯托曼觉得这是一个为项目募集资金的好机会。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1985年,在斯托曼创办了 FSF,这是一个完全致力于自由软件开发免税的福利机构,FSF 同时接管了 Emacs 磁带发行业务,在之后的磁带上增加了 GNU 软件和非 GNU 的自由软件,出售自由软件的使用手册,FSF 的业务得到了进一步的发展。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"虽然 FSF 接受捐赠,但是大部分的收入都是 FSF 自力更生换来的,来源于销售自由软件拷贝以及其他服务。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"FSF 编写并维护好了数量相当的 GNU 软件包,最主要的是 glibc 和 shell 两个软件,无论你是学生或工程师,对这两款软件都不陌生吧。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"glibc 是由 FSF 的 Roland McGrath 开发的,glibc 是 GNU/Linux 系统中最底层的API,几乎其它任何运行库都会依赖于 glibc。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"绝大多数的 GNU/Linux 上的 shell 都是 BASH。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"考点来了,BASH 是缩写吗?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"答案:是的。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"BASH 的全称是“Bourne Again Shell”,它是由 FSF 的 Brian Fox 开发。BASH 是 Bourne shell 的后继兼容版本与开放源代码版本。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Bourne shell 是 Unix 第七版上使用的 shell。以简洁、紧凑、高效著称、由 AT&T 编写。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Bourne Again 的双关语是 born again,新生的意思。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"黑客的幽默。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"BASH 现在仍是大多数的类 Unix 操作系统的默认 shell,自从 macOS Catalina 发布以来,macOS 默认 shell 更换为 ZSH。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"Copyleft & GPL","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"源代码正在被版权法保护,那么如何保证 GNU 工程中的自由软件始终都是自由软件呢?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"1989年2月15日,斯托曼起草了并发布了 GNU General Public License, GNU 通用公共许可协议,简称为 GNU GPL。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"目前该协议已经发布三个版本,最新版本 GNU GPLv3 于2005年由斯托曼起草,2007年由 FSF 发布。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如果你在 Github 或者 Gitee 新建一个开源项目的时候,在创建仓库的时候会让你选择不同的开源许可证,GNU GPL 就是其中的一个。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面我们大概来看一下这个三个版本的主要内容。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU GPLv1 主要解决了以下两个问题:软件经销商必须按照 GNU GPL 的 3a和3b 章节规定,提供人类可读的源码。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"第二,考虑到自由软件可能会和专有软件相结合,例如在 Unix 机器上使用 BASH,这会导致 BASH 不能自由分发。Unix 是专有软件。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"因此,根据 GNU GPLv1 条款分发的软件可以和更宽松的条款与软件相结合,因为这不会改变整体可以分发的条款。但是不能与在更严格的许可证下分发的软件相结合,这会产生冲突。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件和专有软件“井水不犯河水”。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU GPLv2 规定开发者使用基于 GNU GPL 的软件开发新软件时,必须强制遵守分享源码的条款,否则新软件将无权发布。即使新软件中只用到了一点点的自由软件,整个软件都必须以 GNU GPL 发布。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"正是因为这一点,GNU GPL 许可证也被称为“病毒”式许可证,因为它像“病毒”一样,感染所有触及它的程序。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU GPLv3 提高了与许多开放源代码软件许可证(例如 Apache许可证 2.0)和 GNU Affero 通用许可证的兼容性。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/93/9343c83e19138dfa7bfffb52634fd083.png","alt":"理查德·斯托曼:为了自由,我决定写一个GNU操作系统(下)","title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"许可证兼容性在 GNU GPLv2 中是无法进行兼容的,毕竟使用了 GNU GPLv2 的自由软件开发项目,其软件许可必须为 GNU GPLv2。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU Affero 通用许可证是 GNU GPL 的衍生版本,由 Affero 公司提供,其目的是避免自由软件被软件服务提供商使用而逃避 GNU GPL 的许可证规定义务的现象发生。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"举个例子,像谷歌、微软、亚马逊、阿里云这类的云服务公司,在使用自由软件的过程中会增加一部分的新特性,这些特性在 GNU GPLv3 中是要求开放源码的。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"许可证的本质是一个法律问题,不建议各位工程师深度研究,因为确实烧脑。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"什么是 Copyleft 呢?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Copyleft 的中心思想,是给予任何人运行、拷贝、修改以及发行改变后程序的许可,但不准许附加他们自己的限制。从而保障每个人都有获得“自由软件”的软件拷贝的自由,他们成为了不可异化的权利。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"听起来跟 GNU GPL 的思想有点像。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"其实 GNU GPL 就是 Copyleft 一种特定实现形式。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"根据斯托曼的自述,绝大多数的 GNU 软件都在使用 GNU GPL 许可证。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"但是在特殊情况下使用其他种类的“Copyleft”许可证。GNU 使用手册也采取了 Copyleft 许可证。但这种大大简化的许可证,因为手册不需要像 GNU GPL 那样的复杂度。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"GNU Linux GNU/Linux","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"时间一晃来到了1990年,GNU 操作系统距离完成只差一个内核了。为 GNU 操作系统准备的 GNU HURD 内核迟迟不能发布。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU HURD 前身是 Mach 内核,是一款由卡耐基梅隆大学开发出来的微内核,后来在犹他大学得到了发展。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU HURD 是运行在 Mach 之上的一组服务的集合。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Mach 内核的开发团队曾许诺 Mach 将会以自由软件发布,所以斯托曼等了很久,结果 GNU HURD 开发时间被迫推迟了。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Mach 内核的设备离我们并不遥远。基于 Mach 内核开发出来的操作系统现在已经成为了众多极客的选择,这个操作系统是由苹果公司开发,在 Mach 内核基础上,配合 BSD 的相关技术开发出来了 OS X 内核,基于此内核构建了 macOS 系统。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"斯托曼说:“选择该设计的原因之一,是希望避免看似最为困难的工作:调试一个内核程序而没有相应的源代码级调试器。这部分工作在 Mach 中已经完成,而我们期望用 GNU 调试器调试作为用户程序的 HURD 服务器。我们耗费了许多时间才使它成为可能,而且互相之前发送信息的多线程服务器也是非常难以调试的。使用 HURD 稳定运行这一工作已经花了几年时间。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"由于 HURD 内核迟迟不能投入使用。又碰巧在1991年,林纳斯托瓦兹开发了一个与 Unix 兼容的内核称之为 Linux。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"虽然 GNU 和 Linux 结合本身就是一项非常艰巨的工作,但是到1992年左右,两个软件已经融合成为一个自由的操作系统。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"但是现在我们都叫这种运行 GNU 软件和 Linux 内核的操作系统为 Linux。斯托曼非常不满,这个称呼忽略了 GNU 贡献,所以在 FSF 的定义里,这种操作系统叫做 GNU/Linux。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“Linux 只是一个内核”。","attrs":{}}]},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"“时至今日,我常常不是唯一的战士。我看见成群结队的黑客掘土加固战壕,我既感到宽慰,也感到快乐,我明白城市会继续矗立在这里——至少现在如此。但失败的危险与日俱增。现在微软已经明确地表示将我们的社团视为打击目标,我们不奢望未来自由会从天上掉下来。天上是不会掉馅饼的!如果你希望维护你的自由,那么你必须做好准备捍卫它”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"——理查德斯托曼","attrs":{}}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自由软件运动到现在为止还在进行着,微软也没有成为自由软件运动的对手。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GNU 的目的是给用户以自由,而不仅是为了争取大量用户。越来越多的人使用自由软件,很多新用户是纯粹本着 GNU/Linux 好用来的,但是对自由软件的哲学基础却不甚了解。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"向新用户推广自由软件概念是一项极具艰巨的任务。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"埃里克雷蒙德说“理查德斯托曼的 GCC、Emacs、GNU GPL 真的改变了世界,他帮助‘发明’所做的开放、协作的开发模式正在走向胜利。他的代码取得了胜利,但是他的自由软件思想失败了,更可悲的是,理查德斯托曼更看重自由软件思想,而不是代码。”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"对于理查德来说,更可悲的是在1998年。因为那一年自由软件中的部分成员决定停用使用“自由软件”这个称呼,改用“开源软件(open source)”","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这就是另外一个故事了。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","marks":[{"type":"italic","attrs":{}}],"text":"站在巨人的肩膀上","attrs":{}}]},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://movie.douban.com/subject/26647117/discussion/616371977/","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://zh.wikipedia.org/wiki/自由软件","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://www.gnu.org/philosophy/free-sw.html","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://zh.wikipedia.org/wiki/编译器","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://www.zhihu.com/question/19712884/answer/15939069","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://zh.wikipedia.org/wiki/Bash","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://zh.wikipedia.org/wiki/Bourne_shell","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://zhuanlan.zhihu.com/p/57656644","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"《若为自由故:自由软件之父理查德 斯托曼传》[美]SAM WILLIAMS 著 邓楠 李凡希 译","attrs":{}}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"《开源软件文集:开源革命之声》Chris DiBona,Sam Ockman,Mark Stone 编 洪峰 译","attrs":{}}]}]}],"attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章