Back to News

510-byte boot sector runs char-level neural net generating infinite Linux boot logs

46 points · 0 comments#boot-sector#neural-network#language-model#qemu

A developer created a character-level neural network language model that fits entirely within a 510-byte MBR boot sector, generating infinite Linux boot messages for non-existent hardware. The inference engine occupies the MBR, while weights, vocabulary, and strings are stored in subsequent sectors. The training script performs identical integer arithmetic to the assembly code, producing output that matches QEMU character-by-character, with debugging aided by QEMU's debug port.

Coverage timeline

  1. Hacker Newskerlenton

    All the ideas came from the boot sector demo scene where people had been writing chess and BASIC games in 512 bytes, even a C compiler. I wondered what one can do using a neural network instead of a program and generating boot logs for non-existent hardware was something fun to try. Entire inference engine is 510 bytes of MBR, weights, vocab, and strings reside in the sectors following MBR. Small char-level neural network was trained on dmesg generated by machine, so machine produces Linux boot messages infinitely. train.py performs precisely the same integer arithmetic operations as the asm code does and thus produces an output identical character-by-character to the one produced by QEMU. The difference analysis revealed my favorite bug. The characters at the beginning matched those generated by the simulator, but then the output diverged. I retrieved the hidden layer via QEMU’s debug port and compared the neurons' values with those of the simulator, one neuron at a time. Only the val

News updates every hour. Subscribe in your RSS reader to get new stories automatically.

Subscribe