Bare Metal Qwen

By hackernews · · AI News

Bare Metal Qwen

Qwen3-0.6B inference (12 KB), bare-metal bootable OS (22 KB), and from-scratch Mini-GPT trainer with live Braille TUI (32 KB) in 100% pure x86-64 NASM assembly. Zero C, zero libc, zero dependencies...

A standalone bootable x86-64 operating system that runs Qwen/Qwen3-0.6B directly on hardware or KVM with no Linux, no Windows, no C, no Rust, and no libc.

Running live on a diskless (0 GB storage) Proxmox VE VM booted from the hybrid BIOS+UEFI ISO (Intel Xeon E5-2670 v3, 12 cores, 2 GiB RAM):

Build

From the repository root (FAST_Q8=1 is enabled by default; pass FAST_Q8=0 for legacy FP32-activation mode):

(The kernel is linked as 64-bit ELF and wrapped into ELF32 via objcopy -O elf32-i386 for standard Multiboot 1 loaders like QEMU -kernel and GRUB2; boot.asm transitions immediately into 64-bit Long Mode.)

Option A: Instant QEMU KVM Boot (~85 ms)

Boot directly in the terminal over COM1 serial (-nographic):

Run a one-shot batch prompt with clean ACPI shutdown:

Open a live 80x25 VGA GUI window with PS/2 keyboard input:

Option B: Bootable Hybrid BIOS+UEFI ISO

Packages the 23 KB kernel, GRUB2 Multiboot 1 config, and the 649 MiB.asmbin model into a single self-contained ~661 MiB bootable ISO (build/asm-llm-os.iso):

Boot the ISO in QEMU KVM (SeaBIOS or UEFI OVMF):

Option C: Deploying on Proxmox VE (0 GB Disk VM)

Because the entire OS and model live inside the ISO and run out of RAM, the VM needs zero hard disks.

(Note: --cpu host is required so the VM exposes AVX2 + FMA, and --balloon 0 ensures 2 GiB of contiguous guest RAM for the 649 MiB model + 449 MiB KV-cache arena.)

What Hacker News is saying

  • “It looks like this is one subproject in a larger exercise and the top-level README presents the benchmarks that peg this against a pure-assembly Linux ELF (also in this repo) and llama.cpp: https://github.com/alesha-pro/…”
  • “Pretty cool as a concept, reminds me of the self-booting disks from back in the day.”
  • “Excellent, now make it self prompt to search for security flaws and spread itself to more instances and we'll have a big'ole mess on our hands.”
  • “This feels like the equivalent of putting a brain in a jar like in Futurama.”

Read the full discussion on Hacker News →

Source: https://github.com/alesha-pro/llm.asm/tree/main/02-baremetal-os

More stories