# llm.asm: a 24 KB assembly operating system that boots straight into a Qwen3 chat (and we tried it)

- **Published on:** 2026-11-28
- **Category:** News
- **Original page:** https://free-linux.com/articles/llm-asm-sistema-operativo-ensamblador-qwen3

Alexey Fateev has written a 24,252-byte operating system in pure NASM that boots without Linux, wakes every core and loads Qwen3-0.6B for chatting. We built it and booted it in QEMU: how much of the "up to 54% faster than llama.cpp" holds up, what the caveats are and how to repeat it.

---

A whole operating system in **24,252 bytes**, hand-written in x86-64 assembly, that boots in a tenth of a second and drops you into a chat with a language model. No Linux, no C, no libc. It is **llm.asm**, the project developer **Alexey Fateev** ([@superalesha](https://x.com/superalesha) on X, `alesha-pro` on GitHub) released on 25 November, and in three days it has passed 2,700 stars.

The headline doing the rounds is that he "deleted Linux" and that his system runs **Qwen3-0.6B up to 54% faster than llama.cpp**. We built it and booted it ourselves. It works, and the numbers come with small print worth reading.

## What the author said

The announcement is in his [X post of 25 November](https://x.com/superalesha/status/2125682626056839259):

> "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."

In the same thread he gives his measurements against llama.cpp on an **AMD EPYC 7642**, a test on a **diskless** Proxmox virtual machine with a 2014 Xeon E5-2670 v3 and 2 GiB of RAM, and links the code: [github.com/alesha-pro/llm.asm](https://github.com/alesha-pro/llm.asm), under the **MIT licence**.

## What is inside

The repository is not a single program but five projects sharing an assembly maths core:

| Project | Binary | Size | What it does |
|---|---|---:|---|
| `01-qwen3-inference` | `asm-llm` | 14,712 B | Linux program that runs Qwen3-0.6B, with a chat mode |
| `02-baremetal-os` | `asm-llm-os.elf` | 24,252 B | The bootable operating system from the headline |
| `03-minigpt-train` | `asm-gpt-train` | 32,944 B | Trains a small GPT from scratch, with a Braille interface |
| `04-ring1-kernel-surgeon` | `surgeon.elf` | 75,424 B | AMD SVM hypervisor running underneath Linux |
| `05-ebpf-jev` | INT8 model | 21,280 B | A decision model inside eBPF LSM hooks |

The first three are pure NASM assembly: the author counts **17,252 lines**, of which 4,167 are the operating system and 3,857 the shared code (BPE tokenizer, `expf`, RoPE, RMSNorm, softmax and the matrix multiplications with AVX2, FMA and F16C). The last two, added later, already mix in libc-free C, so "zero C" applies to the OS and the inference engine, not to the whole repository.

The operating system does just enough for its one job. It boots via **Multiboot 1** (GRUB or QEMU's `-kernel` will do), switches to 64-bit long mode with four-level paging, enables AVX2, reads the ACPI MADT table and **wakes the other cores** with the APIC's INIT-SIPI-SIPI sequence. The model weights are not read from a disk: they arrive as an *initrd* and are used straight from physical memory, mapped with 2 MiB pages. To talk to it there is an 80×25 VGA screen, a PS/2 keyboard and a serial port.

## We booted it

<figure>
  <img src="/articles/llm-asm/llm-asm-compilacion-qemu.webp" alt="Terminal in a debian:13 container: ls shows asm-llm-os.elf at 24252 bytes, asm-llm at 14712 bytes and the qwen3-0.6b-q8_0.asmbin model at 643469504 bytes; then qemu-system-x86_64 with TCG boots the system in 122.14 ms with 4 cores and answers &quot;What is Linux?&quot; saying it is an operating system developed by the Linux Foundation, at 1.85 tokens per second and 17.7 seconds in total" loading="lazy" decoding="async">
  <figcaption>Built and booted under emulation: the sizes match the author's to the byte and boot stays around 100 ms; the answer, on the other hand, has a glaring error (Linux is not developed by the Linux Foundation). · Own screenshot</figcaption>
</figure>


Building was quick. In a `debian:13` container with `nasm` and the x86-64 binutils we got exactly the sizes the author claims: **24,252 bytes** for the operating system and **14,712** for the Linux program. Converting the official Qwen3-0.6B weights to the project's own `.asmbin` format is a Python script with numpy that took 16 seconds.

To boot it we used QEMU **without KVM**: our machine is a Mac with an Apple M2 Max (ARM), so every x86-64 instruction, AVX2 included, is translated in software. It is the worst possible scenario, and the system still reaches the chat:

- The boot counter reads **between 100 and 122 ms**, in the same range as the author's 74-94 ms with KVM. That counter starts when the kernel takes control; before that, QEMU has had to load the model's 614 MiB into memory.
- The first answer takes about **9.5 seconds**: that is the *prefill*, processing the question, which under emulation runs at about 2.3 tokens per second.
- It generates at **1.85 tokens per second** with four emulated cores. On the author's EPYC, with real virtualisation, it is 78.9. The gap is emulation versus native execution, not a flaw in the project.

The cover of this article is the VGA screen exactly as the system draws it. And it shows something else: at **600 million parameters**, the model is confidently wrong. Asked "explain in one sentence what a kernel does", it answered with the machine-learning *kernel*, not the operating-system one. Asked "what is Linux", it said it is developed by the Linux Foundation; Linus Torvalds created it in 1991. That is the model's limit, not the system running it.

## The small print on the numbers

The "up to 54% faster" is real, but it is worth knowing what it compares:

- **It only measures token generation**, not processing the question. The README itself admits that llama.cpp processes the *prompt* in batches while llm.asm goes token by token; there llama.cpp has the edge.
- **The 54% comes from the operating system booted in a KVM VM** with four threads (78.89 against 51.08 tokens per second). The Linux program, on equal footing, gets between **18% and 36%**. The 2 MiB pages of the bare-metal boot add the rest, around 10%.
- **With many threads the lead shrinks**: +31% at 16 threads on the OS, +18-20% between 16 and 40 threads on Linux.
- **It is a single model**. All the code is written for Qwen3-0.6B in Q8_0 (28 layers, GQA, QK-Norm). llama.cpp runs hundreds of architectures, quantisations and GPUs; that generality has a cost.
- **They are the author's measurements**, an average of three runs with 34 input tokens and 64 output tokens, on a single machine. Nobody has replicated them independently yet; our test can only confirm sizes, boot and that the answer is coherent.

We have also corrected one figure in the headline. The "28,000 times smaller than the model" comes from the old weight format (649 MiB). With the v2 format the README itself recommends, the file we generated is 643,469,504 bytes: **about 26,500 times** the size of the system.

## What it is good for

For production, not much yet: a single small model, no network or disk, and it demands an x86-64 CPU with **AVX2, FMA and F16C** and 2 GiB of contiguous RAM. The author includes a **hybrid BIOS+UEFI ISO** builder of about 661 MiB and a guide to boot it in a diskless Proxmox VM, which makes it look more like an inference appliance than an experiment.

Its value lies elsewhere. It is a reminder of how much machinery sits between a model and the silicon, and that an inference stack written for a single case can beat a general one. And it joins a long tradition, that of [KolibriOS](/articles/historia-de-kolibrios) and MenuetOS, which have spent years showing what fits on a floppy disk when everything is written in assembly.

## How we tested this

A `debian:13` (arm64) container on Docker Desktop on a Mac with an Apple M2 Max, with `nasm` 2.16.03, `binutils-x86-64-linux-gnu` and QEMU 10.0.13. Repository at commit `9389c88` (28 Nov 2026) and the official `Qwen/Qwen3-0.6B` weights from Hugging Face. To repeat it:

```bash
docker run -it --name llmasm-lab debian:13 bash
apt-get update && apt-get install -y git nasm binutils-x86-64-linux-gnu qemu-system-x86 python3-numpy make curl
git clone https://github.com/alesha-pro/llm.asm && cd llm.asm
mkdir -p models/qwen3-0.6b-bf16 && cd models/qwen3-0.6b-bf16
for f in config.json tokenizer.json model.safetensors; do
  curl -fLO https://huggingface.co/Qwen/Qwen3-0.6B/resolve/main/$f; done
cd ../..
python3 scripts/export_weights.py --model-dir models/qwen3-0.6b-bf16 \
  --out models/qwen3-0.6b-q8_0.asmbin --scale-dtype fp16
make os LD=x86_64-linux-gnu-ld OBJCOPY=x86_64-linux-gnu-objcopy
qemu-system-x86_64 -accel tcg,thread=multi -cpu max -m 2G -smp 4 \
  -kernel build/asm-llm-os.elf -initrd models/qwen3-0.6b-q8_0.asmbin -nographic
```

On an x86-64 PC running Linux, swap `-accel tcg,thread=multi -cpu max` for `-enable-kvm -cpu host` and use the regular `ld` and `objcopy`: it will run at real speed. The VGA screenshot was taken with `-vga std -display none` and the QEMU monitor's `screendump` command. Afterwards we deleted the container and the 2 GB of weights.

## Sources

- [Alexey Fateev's post on X](https://x.com/superalesha/status/2125682626056839259) (25 Nov 2026)
- [alesha-pro/llm.asm repository](https://github.com/alesha-pro/llm.asm) on GitHub (MIT licence)
- [README of the bootable operating system](https://github.com/alesha-pro/llm.asm/tree/main/02-baremetal-os)
- [Qwen/Qwen3-0.6B model](https://huggingface.co/Qwen/Qwen3-0.6B) on Hugging Face
- [Tom's Hardware: "AI enthusiast deletes Linux to run Qwen3 on a 24KB pure x86-64 assembly OS"](https://www.tomshardware.com/tech-industry/artificial-intelligence/ai-enthusiast-deletes-linux-to-run-qwen3-on-a-24kb-pure-x86-64-assembly-os-28-000-times-smaller-than-model-system-boots-in-74-milliseconds-runs-llms-up-to-54-percent-faster)
