12-04 更新 实时
首页/ 算力市场/ 正文

开发者删除 Linux,24KB 纯汇编系统 74 毫秒启动

算力市场 来源:Tom's Hardware 2026-11-28 20:00 2 阅读 机器翻译
开发者删除 Linux,24KB 纯汇编系统 74 毫秒启动

一位大胆的开发者删除了自己的 Linux 操作系统,并用汇编语言编写了一个极小的裸机可启动替代方案来运行 LLM。结果是一个超快的独立系统,可在毫秒级启动,运行 LLM 的速度最高提升 54%。此外,GitHub 上名为 alesha-pro 的 Alexey Fateev 分享了他的 Bare-Metal Bootable Qwen3-0.6B OS,仅用 24 KB 纯汇编编写,供其他爱好者调整代码和测试。

我彻底删除了 Linux,将 Qwen3-0.6B 烘焙进一个 24 KB 的纯 x86-64 汇编操作系统,它的运行速度比原生 Linux 上的 llama.cpp 快高达 54%。整个 Multiboot OS 二进制文件(asm-llm-os.elf)为 24,252 字节,从零开始编写,没有使用 Linux、Windows、C、Rust 或 libc。它在 74 到 94 ms 内启动,直接进入 64 位长模式,通过 APIC 唤醒每个 CPU 核心,从物理内存直接映射 614 MiB 的 Q8_0 权重,并让你通过 VGA、PS/2 键盘和串口进入实时的多轮 KV 缓存聊天。我在同一台 AMD EPYC 7642 上,针对 llama.cpp(Q8_0,-ngl 0)进行了直接的 CPU 基准测试: - 1 线程达到 23.67 tok/s,对比 16.63(+42%) - 4 线程达到 78.89 tok/s,对比 51.08(+54%) - 8 线程达到 118.08 tok/s,对比 80.79(+46%) - 16 线程达到 134.94 tok/s,对比 103.03(+31%,峰值 136.6) 在一个无磁盘的 0 GB Proxmox 虚拟机(2014 年的 12 核 Intel Xeon E5-2670 v3,2 GiB RAM)上,它能在不到 5 秒内直接启动到提示符(内核启动 95 ms),并直接从 RAM 中运行,解码速度 78 tok/s,预填充速度最高 111.5 tok/s,还包含一个混合 BIOS+UEFI 的 ISO 构建器。输出在不同线程数下保持位精确,并且与 PyTorch FP32 对比,所有 64 个贪婪 Token 均匹配(余弦相似度 0.99965)。14.7 KB 的 Linux ELF 构建(FAST_Q8=1 INT8xINT8 AVX2+F16C)在 1 到 40 线程范围内也比 llama.cpp 快 18% 到 36%,并且在裸机上使用 2 MiB 大页启动还能在此基础上再提升 10%。仓库、ISO 构建器和 Proxmox 设置指南见下方回复。 2026年11月25日

这个 Multiboot OS 二进制文件(asm-llm-os.elf)的紧凑尺寸令人瞩目。它仅重 24KB(24,252 字节),让现代操作系统显得无比庞大。然而,必须记住,传奇的 Commodore 64 运行在一个更小的 20KB ROM 上,其中不仅包含内核,还包含 BASIC 解释器和字符生成器。

Fateev 表示,他那套支持现代 SMP 的 Multiboot OS 是从零写起的,没有使用 Linux、Windows、C、Rust 或 libc。用户通过它对 80x25 彩色字符 VGA 显示、PS/2 键盘和串口通信的支持来与该系统交互。这个手写 NASM 汇编语言项目的效率是刻意追求的——它能在 74-94 毫秒内直接启动到多轮聊天界面。眨眼之间,你就可以和你的 LLM 聊天了。

虽然这套操作系统及其精心打磨的 UI 只占用计算机资源的一小部分,但系统会加载 Qwen3-0.6B Q8_0,其体积达 649MB。你们很多人应该知道,这算是个轻量级 LLM,但它比引用它的操作系统大约要 28,000 倍。这是好事,毕竟你买电脑是为了跑应用和游戏——而不是为了跑操作系统,对吧?

再来看性能,这也是 Fateev 的独立 asm-llm-os.elf 表现突出的另一个方面。在一些将这款紧凑的新系统与先前通过 llama.cpp 运行同一 LLM 的 Linux 环境进行对比的正面基准测试中,这个纯汇编编写的操作系统最高快了 54%。在这位开发者的 AMD EPYC 7642 系统上,“4 线程达到 78.89 tok/s,而后者为 51.08(+54%)。”这是最好的一项结果,因此被重点标出,但它并非离谱的离群值,即便是最温和的性能提升也达到 +31%(使用 16 线程时)。

