UNIX V4 workshop at Low Resource Computing

UNIX V4 workshop at Low Resource Computing

At the Low Resource Computing 2026 workshop at Dartmouth, I hosted an interactive session on UNIX V4. This version of UNIX was recently recovered from a 1974 magnetic tape found at the University of Utah and is the earliest complete machine-readable snapshot of UNIX. I taught how to do software development using the tools of the day, particularly the ed text editor with a teletype, and participants solved a coding challenge, all signed into the same machine. This repository reproduces the disk image and terminal logs from the workshop, as well as my setup.

在达特茅斯举办的“低资源计算 2026”(Low Resource Computing 2026)研讨会上,我主持了一场关于 UNIX V4 的互动会议。该版本的 UNIX 最近从犹他大学发现的一盘 1974 年的磁带中恢复,是目前已知最早的、完整的、机器可读的 UNIX 快照。我教授了如何使用当时的工具进行软件开发,特别是如何配合电传打字机使用 ed 文本编辑器,参与者们则在同一台机器上登录并解决了一项编程挑战。本仓库复现了研讨会中的磁盘镜像、终端日志以及我的配置环境。

Terminals

Before the workshop, I modified the kernel to support up to 32 simultaneous terminal connections, raised from the previous 20. It uses 16 KL terminals and 16 DC terminals. I would have also configured 16 DH terminals, bringing the total up to 48 terminals, the theoretical limit for this version of UNIX, but the PiDP-11 fork of the SIMH emulator does not support this multiplexer. I had two physical terminals connected (a Silent 700 teleprinter and a Heathkit CRT terminal), 29 telnet connections from participants’ laptops, as well as the main console on the PiDP-11.

终端

在研讨会开始前,我修改了内核以支持最多 32 个并发终端连接(之前为 20 个)。它使用了 16 个 KL 终端和 16 个 DC 终端。我本想再配置 16 个 DH 终端,使总数达到 48 个(这是该版本 UNIX 的理论上限),但 SIMH 模拟器的 PiDP-11 分支并不支持这种多路复用器。我连接了两台物理终端(一台 Silent 700 电传打字机和一台 Heathkit CRT 终端),以及来自参与者笔记本电脑的 29 个 telnet 连接,还有 PiDP-11 上的主控制台。

(List of terminal mappings omitted for brevity) (此处省略终端映射列表)

I describe my configuration for reproducibility, though the notes are mostly intended for myself. I will rework it into a tutorial for configuring V4–V7 later.

我描述了我的配置以便于复现,尽管这些笔记主要是写给我自己看的。稍后我会将其整理成一份关于配置 V4 到 V7 版本的教程。

Getting started

I handed out printed manuals to teach the system in the manner of the day. The ed manuals were particularly helpful. Alex even came back the next day using ed commands I didn’t teach, from having read it all. I had also hoped to setup the man command, but didn’t get it working in time.

入门

我分发了打印好的手册,以当时的方式教授系统知识。ed 手册特别有用。Alex 甚至在第二天回来时,已经能使用我没教过的 ed 命令了,这全靠他读完了手册。我原本还希望设置好 man 命令,但没能及时完成。

(List of manuals omitted) (此处省略手册列表)

First, we created user accounts for everyone. Since this was accomplished by editing /etc/passwd, I handled this for most people, to avoid people overwriting others’ changes. They were creative with their user IDs.

首先,我们为每个人创建了用户账户。由于这是通过编辑 /etc/passwd 来完成的,为了避免大家互相覆盖修改,我代劳了大部分人的操作。他们在用户 ID 的选择上非常有创意。

(/etc/passwd content omitted) (此处省略 /etc/passwd 内容)

Quirks

Perhaps the largest adjustment was that everyone instinctively reached for backspace to fix typos, but it would instead send a literal ASCII backspace character. This happened hundreds of times. Early UNIX was designed for printing terminals and, of course, text cannot be cleared once it’s printed on paper. Instead, it used # to erase the last character and @ to erase the current line, borrowed from Multics. One participant marveled at how instinctive this was for me. amitb found that the erase character could be configured to backspace with stty erase '^h', but alas that only worked in later versions of UNIX.

奇特之处

最大的不适应可能在于,每个人都会本能地按下退格键(Backspace)来纠正拼写错误,但系统却会发送一个字面意义上的 ASCII 退格字符。这种情况发生了数百次。早期的 UNIX 是为打印终端设计的,当然,文字一旦打印在纸上就无法擦除。因此,它借用了 Multics 的设计,使用 # 来删除最后一个字符,使用 @ 来删除当前行。一位参与者对我操作时的这种本能反应感到惊叹。amitb 发现可以通过 stty erase '^h' 将擦除字符配置为退格键,但遗憾的是,这只在后期的 UNIX 版本中才有效。

Another pervasive surface difference was that cd was named chdir until V7. Participants ran into cd: not found about 100 times. But by the end, this was no longer a limitation and someone hacked the shell to laugh at you if you typed cd:

另一个普遍存在的表面差异是,在 V7 版本之前,cd 命令被称为 chdir。参与者们大约遇到了 100 次 cd: not found 的错误。但到最后,这不再是障碍,甚至有人修改了 shell,如果你输入 cd,它会嘲笑你:

% cd dir
haha
% ed /usr/source/s2/sh.c
10267
/cd/;/}/p
if(equal(cp1, "cd")) {
    prs("haha\n");
    return;
}

A confusing quirk was that login would sometimes use an all-caps mode for compatibility with the Teletype Model 33. It cycles between terminal settings until one works, so if you can’t sign in, it attempts under all-caps mode. This was especially prone to happen for the KL terminal sessions. That driver assumes that the terminal is always connected and doesn’t wait for it to be ready, so the initial login: prompt would always be lost. After pressing return, it would then cycle to the next setting and present an all-caps prompt, making your whole session uppercase. This happened about 14 times.

一个令人困惑的特性是,为了兼容 Teletype Model 33,登录程序有时会使用全大写模式。它会在不同的终端设置之间循环,直到找到一个可用的,所以如果你无法登录,它会尝试全大写模式。这种情况在 KL 终端会话中尤为常见。该驱动程序假设终端始终处于连接状态,不会等待其就绪,因此最初的 login: 提示符总是会丢失。按下回车键后,它会循环到下一个设置并显示全大写提示符,导致整个会话都变成大写。这种情况大约发生了 14 次。

Paper

I brought my TI Silent 700 Model 707/1200 teleprinter to demonstrate computing on paper. Before the world transitioned to CRT terminals, teletypes printed your session onto paper. The paper was your monitor and cut/paste was done with scissors and tape. Alex was particularly fond of the teletype and was usually found sitting behind it. Auberon found the long roll of paper so amusing that she will show this photo of me holding it to her students to show how computing has progressed. We used up the last bit of paper by printing a meter-long Saturn V.

纸张

我带上了我的 TI Silent 700 Model 707/1200 电传打字机,以演示“纸上计算”。在世界转向 CRT 终端之前,电传打字机会将你的会话打印在纸上。纸张就是你的显示器,而“剪切/粘贴”则是用剪刀和胶带完成的。Alex 特别喜欢这台电传打字机,通常都能看到他坐在它后面。Auberon 觉得那长长的纸卷非常有趣,她打算向她的学生展示我拿着纸卷的照片,以展示计算技术是如何进步的。我们最后用尽了剩下的纸,打印了一枚一米长的土星五号火箭。