古董电脑室和 LCM+L 展开目录
很长一段时间前我在知乎上偶遇了古董电脑室这个专栏,在带你逛西雅图活电脑博物馆这个系列文章中我了解到在 Living Computers Museum + Labs 是可以申请登入他们的一些珍贵的古董机器的。当时我便提交了自己的申请,过了这么久几乎已经要忘记这件事时,我的邮箱中收到了两封邮件。
Welcome to Living Computers: Museum + Labs. Thank you for your interest in our online systems!
Your account has been created on our PDP-11/70 running Unix, version 7. You may connect to the system via ssh to pdp1170@TTY.LivingComputerMuseum.org
Your account has been created on our 2065 running Tops-10. You may connect to the system with telnet at the address DEC-10.LivingComputerMuseum.org
LCM+L 批准我使用他们的 PDP-11/70 (DEC DataSystem 570) 和 DEC SYSTEM-2065 这两台机器。当然,LCM+L 不仅只提供了这两种古董电脑给公众试用,还有一些其他型号。具体的可以在他们的网站中看到,若有兴趣也可以去 Request Login。我尝试连接了 2065,可以顺利通过 Telnet 连到 LCM+L 的代理上,但是到 2065 的登录申请却一直没有反应。
PDP-11/70 是可以通过 ssh 连接并顺利登录的。
PDP-11/70 展开目录
The PDP-11 family was announced in January 1970 and shipments began early that year. DEC sold over 170,000 PDP-11s in the 1970s. Initially manufactured of small-scale transistor–transistor logic, a single-board large scale integration version of the processor was developed in 1975. A two-or-three-chip processor, the J-11 was developed in 1979. The last models of the PDP-11 line were the PDP-11/94 and -11/93 introduced in 1990.
上面一段介绍摘自维基百科。PDP-11 是一款由迪吉多电脑(DEC,Digital Equipment Corporation)于 1970 至 1990 年代发售的小型机。而 PDP-11/70 是 PDP-11/45 的增强版,支持 4 MiB 内存与 2 KiB 缓存,通过 Massbus 可以获取更快的输入输出设备连接。
(图片来自带你逛西雅图活电脑博物馆)
首先用 ssh 连接到代理,通过邮件中给定的用户就可以登入 PDP-11/70 了。按照邮件的提示,首次登录后我们应该 passwd
修改密码。
- Bokjan@Bokjan-MBP ~> ssh pdp1170@tty.livingcomputermuseum.org
- Last login: Tue Feb 28 10:26:59 2017 from 104.131.158.221
- NetBSD 7.0_STABLE (GENERIC.201608020750Z)
- Trying 199.59.106.27...
- Connected to pdp1170.
- Escape character is 'off'.
-
- Password OK
-
- *****************************************************************
- * *
- * T h e L i v i n g C o m p u t e r M u s e u m *
- * *
- * DEC-DataSystem 570 (PDP-11/70) MissPiggy *
- * *
- * Unauthorized access to this machine is prohibited. *
- * Use of this system is limited to authorized individuals only. *
- * All activity is monitored. *
- * *
- * To request an account on this system, please visit us at *
- * *
- * http://www.LivingComputerMuseum.com/ *
- * *
- *****************************************************************
-
- login: bokjan
- Password:
- $ passwd
- Changing password for bokjan
- Old password:
- New password:
- Retype new password:
- $
UNIX, Version 7 展开目录
PDP-11 机器支持运行多种操作系统,LCM+L 这台机器上跑的是 UNIX v7,最后一版自由使用的 UNIX,也是贝尔实验室制造的真正正统的 UNIX 系统。由于年代久远,即便我们能够熟练使用现代 * nix 操作系统,上手 Version 7 UNIX 时也一定是非常陌生的 —— 古老的工具,匮乏的命令令人有些无从下手。好在 LCM+L 提供了 1983 年的 UNIX Programmers Manual (7th Edition),通过这本手册我们可以学习一个使用的经验。
来自 PDP-11 的 Hello World 展开目录
从手册上知道,操作系统自带两种编程语言的支持:C 和 FORTRAN。我自然是要通过 C 来 puts
一句 Hello World 了。但是……
- $ vi
- vi: not found
vi
是 1976 年首次发布的,但是这个 1989 年的操作系统里并没有包含。查看了一下手册,系统自带的文本编辑器性质工具是 Ed
,Ken Thompson 于 1971 年首次发布。手册的第 54 页开始是 Kernighan 在 1978 年写的教程,仅仅只是 Tutorial Introduction 便占了相当大的篇幅 ——Ed
确实较难操作,与现在的图形界面文本编辑器(甚至是终端下的 Vim
和 Emacs
)不同,你只能通过命令编辑,并不能看到这个文件里的东西被改成了什么样。考虑到手册中的描述过于冗长,我从维基百科中摘录了一段 Ed
的操作示例:
- a
- ed is the standard Unix text editor.
- This is line number two.
- .
- 2i
-
- .
- ,l
- 3s/two/three/
- ,l
- w text
- q
在这一段操作中,首先写入了下列内容并将它们回显出来:
- ed is the standard Unix text editor.
-
- This is line number two.
接着,将 two
更改成 three
并且再次回显,写入到文件 text
中,退出。
事实上…… 不知是 PDP-11 的 shell 问题还是我操作问题,我并没有学会如何使用 Ed
这个编辑器。这是一件很尴尬的事情,因为除此之外没有其他的编辑器可用了,并且限于没有网络也没有足够的性能,无法自行编译一个更加 “现代化” 的编辑器使用。但是仅仅想要写文件,还是可以做到的,我们有 echo
和重定向,这就够了。
- $ echo "something" > a.txt
- $ cat a.txt
- something
通过这个方法,我费了老大劲终于实现了 Hello World。
- $ cat a.c
- #include <stdio.h>
- int main(void)
- {
- puts("Hello PDP-11");
- }
- $ cc a.c
- $ ./a.out
- Hello PDP-11
游戏展开目录
在 /usr/games
目录里有一些文件,从这个目录名称来看里面大概是游戏。让我们来试一试。
- $ ./arithmetic
- 12 - 6 = 6
- Right!
- 19 - 10 = 9
- Right!
- 12 - 7 = 5
- Right!
- 12 - 6 = 6
- Right!
- 12 - 9 = 3
- Right!
- 10 + 6 =
-
- Rights 5; Wrongs 0; Score 100%
- Total time 15 seconds; 3.0 seconds per problem
这个名为 arithmetic
的游戏不能算得上是一个游戏 —— 叫做 “两位数加减法练习” 应该更合适。在你不想继续时给 shell 一个 EOF
,便能结束,顺带得到你的答题数据。
- $ ./maze
-
- squares long, squares wide =
- 24,24
-
- :--:--:--:--:--:--:--:--:--:--:--:--:--:--:--: :--:--:--:--:--:--:--:--:
- | | | | | | |
- :--:--: : : :--:--:--:--:--: : :--:--:--: : : : : : :--:--: :
- | | | | | | | | | | | | |
- : : : : :--:--:--: : : : :--:--:--:--:--: : : :--:--: :--:--:
- | | | | | | | | | | | | |
- : :--:--: : :--:--:--: :--: : : :--:--:--:--:--: : :--:--:--: :
- | | | | | | | | | |
- :--:--:--:--: :--:--:--: :--:--: : : :--: : : : :--:--:--:--: :
- | | | | | | | | | | | |
- : :--:--:--: :--:--: :--:--: : : : : :--: :--:--: :--:--: :--:
- | | | | | | | | | | |
- :--:--:--:--:--: :--: :--: :--:--: : :--:--: : : :--:--:--:--: :
- | | | | | | | | | | | |
- : :--:--:--: :--:--:--: : :--: : : : : : : : : :--:--:--:--:
- | | | | | | | | | | | | |
- :--:--: : :--: : : :--:--:--: : :--: :--:--:--:--:--: : :--: :
- | | | | | | | | | | | | |
- : : :--: : : : :--:--:--:--:--:--:--: :--:--: : : : :--: : :
- | | | | | | | | | | | | | |
- : : : :--: :--: :--:--:--:--:--:--: : :--:--: : :--: : : : :
- | | | | | | | | | | |
- : : :--:--:--:--:--: :--:--:--:--:--:--: :--: : :--:--:--:--:--: :
- | | | | | | | | | |
- : :--: : : : :--:--: :--:--: :--: :--: :--:--: :--:--:--:--:--:
- | | | | | | | | | | | | | |
- : : : : : : : : :--: :--: : : : :--: : : : :--:--:--: :
- | | | | | | | | | | | | | | | |
- : : : : :--: :--:--:--:--: : :--:--:--: : :--: :--:--: : :--:
- | | | | | | | | | | | | |
- : : : :--:--:--: :--: : :--:--: :--:--:--:--:--:--:--:--:--: : :
- | | | | | | | | |
- : : : :--:--:--:--:--:--: : :--:--: :--: : :--:--:--:--:--:--: :
- | | | | | | | | |
- : :--: :--:--:--:--:--: : :--:--:--:--:--:--: : : :--:--:--:--:--:
- | | | | | | | |
- :--:--:--: : : :--:--:--:--:--:--:--:--:--:--:--: : : :--:--:--: :
- | | | | | | | | | | | | | |
- : : : : : : :--: :--:--:--: : :--: : : : : : : :--: : :
- | | | | | | | | | | | | | | | | | |
- : : : : :--: : : : :--:--: : : :--: :--:--: :--:--:--: : :
- | | | | | | | | | | | |
- : :--:--: :--:--:--:--: : : : : :--:--: :--:--:--: :--:--:--: :
- | | | | | | | | | |
- : :--: :--:--: : : :--: :--: : :--:--:--:--:--:--: :--:--:--:--:
- | | | | | | | | |
- :--: : : :--: :--:--: :--:--:--:--:--:--:--:--:--: :--:--:--:--: :
- | | | | | |
- :--:--: :--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:--:
这个名为 maze
的文件是一个迷宫发生器,最大可以生成 150×40 尺寸的迷宫。这并不是一个命令行游戏,真的只是一个发生器而已。毕竟如果我们的终端是一台电传打字机,我们可以把印在纸上的输出裁剪下来,在现实中用纸笔来走迷宫。
别的用户干了啥展开目录
LCM+L 为申请了使用的用户们创建了家目录,位于 /usr/users
。截至 2017 年 02 月 28 日这个目录中共有 330 个子目录,也就意味着这时有 330 人可以登录这台机器尝试一下几十年前的电脑。这些家目录的权限很松,都是 rwxrwxr-x
(数字表示:775
),也就是说我们可以随意地进入别人的家目录,看看他们干了什么。
我一一打开了相当数量的别的用户的家目录,然而除了 shell 使用的.profile
文件以外别无他物。看来大家都没有学会如何使用 Ed
呢。
就到这里了展开目录
这台历史上负有盛名的古董电脑运行着最正统的 UNIX,然而几十年的时间使我们对它陌生。也向 LCM+L 递交了自己的登录申请的你,在数个月时间过后拿到登录资格时,也许会发现自己正望着一个孤零零的命令提示符 $
不知从何开始。
是啊,现在已经是 2017 年了。现在的 PC,用着 x86,跑着 Windows。诚然越来越便捷的人机交互方式、越来越出色的兼容性和性能必定是顺应历史潮流的,多年前的这些计算机早已完成了它们的历史使命,慢慢淡去。但是这些老电脑所承载的记忆与文化,不应被忘记,也不会被大家忘记。