如果你有兴趣测试这个项目,Fateev 已在 github.com/alesha-pro/llm.asm 分享了完整的 MIT 源码、ISO 构建器和设置指南。另外,如果不需要裸机运行,你可以测试 Linux 托管版本,它仅以 14KB 提供相同的基础 asm-llm 推理二进制文件。这是因为移除启动系统、初始化处理器、键盘和显示器 I/O 等所需的代码后,可以节省 10KB。

译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(AI enthusiast deletes Linux for a 24KB pure assembly OS that boots in 74 milliseconds)

An intrepid developer has deleted their Linux OS and coded a tiny assembly language bare-metal bootable alternative to run LLMs. The result is a super-fast standalone system that starts in milliseconds and runs LLMs up to 54% faster. Moreover, Alexey Fateev, AKA alesha-pro on GitHub, has shared his Bare-Metal Bootable Qwen3-0.6B OS in 24 KB of Pure Assembly for other enthusiasts to code-tweak and test.

I deleted Linux completely, baked Qwen3-0.6B into a 24 KB pure x86-64 assembly OS, and it runs up to 54% faster than native Linux llama.cpp.The entire Multiboot OS binary (asm-llm-os.elf) is 24,252 bytes, written from scratch without Linux, Windows, C, Rust, or libc. It boots in 74 to 94 ms straight into 64-bit Long Mode, wakes every CPU core over APIC, maps the 614 MiB Q8_0 weights directly from physical RAM, and drops you into a live multi-turn KV-cache chat over VGA, PS/2 keyboard, and serial.I ran head-to-head CPU benchmarks against llama.cpp (Q8_0, -ngl 0) on the same AMD EPYC 7642:- 1 thread hits 23.67 tok/s vs 16.63 (+42%)- 4 threads hit 78.89 tok/s vs 51.08 (+54%)- 8 threads hit 118.08 tok/s vs 80.79 (+46%)- 16 threads hit 134.94 tok/s vs 103.03 (+31%, 136.6 peak)On a diskless 0 GB Proxmox VM (2014 12-core Intel Xeon E5-2670 v3, 2 GiB RAM), it boots straight to the prompt in under 5 seconds (95 ms kernel boot) and runs live out of RAM at 78 tok/s decode and up to 111.5 tok/s prefill, with a hybrid BIOS+UEFI ISO builder included too. Output stays bit-exact across thread counts and matches all 64 greedy tokens against PyTorch FP32 (0.99965 cosine).The 14.7 KB Linux ELF build (FAST_Q8=1 INT8xINT8 AVX2+F16C) also beats llama.cpp by 18% to 36% from 1 to 40 threads, and booting bare metal with 2 MiB huge pages squeezes out another 10% on top.Repo, ISO builder, and Proxmox setup guide are in the reply below.November 25, 2026

The compact size of this Multiboot OS binary (asm-llm-os.elf) is remarkable. Weighing in at just 24KB (24,252 bytes), it makes modern operating systems seem gargantuan. However, one must remember that the legendary Commodore 64 worked off a smaller 20KB ROM, which included not only the kernel but also a BASIC interpreter and a character generator.

Fateev says that his Multiboot OS with modern SMP support was written from scratch without Linux, Windows, C, Rust, or libc. Users interact with the new OS via its support for 80x25 character color VGA displays, PS/2 keyboards, and serial communications. Such is the purposeful efficiency of this hand-written NASM assembly language project that it can boot in 74-94 milliseconds directly to its multi-turn chat interface. You're ready to chat with your LLM in the blink of an eye.

While the OS and its carefully honed UI use only a tiny portion of the computer's resources, the OS loads Qwen3-0.6B Q8_0, which weighs in at 649MB. That's something of a lightweight LLM, as many of you will be aware, but it is roughly 28,000 times bigger than the OS that references it. That's good, as you bought your computer to run applications and games – not for running an OS – didn't you?

Turning to performance, this is another area where Fateev's standalone asm-llm-os.elf excels. In some head-to-head benchmarks of the compact new OS vs. the previous Linux install running the same LLM via llama.cpp, the pure assembly-coded OS was up to 54% faster. On the dev's AMD EPYC 7642 system, "4 threads hit 78.89 tok/s vs 51.08 (+54%)." That is the best result, and therefore highlighted, but is not a crazy outlier figure, with even the most modest performance uplift charted at +31% (when using 16 threads).

If you are interested in testing this project, Fateev has shared the full MIT source, ISO builder, and a setup guide at github.com/alesha-pro/llm.asm. Also, if bare-metal operation isn't required, you can test out the Linux-hosted version, which delivers the same basic asm-llm inference binary in just 14KB. That's because 10KB can be saved by removing the code required to boot the system, initialize the processor, keyboard, and monitor I/O, etc.

正文保留英文原文,标题与摘要由机器翻译。

本文由采集器自动同步

原文发布于 Tom's Hardware(AI enthusiast deletes Linux for a 24KB pure assembly OS that boots in 74 milliseconds),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