# TempleOS

**TempleOS** 是一款面向 x86_64 个人电脑的 64 位操作系统，由一位程序员[特里·A·戴维斯](https://www.edgepedia.org/zh/terry-a-davis)（Terry A. Davis，1969–2018）在大约十年间用自创的 C 语言方言 HolyC 独立编写而成<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。它包含内核、编译器、编辑器、图形库、文件系统、游戏和文档，全部集中于单一代码库，不含任何来自其他来源的代码<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。戴维斯患有精神分裂症，他将该项目描述为《圣经》中预言的[第三圣殿](https://www.edgepedia.org/zh/third-temple)，是遵照上帝的指示建造的<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。该操作系统已发布至公有领域，其开发随戴维斯于 2018 年去世而终止<sup>[3](https://www.techradar.com/news/best-alternative-operating-systems)</sup>。

| 关键事实 | 详情 |
|---|---|
| 作者 | 特里·A·戴维斯（1969–2018），唯一开发者，最终形态约耗费十年<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup> |
| 架构 | 仅支持 64 位 x86_64；一切运行于特权级 0，使用单一恒等映射地址空间，无分页<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup> |
| 显示 | 固定 640×480，16 色，单一 8×8 字体，软件渲染文本与图形，刷新率 30 帧/秒<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup><sup> • </sup><sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup> |
| 语言 | HolyC，一种非标准 C 方言，逐行即时编译，同时用于 shell 和应用程序<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup> |
| 刻意省略 | 无网络，无安全或加密，无第三方库，除核心 PC 硬件外无其他硬件支持<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup><sup> • </sup><sup>[3](https://www.techradar.com/news/best-alternative-operating-systems)</sup> |
| 许可证 | 公有领域，每次分发均包含 100% 源代码<sup>[6](https://github.com/cia-foundation/TempleOS)</sup> |
| 系统需求 | 最低 512 MB 内存；无法在 32 位硬件上运行<sup>[6](https://github.com/cia-foundation/TempleOS)</sup> |
| 最终版本 | TempleOS 5.03，由 TempleOS 基金会分发<sup>[7](https://templeos.net/)</sup> |

## 设计哲学

戴维斯将本系统定位为一次刻意的缩减，而非放大的通用操作系统。在他自己的设计文档中，他把 Linux 比作半挂卡车，把 Windows 比作轿车，而称 TempleOS 为摩托车：性能足够，但没有安全系统，他认为这是节省一个数量级复杂度的可取之道<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。他将代码库永久限制在 100,000 行以内，从而免除了对链接器或 make 工具的需求<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。

简化是系统性的。只有一种图形驱动，而非针对不同 GPU 的分别驱动；只有一种字体；只有一种语言和编译器，用于命令行操作、脚本、歌曲、自动化及应用程序代码；只有一个编辑器，同时充当文字处理器、源代码编辑器、文档浏览器和对话框窗体构建器<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。硬件支持以最低共同标准为目标：用 PS/2 键盘和鼠标而非 USB，磁盘代码避开中断，以及单音 8 位扬声器<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。在戴维斯的叙述中，640×480、16 色的显示是来自上帝的圣约，他也给出了实用理由：一块 1600×1200 的 24 位屏幕将占用 37 倍的内存，并意味着 37 倍的 CPU 算力<sup>[8](https://www.templeos.info/Wb/Doc/Welcome.DD.HTML)</sup>。

## 架构

TempleOS 将一切运行于特权级 0——x86 中通常保留给内核的特权级别——不设任何形式的用户权限<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。所有核心上的所有任务共用一张内存映射，虚拟地址被设为等于物理地址，如同未使用分页<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。由于系统从不离开特权级 0，它不使用软件中断或 SYSCALL 指令；调用始终是直接的 REL32 调用<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。

调度器是非抢占式的，面向单用户家用机器。任务没有优先级，也从不从队列中移除；它们轮询自己所等待的对象并换出，一次任务切换约需半微秒<sup>[8](https://www.templeos.info/Wb/Doc/Welcome.DD.HTML)</sup>。任务、进程和线程之间没有区分：每个都有一个任务记录，每个任务拥有一个窗口<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。多核支持是主从式而非对称多处理，由 0 号核心显式分配作业；代码仓库的标语宣称可在多达 64 个核心上与上帝交谈<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup><sup> • </sup><sup>[6](https://github.com/cia-foundation/TempleOS)</sup>。

一个名为亚当（Adam）的特殊任务——众任务之父——永不消亡；他的堆如同其他操作系统中的内核内存，系统级符号存于他的符号表中<sup>[8](https://www.templeos.info/Wb/Doc/Welcome.DD.HTML)</sup>。作用域通过每任务符号表的层级结构实现，因此无需包含头文件<sup>[4](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)</sup>。

文件系统名为红海（RedSea），是一种简单的 64 位设计，将所有文件连续分配，以簇位图进行分配；文件创建后无法增长。为便于与双启动操作系统交换文件，支持 FAT32。文件以整体方式处理，这使得逐文件压缩变得可行：文件名以 .Z 结尾的文件在存储和读取时自动压缩与解压<sup>[8](https://www.templeos.info/Wb/Doc/Welcome.DD.HTML)</sup>。

## HolyC 与即时编译

HolyC 是 C 的一种方言，具有标准 C 编译器所没有的特性，如结构化异常处理，以及语法上的改变，如无参数函数调用的括号可省略<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。程序逐行即时编译进内存，而非编译为磁盘上的二进制文件，这使得 HolyC 的行为有些类似 BASIC 等解释型语言<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。戴维斯坚持认为系统是编译而非解释，且任何地方都不使用字节码<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。

没有目标文件，也没有链接器。提前编译模式直接生成平坦二进制文件，链接在加载二进制模块时发生<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。在大多数操作系统中，应用语言与 shell 语言不同；在 TempleOS 中二者相同，因此在命令行键入的一行与一个程序文件是同一种东西<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。HolyC 源代码还可以在代码中直接嵌入超链接和精灵图，这使得编写图形程序所需的代码大幅减少<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。

## 即程序的文档

最具特色的层次是文档与代码的融合。一份对源代码树的详细技术剖析统计出 33 个 `#exe{}` 块，即 HolyC 代码块，它们在编译期间运行，其输出被拼接回编译流；其中 28 个直接运行，5 个以字符串形式输出代码，因此程序可以生成正在被编译的程序<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。

帮助文件是可点击的程序。该剖析统计出 154 个 `$MA` 宏，其中 139 个带有活动的 `LM=`/`RM=` 处理器，因此点击文档中的某个词会运行 HolyC 代码，而不仅仅是导航<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。TechRadar 的评测特别指出，这种文档与程序之间界限的模糊，是该系统对更传统操作系统而言最有趣的想法<sup>[3](https://www.techradar.com/news/best-alternative-operating-systems)</sup>。整个系统都是超链接的，让读者可以从程序深入其源代码和依赖项，而且由于没有分页，操作系统在一两秒内即可启动<sup>[3](https://www.techradar.com/news/best-alternative-operating-systems)</sup>。

## 神谕与圣殿

戴维斯将 TempleOS 的许多方面归因于神圣启示。他希望人们用该系统与上帝交流，并以绘画的形式献祭<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。一个程序从随机选出的词语生成句子，戴维斯将其描述为说方言的虚拟形式；另一个程序撰写随机生成的赞美诗；还有一个模拟《[出埃及记](https://www.edgepedia.org/zh/book-of-exodus)》<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup>。在 2014 年的一次采访中，他直白地说：“我被上帝选中来建造祂的圣殿，一个操作系统”，并描述了内置的用于与上帝交谈的神谕<sup>[9](https://usesthis.com/interviews/terry.davis/)</sup>。

一份关于桌面隐喻的艺术史调查记载，戴维斯在开发的十年间经历了许多他自述的来自上帝的启示，该系统于 2013 年作为免费、公有领域的操作系统发布，服务于其作为第三圣殿运作的目标<sup>[10](https://www.continentcontinent.cc/content/2-archives/3-issues/1-issue-8-1-2-2019/17-this-is-not-my-beautiful-house-examining-the-desktop-metaphor-1980-1995/334_pipkin-this_is_not_my_beautiful_house_examining_the_desktop_metaphor_1980-1995.pdf)</sup>。该剖析的作者明确区分了两条线索：架构是可验证的事实，而神性则是戴维斯所声明的信仰，予以尊重而非认可<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。

## 历史

该项目约始于 2003 年，曾用名包括 J Operating System、LoseThos 和 SparrowOS，2013 年采用 TempleOS 之名<sup>[11](https://administraciondesistemas.com/templeos-el-sistema-operativo-escrito-por-un-solo-hombre-para-hablar-con-dios/)</sup>。戴维斯此前已于 1994 年开始开发一个保护模式操作系统 TPMOS<sup>[7](https://templeos.net/)</sup>。他从零编写一切，早年从实模式 DOS 下启动 TASM 开始，并编写了自己的引导加载程序，因此不需要 GRUB<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。

戴维斯并未将 TempleOS 设计为首要操作系统。他建议在 VMware、QEMU 或 [VirtualBox](https://www.edgepedia.org/zh/virtualbox) 等模拟器中运行，或双启动，他自己在 Windows 机器上的 [VMware Workstation](https://www.edgepedia.org/zh/vmware-workstation) 中使用它，因为它无法在他的硬件上原生运行<sup>[5](https://www.ndhfilms.com/other/templeosbasics)</sup><sup> • </sup><sup>[9](https://usesthis.com/interviews/terry.davis/)</sup>。它可以在约 2005 至 2010 年间的一些裸机 64 位 PC 上运行<sup>[2](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)</sup>。开发随戴维斯于 2018 年 8 月去世而停止<sup>[3](https://www.techradar.com/news/best-alternative-operating-systems)</sup>。

## 遗产

完整源代码仍然可用，且只能在 TempleOS 自身内部编译，因为它是 HolyC 和汇编，由捆绑的编译器处理<sup>[6](https://github.com/cia-foundation/TempleOS)</sup>。围绕它已发展出社区基础设施：TempleOS 基金会分发 5.03 ISO、虚拟机镜像、HolyC 教程和档案，并列出包括 TOOM——TempleOS 版《毁灭战士》重制——在内的项目<sup>[7](https://templeos.net/)</sup>。衍生系统包括 TinkerOS，一个保留了约 95% TempleOS 代码并增加修复和文档的社区操作系统，以及 ZealOS，列于该项目社区页面上的一个分支<sup>[12](https://github.com/tinkeros)</sup><sup> • </sup><sup>[13](https://templeos.org/)</sup>。一个基于浏览器的项目 TempleOS-Web 在浏览器中运行 TempleOS V5.03 的快照，配有 WebAssembly HolyC 工具链<sup>[14](https://github.com/ParkerrDev/TempleOS-Web)</sup>。

程序员们继续研究其源代码。对某一快照的一次验证性遍历统计出戴维斯 f/F/t 命名约定中的 311 个标志位索引、300 个掩码和 32 个枚举，在 221 对受检组合中有 220 对满足掩码等于将 1 左移索引所指定的位数所得值的不变式，唯一的例外是有意为之<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。同一剖析直白地总结了这一成就：一个由单人从零开发的 64 位操作系统，拥有自己的编译器和活文档模型，是系统编程中罕见的壮举<sup>[1](https://davidwise01.github.io/templeos-teardown/)</sup>。

## References

1. [TempleOS — a teardown of the temple one man built alone, David Lee Wise](https://davidwise01.github.io/templeos-teardown/)
2. [The Temple Operating System FAQ (Terry A. Davis), TinkerOS mirror](https://tinkeros.github.io/WbTempleOS/Doc/FAQ.html)
3. [Best alternative Operating Systems of 2026, TechRadar](https://www.techradar.com/news/best-alternative-operating-systems)
4. [Decisions Making TempleOS Simple, templeos.info documentation](https://www.templeos.info/Wb/Doc/Strategy.DD.HTML)
5. [TempleOS Basics, NDH Films](https://www.ndhfilms.com/other/templeosbasics)
6. [cia-foundation/TempleOS repository README, GitHub](https://github.com/cia-foundation/TempleOS)
7. [TempleOS Foundation](https://templeos.net/)
8. [Welcome to TempleOS, templeos.info documentation](https://www.templeos.info/Wb/Doc/Welcome.DD.HTML)
9. [Uses This / Terry Davis interview, May 20, 2014](https://usesthis.com/interviews/terry.davis/)
10. [This is Not my Beautiful House: Examining the Desktop Metaphor, 1980–1995, Everest Pipkin, Continent Issue 8.1-2 (2019)](https://www.continentcontinent.cc/content/2-archives/3-issues/1-issue-8-1-2-2019/17-this-is-not-my-beautiful-house-examining-the-desktop-metaphor-1980-1995/334_pipkin-this_is_not_my_beautiful_house_examining_the_desktop_metaphor_1980-1995.pdf)
11. [TempleOS: el sistema operativo escrito por un solo hombre para hablar con Dios, Administración de Sistemas](https://administraciondesistemas.com/templeos-el-sistema-operativo-escrito-por-un-solo-hombre-para-hablar-con-dios/)
12. [tinkeros GitHub organization (TinkerOS)](https://github.com/tinkeros)
13. [TempleOS community page](https://templeos.org/)
14. [ParkerrDev/TempleOS-Web repository, GitHub](https://github.com/ParkerrDev/TempleOS-Web)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Operating systems

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/templeos

English original: https://www.edgepedia.org/templeos
