古董电脑室和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。诚然越来越便捷的人机交互方式、越来越出色的兼容性和性能必定是顺应历史潮流的,多年前的这些计算机早已完成了它们的历史使命,慢慢淡去。但是这些老电脑所承载的记忆与文化,不应被忘记,也不会被大家忘记。