Alexey Fateev has released a standalone bootable x86-64 operating system called "Phase 2: Bare-Metal Bootable Qwen3-0.6B OS" on the GitHub repository llm.asm (MIT license), which runs Qwen/Qwen3-0.6B directly on hardware or via KVM. This configuration uses neither Linux, Windows, C, Rust, nor libc. The same repository contains an inference engine of identical design (Phase 1, 01-qwen3-inference) that runs on Linux; this OS (Phase 2) shares its computation components with it.
Kernel Size and Boot Time
According to his explanation, the stripped static Multiboot 1 kernel is 24,252 bytes (FAST_Q8=1, default). The breakdown consists of .text at 17,143 bytes, .rodata at 2,772 bytes, and .bss as 2.1 MiB of NOBITS, with zero dynamic dependencies. With FAST_Q8=0 (conventional Q8_0xFP32), it becomes 23,612 bytes.
In his measurements, cold boot takes 74–94 ms to reach the interactive asm-llm> multi-turn chat. It retains KV-cache across turns, brings all SMP cores online, and binds models .asmbin v2 (614 MiB, FP16 scale) or v1 (649 MiB, FP32 scale) from physical RAM via zero-copy on 2 MiB huge pages.
Performance Measurements by the Author
He claims 100% token-level and byte-level parity between Phase 1 and Phase 2 across 1–32 vCPUs. Additionally, he reports decoding speeds of 134.9 tok/s on QEMU KVM (AMD EPYC 7642, 16 vCPU) — 23.7 tok/s on 1 vCPU, 118.1 tok/s on 8 vCPU, peaking at 136.6 tok/s — and 55.4 tok/s on a Proxmox VE VM with 0 GB disk (Intel Xeon E5-2670 v3, 12 cores).
KVM SMP scaling measurements (FAST_Q8=1, .asmbin v2 FP16 scale, AMD EPYC 7642, 34-token prompt, 64-token generation, greedy) are as follows:
| vCPU (KVM) | SMP Online | Boot Complete (ms) | Boot → First Token (ms) | Prefill (tok/s) | Decode (tok/s) | Parity with Phase 1 |
|---|---|---|---|---|---|---|
| 1 | 1/1 | 73.47 | 1161.48 | 31.72 | 23.46 (peak 23.67) | Exact match (64/64) |
| 4 | 4/4 | 84.10 | 425.11 | 104.67 | 78.17 (peak 78.89) | Exact match (64/64) |
| 8 | 8/8 | 84.54 | 316.71 | 157.46 | 118.97 | Exact match (64/64) |
| 16 | 16/16 | 84.88 | 312.87 | 160.46 | 134.94 (peak 136.63) | Exact match (64/64) |
| 24 | 24/24 | 94.27 | 288.75 | 190.67 | 133.07 | Exact match (64/64) |
| 32 | 32/32 | 89.84 | 313.82 | 167.05 | 132.43 (peak 133.75) | Exact match (64/64) |
He explains that because boot.asm identity-maps guest RAM using 2 MiB huge pages, it avoids 4 KiB page table walks spanning the 614 MiB model, surpassing Phase 1’s use of Linux mmap() and CPU Q8_0 in llama.cpp across all thread counts.
As real-world measurements on a Proxmox VE VM, he lists the following figures:
| Prompt | Prompt Tokens | Generated Tokens | Prefill | Decode |
|---|---|---|---|---|
| Explanation of CPU cache (3 sentences) | 25 | 52 | 286.20 ms (87.35 tok/s) | 920.15 ms (55.43 tok/s) |
| Alice & Bob apple word problem | 39 | 96 | 446.86 ms (87.28 tok/s) | 1770.49 ms (53.66 tok/s) |
Configuration and Features
According to him, Phase 2 compiles shared/math.asm, shared/matmul.asm, shared/tokenizer.asm, and shared/transformer.asm with -DBARE_METAL -DFAST_Q8=$(FAST_Q8) and combines them with 4,167 lines of bare-metal OS code.
- Boot and Long Mode (
boot.asm,linker.ld): Verifies Multiboot 1 magic (0x2BADB002), zeroes.bss, builds a 4-level identity table of 2 MiB huge pages covering0..4 GiB(specifying Strong Uncacheable for0xFE000000..0xFFFFFFFFfor Local APIC MMIO), enters 64-bit long mode, sets up an exception IDT with 32 entries, verifiesXSAVE + AVX + AVX2 + FMA + F16Cvia CPUID, and initializesCR0/CR4/XCR0=7/MXCSR. - Zero-Copy Weights and Physical Arena (
runtime.asm): Directly binds.asmbinby physical address (verifying"ASML"magic), cuts out a 449 MiB KV-cache plus scratch arena from the largest available Multiboot memory map region, and zeros it using AVX2. - Bare-Metal SMP (
smp.asm): Parses ACPI RSDP to RSDT/XSDT and MADT ("APIC"), includes fallback for Local APIC broadcast, installs position-independent trampolines at0x8000for 16→32→64 bit transitions, wakes all AP cores via Local APICINIT-SIPI-SIPI, enables AVX2/FMA/MXCSR identically on each core, and dispatchesmatmul_q8_0andgqa_attn_rangevia lock-free cache-line separated spin barriers. - Hardware Drivers (
drivers.asm): Includes COM1 serial (0x3F8, 115200 8N1), 80x25 color VGA (0xB8000), PS/2 keyboard (0x60/0x64), PIT channel 2 + RDTSC-based 20 ms hardware PIT calibration, and ACPI power-off (QEMU/Bochs ACPI S5 ports0x604,0xB004,0x4004withisa-debug-exitfallback).
The interactive console operates in multi-turn chat mode by default, retaining KV-cache, and supports commands such as /clear, /think, /nothink, /bench, /halt, and /help. Kernel command line parameters include prompt, max_tokens, ctx, threads, think, raw, single_turn, temp, topp, seed, print_tokens, and shutdown.
Building requires an x86-64 CPU with AVX2 + FMA + F16C support and utilizes nasm, binutils, and qemu-system-x86. Creating a BIOS+UEFI hybrid ISO additionally requires grub-pc-bin, grub-efi-amd64-bin, grub-common, mtools, and xorriso. Builds are performed via make os FAST_Q8=1 and make os-check, demonstrating three execution methods: direct boot under QEMU KVM, creation of a hybrid ISO, and deployment to a Proxmox VE VM with 0 GB disk.
A verification script scripts/verify_os.py is provided, reporting 100% agreement with Phase 1 in terms of prompt tokens, generated tokens, and raw UTF-8 bytes across five parity prompts: English technical prompt, English concise prompt, Russian UTF-8, arithmetic word problem, and --think mode.
How to View This
This document publishes only the contents of the repository by Alexey Fateev and measurements conducted by himself. Figures such as a 24,252-byte kernel size, 74–94 ms cold boot time, 134.9 tok/s decode speed on KVM with 16 vCPUs, and 55.4 tok/s on Proxmox VE VM are presented solely as his measurements and claims; no third-party replication or independent measurement results are documented here.
Conditions for comparative values must be verified. The KVM SMP scaling table reflects values under conditions of FAST_Q8=1, .asmbin v2 FP16 scale, AMD EPYC 7642, 34-token prompt, 64-token generation, and greedy decoding. The comparison table with llama.cpp in the repository's overall README presents data under conditions of the same machine (AMD EPYC 7642, CPU-only -ngl 0), same model (Qwen3-0.6B Q8_0, comparing 613.66 MiB .asmbin v2 FP16 scale against 604.15 MiB GGUF Q8_0), 34-token prompt, 64-token generation, and average over three runs, showing FAST_Q8=1 achieving 1.24x (+24.5%) faster on 1 thread and 1.36x (+35.6%) faster on 4 threads. However, the same README notes that while llama.cpp uses batched GEMM for prompt prefill, llm.asm operates via per-token GEMV; thus, this comparison pertains specifically to autoregressive decoding tg64. Since both peak and average values are listed in some places, one must distinguish which value is being referenced when interpreting the numbers.
Although the verification script scripts/verify_os.py is published within the repository, this document does not contain results of third-party executions of this script nor any performance certification by external organizations.
Source: llm.asm Repository (GitHub), README for 02-baremetal-os (GitHub), Phase 1 Inference Engine 01-qwen3-inference (GitHub), Post by Alexey Fateev on X