Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
Hacker News · 2026/8/3 00:38:10
CP/M-386 – CP/M for 386 protected mode, derived from CP/M‑68K
AI 中文解读
CP/M-386来了!这个怀旧操作系统项目把上世纪经典的CP/M系统移植到了386处理器的32位保护模式,让老古董在新硬件上焕发新生。
简单来说,CP/M是个人电脑早期的“操控软件”,比Windows还老。这次开发者给它做了个“大改造”,相当于让一位退休老人学会了玩智能手机——不仅能直接用软盘启动,还能在纯文字界面下运行,甚至支持串口和VGA显示。虽然暂时还不支持硬盘、U盘和网络,但已经能兼容绝大多数老CP/M程序的代码,连曾经的“同门师弟”MP/M系统功能也完成了一半。
对普通用户来说,这套系统更多是技术爱好者的“玩具”。但它的价值在于:一是证明了经典系统也能通过现代工具链重获新生,给开源社区打了样;二是为研究操作系统底层原理提供了活教材;三是对那些存着老软件数据、想找回当年情怀的用户,多了一个在真机上运行的机会。现在项目还在早期阶段,未来若补充存储驱动,说不定真能把几十年前的“计算机记忆”完整唤醒。
CP/M-386
CP/M‑386 is CP/M for 386 protected mode, derived from CP/M‑68K.
Overview
Hardware support
CP/M compatibility
Build requirements
Downloads
Compilation
Build output
QEMU testing
QEMU notes
Included utilities
Contributing
Future plans
Code statistics
Mirrors
License
Overview
CP/M‑386 is currently in the very early development stages.
Full 32‑bit protected mode
implementation with
Ring‑3 TPA.
Bootable via 3.5" 1.44MB floppy disk
MBR or GRUB
Multiboot kernel.
Supports VGA text (0xB8000)
and/or COM1 serial
(9600/N/8/1, 0x3F8) consoles.
No floppy/hard disk/CD/USB/network/sound/other drivers (yet).
Hardware support
Compatible with 386 (and later systems) with 2MB (or more) memory.
Systems using either PC BIOS or UEFI (with CSM) are supported.
VGA, 8042 PS/2, 8250/16450/16550 UART, CMOS RTC, and 8253/8254 PIT
are supported.
CP/M compatibility
CP/M‑386 should be highly source‑compatible with other implementations:
System
BDOS coverage
CP/M‑68K 1.3
100%
CP/M 2.2
100%
CP/M‑Plus
71%
DOS‑Plus
62%
MP/M 2.1
50%
The system currently reports BDOS 2.2 to applications.
The CP/M‑386 BDOS is at full parity with CP/M‑68K 1.3 and
CP/M 2.2.
A large majority of the CP/M‑Plus (CP/M 3) BDOS is also
supported.
More than 60% of the DOS‑Plus additions have been implemented.
Approximately half of the MP/M extensions have been completed.
The missing functionality is largely the multi‑user, multi‑tasking,
message queuing, and process control calls that don't apply to a
single‑user CP/M implementation.
Unique CP/M‑386‑specific BDOS extensions have been added to accommodate
new features like direct video access, high‑resolution timing, PRNG, etc.
Build requirements
The following dependencies are required to compile CP/M‑386:
AWK
Cpmtools†
GNU Binutils
GNU Coreutils
GNU GCC or LLVM Clang
GNU Make
NASM
QEMU (required only for testing)
†Be sure to use cpmtools version 2.23 or later. Older
versions may appear to work but have several known bugs.
Downloads
Download the
current CP/M‑386 build.
View the
GitLab CI/CD logs.
Compilation
Building CP/M‑386 is supported on current releases of NetBSD and
FreeBSD‡, and most recent Linux distributions.
The following are the minimum versions of Linux distributions that have been
verified to build CP/M‑386 successfully: CentOS Stream 9, Fedora 36,
Debian 12, Ubuntu 18.04 (with gcc-16 from ppa:ubuntu-toolchain-r/test),
Ubuntu 22.04, Alpine 3.24, and OpenSUSE Leap 15.4.
GCC build (recommended):
make -Orecurse -j "$(nproc 2> /dev/null || printf '%s' 1)"
make test
Clang build:
make -Orecurse -j "$(nproc 2> /dev/null || printf '%s' 1)" CC="clang"
It is recommended to use GCC as Clang‑compiled i386 code is larger.
Be sure to make clean if switching compilers or adjusting compiler flags.
32‑bit support libraries are required to run the test suite (make test).
‡At the time of writing, FreeBSD is shipping non‑functional
cpmtools2 packages with broken mkfs.cpm functionality. To successfully
build on FreeBSD, you must rebuild cpmtools and ensure it is not
linked with libdsk. If you receive a Disc rejected by driver error on
FreeBSD from mkfs.cpm, your tools are broken and cannot be used to
build CP/M‑386.
Build output
The build produces two primary artifacts:
File
Description
cpm386.elf
Multiboot kernel image
floppy.img
Bootable 3.5" 1.44MB floppy disk image
You can download pre‑compiled binaries above.
QEMU testing
Multiboot
kernel (recommended):
qemu-system-i386 -m 2M -serial stdio -monitor none -kernel "cpm386.elf"
Floppy MBR loader:
qemu-system-i386 -m 2M -serial stdio -monitor none -drive if=floppy,format=raw,file="floppy.img" -boot a
QEMU notes
Use -nographic -display none -vga none to disable VGA video (and use only serial console).
Use -serial none to disable the serial UART (and use only VGA console).
Included utilities
Program
Description
ACLOCKDV.386
aclock (VGA text console version)
ACLOCKVT.386
aclock (ANSI terminal version)
分享
阅读原文 ↗