An AI agent wrote a Windows XP PC emulator in a single HTML file in 40 minutes for about $1
The author wanted to see where an LLM agent would hit a wall, so he asked it to write an x86 emulator: a program that runs an entire Windows XP PC inside a browser. In 40 minutes and for about $1 of subscription usage, the first version brought up the desktop, the mouse and the calculator, and the second added games and sound. On top of that, the author built a panel showing how the system communicates with the disk and with interrupts. His conclusion: checking whether "the AI can't handle this" is cheaper than believing it.
AI-processed from Habr AI; edited by Hamidun News
There is a simple way to find where an LLM's capabilities end: give it a task that looks clearly out of reach. The author of the project on Habr did exactly that. He asked an LLM agent to write an x86 emulator, meaning a program that simulates a whole computer in the browser, and then run a real Windows XP on it. The agent finished in 40 minutes, and the first iteration cost about $1 of subscription usage. The entire emulator fits in a single HTML file that works offline.
Expected a failure, got a working desktop
The author had previously built educational tools for learning low-level programming, each in a single HTML file: a disassembler for five platforms, an assembler with HLA64 support, and a simple CPU emulator with step-by-step debugging. In the discussion, one reader said that such an emulator was too primitive: it only had registers, memory and simple devices. As an example of real depth, he pointed to the BK 0010(01) emulator.
The author decided he had found a task the neural network would fail at. Projects on the level of VirtualBox or Fabian Hemmer's v86 are usually written by experienced people over years, and emulator repositories of that kind collect tens of thousands of stars on GitHub. He did not spend many tokens on it: he was sure the result would be negative.
About forty minutes later, the agent reported that everything was ready and launched the virtual machine in the browser itself. The first version already loaded Windows XP: the desktop appeared, the mouse moved, and the calculator started, though not without difficulty. The second iteration optimized startup, after which games ran and sound appeared.
The author recalls the McCorduck effect: as soon as a machine does something, we stop considering it difficult. An opponent had already dismissed it: it's just a large memory array and a big switch over CPU instructions. The author replies that the code is still more complicated than that, but concedes the magic is gone, as it once was with chess.
Why look at yet another XP in the browser
There is little practical point in yet another Windows XP in a browser, beyond nostalgia. So the author changed the goal: to show how the OS communicates with the hardware, and what Windows sends to a device and what the device replies.
The main screen is a tree of the emulated hardware. Each device has an activity indicator and a counter that updates twice a second. Move the mouse and the number on the "PS/2 Mouse" line grows, counting interrupts, that is, signals saying "pay attention to me." Launch a program and the disk shows bytes per second instead of "silence." The list includes the processor, memory, chipset, PCI bus, interrupt controller, timer, CMOS, keyboard, mouse, IDE disk, Cirrus video, AC'97 audio and system ports.
Each device card is built the same way. First comes a plain explanation of what the chip is. Then the ports and memory regions through which Windows talks to it. Next is the interrupt path: device, IRQ line, interrupt controller, vector in the IDT, handler in the driver. There is a "flash" that records everything that happened with the device over a window of 0.1 to 5 seconds; for the disk, it even captures file names. At the end come self-check questions.
What is inside the tabs
- Overview: one-minute graphs of CPU load, interrupts, system calls and page faults. There is a "hardware task manager": a process is identified by the CR3 register, which holds the address of the page tables, without asking Windows anything.
- Monitor: a 4-second timeline and an access log with decoding, for example IRQ0 → vector 0x30 → PIT timer. Each port access is tagged with the process and function.
- CPU: operating mode, highlighting of changed registers, bit-level flags, and a disassembler linked to modules. A 1–40 ms "flash" records every executed instruction.
- Memory: page tables of any process, manual translation of a virtual address to a physical one, and a map of RAM, ROM and devices.
- Windows: lists of processes, DLLs, drivers and the system call table. The emulator reads the kernel structures in physical memory itself.
- Disk: boot sectors, an activity map, and a map of NTFS file layout with sectors labeled by file names.
What this means in practice
The author does not present the project as a replacement for QEMU or WinDbg. His argument is different: for people who want to understand low-level systems, interest usually fades at the setup stage. You need to install the emulator, assemble an image, attach a debugger, find symbols, and if your desk has an ARM laptop, also learn x86. Here it is enough to open a page and plug in a disk image.
For developers and founders, the takeaway is twofold. First, the judgment "this LLM can't handle it" goes stale quickly, and checking it is cheaper than it seems: here it took about an hour and $1. Second, narrow educational tools, such as visualizers, can now be built for yourself without waiting for a team.
The limitations are clear too. This is a personal project, and the account comes from a single author. The text contains no independent measurements of compatibility or performance. But the code is open source under the MIT license, there is an online version and a ready disk image, so the claims can be verified independently.
- Nov 21, 2026Shield Hands GPT-6 Astra Work in Legacy Portals Without APIs: Agents 35–40% Faster
- Nov 21, 2026Claude за несколько часов написал открытую прошивку для камеры за 800 рублей
- Nov 21, 2026Why AI agents still produce bad software: they get pointed at features, not refactoring
- Nov 21, 2026Claude Code traced the author's ancestors back to 1728 in a week — a genealogist would have charged from 230,000 rubles
Key Questions Answered
What are the key details on Expected a failure, got a working desktop?
The author had previously built educational tools for learning low-level programming, each in a single HTML file: a disassembler for five platforms, an assembler with HLA64 support, and a simple CPU emulator with step-by-step debugging. In the discussion, one reader said that such an emulator was too primitive: it only had registers, memory and simple devices. As an example of real depth, he pointed to the BK 0010(01) emulator. The author decided he had found a task the neural network would fail at.
Why look at yet another XP in the browser?
There is little practical point in yet another Windows XP in a browser, beyond nostalgia. So the author changed the goal: to show how the OS communicates with the hardware, and what Windows sends to a device and what the device replies. The main screen is a tree of the emulated hardware. Each device has an activity indicator and a counter that updates twice a second.
What is inside the tabs?
Overview: one-minute graphs of CPU load, interrupts, system calls and page faults. There is a "hardware task manager": a process is identified by the CR3 register, which holds the address of the page tables, without asking Windows anything. Monitor: a 4-second timeline and an access log with decoding, for example IRQ0 → vector 0x30 → PIT timer. Each port access is tagged with the process and function. CPU: operating mode, highlighting of changed registers, bit-level flags, and a disassembler linked to modules.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.