Two browsers: the one written from scratch, and the one the OS hosts

At 3:14 in the demo film, a browser opens and loads a page. By the end of August the OS had two browsers, and they could not be more different. One was written in this repository: its own TCP/IP, HTTP, HTML parser, CSS cascade, layout, paint and JavaScript engine, with the cryptography and, later, a second CSS engine and a second JS engine vendored and inventoried as such. The other is Chromium, unmodified, on a Linux kernel that UnoDOS boots under its own hypervisor, painted into a native UnoDOS window. Only the first is in v3.34.0. The contrast is the essay: each one cost something specific, proved something specific, and neither on its own is the browser a person would want.

The first browser: three days in July

It arrived in the order a network client has to. TLS came first, the night of July 15 (6fcfa797, "pc64: TLS client via BearSSL (pinned key, RDRAND, TLS 1.2 verified)"), and the commit is honest about what was not written here: "No crypto is rolled by hand." BearSSL is vendored, "~286 sources compile with the port's mingw flags", and trust on day one was a pinned public key, "no CA store, no system clock needed."

The browser landed the next afternoon (b2c8d043, July 16, 14:40) as "a native windowed canvas app rendering HTML + Markdown + basic CSS (no JS / no network yet)". Three hours later it ran scripts (0e6ac0f0, "browser: run JavaScript in <script> blocks (js.c)") through "a tiny tree-walking JavaScript interpreter". Forty minutes after that it was on the network (781633ad, "browser: load pages over the network (HTTP), + DNS resolver"), with one refusal: "HTTPS is refused with a clear message (needs CA trust)." The refusal lasted until noon on July 17 (81b7a9f8, "browser: HTTPS with CA-validated TLS"): fourteen root certificates, chain validation, the validity window "checked using the UEFI real-time clock", and a ceiling: "BearSSL is TLS 1.2 (no 1.3)."

So by July 17 every byte between the wire and the screen went through code in this repository except the cryptography: the stack works end to end, as a client, with nothing underneath it. It was also a text renderer with a 577-line interpreter, and the first real site showed it.

"Didn't load"

7ef2ddaa, July 27: "browser: follow HTTP redirects; skip unparseable page scripts". Why google.com was blank: "It was a single GET, so a bare host like google.com only ever received the 301 stub (apex -> www) and the browser rendered a near-blank 'moved' page." And: "Real pages carry minified JS this tiny interpreter can't parse", which "turned a script-heavy page into a wall of 'JS parse error' instead of the page's own text."

That morning the agent wrote the design for replacing all of it (4610d43e, "docs: web engine design - unojs + unoweb split, milestones M1-M7"), and the organizing rule is the part I would keep if I kept nothing else: "the JS engine (unojs/) is a separate library from the web core (unoweb/) - neither knows the other's types; webjs.c is the one binding file that sees both." Then it built the first four milestones in an afternoon. 1bce05fe at 12:31, "unojs: the engine core - lexer, compiler, bytecode VM, GC, library", a NaN-boxed bytecode VM with "fuel-based UJS_YIELD/ujs_resume preemption", which is how an untrusted script on a ring-0, single-address-space OS becomes a slow page instead of a dead machine. The DOM and streaming parser at 13:38, the cascade at 14:04, block layout at 14:15, and at 14:31 the browser painting through the new pipeline (5e9c4893).

That last commit contains the finding this series keeps making. Two bugs were found wiring it, "both of which faked success": the engine flag was appended "AFTER the loop that compiles pc64_browser.c, so the first QEMU run silently rendered through the OLD path and looked like a pass. Screenshots prove what ran, not what you intended to build - the giveaway was code-span backgrounds that only the flow painter draws." The agent caught its own false pass by noticing a background colour the new code could not have drawn.

What got vendored, and what did not

August 5 is the day the first browser stopped pretending to be entirely its own. I asked the agent to put Blink and V8 behind the same front end as a switchable option. The answer, in docs/BROWSER-ENGINE2-PLAN.md, is a refusal with arithmetic: "The smallest thing that runs Blink is ~all of Chromium (~25M lines)", and V8 alone would need "a POSIX personality + C++ runtime for UnoDOS - months, tens of MB, still no Blink at the end." That sentence is where the second browser comes from.

What landed instead: quickjs-ng, "vendor quickjs-ng v0.16.1 engine core, unmodified" (a8149146), as a runtime-switchable second script engine; and NetSurf's CSS libraries, after a licence ruling the same night (757cc457, "docs: licence ruling reshapes phase 2 - no GPL (user, 2026-08-05), MIT ok"): "NetSurf's layout core (GPLv2) is excluded; phase 2 becomes the MIT NetSurf libraries - libcss + libparserutils + libwapcaplet - upgrading unoweb's cascade in place." The vendoring commit (d9f26055) carries the audit: "265/267 explicit MIT, 2 covered by project COPYING, 0 GPL." All of it is in THIRD-PARTY.md, which is why the launch numbers are stated the way they are: 767,041 tracked lines at v3.34.0, of which 375,802 are vendored (BearSSL, quickjs-ng and the libcss stack are three of the six rows) and roughly 391,000 were written in this repository. The first browser's own core, counted at the tag, is small next to either figure: unojs about 6,200 lines, unoweb about 5,600, the browser app about 3,000.

M5 through M7 landed the same day and the next, and the messages record the agent being wrong and saying so. 87a1bf56 (the live DOM binding) ends with "KNOWN ISSUE: the quickjs DOM adapter is written and runs clean under a native build, but the mingw host binary dies at startup when it is the selected DOM engine. Pinned off until root-caused." It is still pinned off at v3.34.0. Keep-alive had been disabled for a reason that did not exist (b0dbee6f, "http: re-enable keep-alive - it was never the thing that was broken"), and the documentation was wrong about its own code (2d9a0d79, "unoweb: the gap list said floats and tables were missing; both shipped").

The caps

The best single story in the first browser explains why google.com was still blank after the redirect fix. On August 6 the agent claimed it (9e7d3fbe, "requests: claim the browser size caps (48 KB truncates google.com)") and the fix (aec8c4b1) says what it found: "www.google.com answers 1,384 bytes of headers and an 82,760-byte body whose <body> does not open until body offset 62,883, so the parser was handed a document consisting entirely of <head> - scripts and one stylesheet - and rendered exactly what that contains: nothing. The status band said 200 OK, because the fetch had genuinely succeeded." The worse defect was the silence: "a half page was indistinguishable from a site that is genuinely blank."

A second cap sat behind the first. The DOM arena was a flat 2 MB, "chosen when the transport could not deliver more than 48 KB anyway" (761f9d54), and the agent measured real pages through the whole pipeline: "google.com 83 KB needs 1 MB", "Wikipedia's HTTP article, 609 KB, needs 8 MB - it drew NOTHING at 2 MB." Then a third, fixed that evening (403b2de5, "unoweb: an exhausted arena paints the top of the page, not nothing"): "a reader with a blank canvas cannot tell a big page from a broken browser." The request ledger records before and after on a physical machine: google.com went from "blank, HTTP/1.0 200 OK" to its footer links. That is the first browser at v3.34.0: a text-first renderer with a runtime switch between two renderers and three engines (0e848030), whose message admits that until that day "Both renderers were already in the image you were running. One of them was unreachable." The flow painter from July 16 is still the default; I ruled it so.

The second browser

The same day the caps came off, between 761f9d54 at 12:11 and 0e848030 at 13:46, the agent committed 03f72d56, "unovirt: A0, what this machine could host and why not". How the hypervisor was built is the next essay; here it is only the other browser.

The feasibility finding had said Blink is "~all of Chromium" and the honest price of V8 is a POSIX personality. The hypervisor pays that price by not paying it: let Linux be the personality, boot it under the OS, bridge it to the wire. By 16:57 on August 6 a real kernel was talking (a2cfec12, "unovirt: A6 - Linux boots under UnoDOS and says so"); by 23:38 a shell in it answered a command (6138ba7a): "The reply is the criterion. Kernel output only ever proved that a kernel runs; an answer proves the guest read a line we sent it, ran it, and replied". The next morning the guest pinged a synthetic peer over virtio-net (795bb4a5), with the scope stated: "THE PEER IS SYNTHETIC, AND THAT IS A SCOPE DECISION RATHER THAN A SHORTCUT." That is where v3.34.0 leaves it: a Linux shell under UnoDOS, no display, no real network, about 5,400 lines of hypervisor and device model.

Everything after this landed in the seven weeks between v3.34.0 and v3.35.0. On August 21, twelve hours after v3.34.0 was tagged, the guest got a framebuffer and a keyboard (ddd4136e), then the real wire (26693e04), by the cheapest answer available: "the guest keeps its own MAC and DHCPs for its own lease, which works because every NIC driver here already runs promiscuous". That evening, d1be9d01: "docs: M3 is met - Chromium browses the internet inside UnoDOS". The commit names the cost: "five things stood between a working bridge and a working browser and only the first was virtualization: a bridge armed before any link existed, a browser that caches its first failure forever, an appliance with no CA roots, a CMOS answering with a hardcoded date while TLS checks the clock, and a harness box whose own resolver answers for some names and not others." The date one (34ee787e): "a guest fifteen days in the past rejects every certificate issued since, and what it reports is 'certificate verify failed' - which reads as a missing CA or a broken network and is neither."

The appliance is Alpine 3.20 with Chromium on a 6.12 kernel, built by scripts in pc64/guest/appliance/ that are ours, producing an image that is not: under the no-GPL rule the kernel and rootfs are "never in the tree and never linked into anything", staged on the disk as a file. By the morning of August 22 the X server had been replaced with a Wayland kiosk compositor because Xorg "segfaulted on this guest's framebuffer", and the case was stated narrowly (a74b412b): "plain letters typed from the host do not reach it, while the same appliance image takes a typed URL happily under plain QEMU". Ctrl+L and Backspace arrived; the alphabet did not. Four runs had failed to split that bug before the agent put a counter on each side of the wire (104c17cf) so that "the next failure names its own side." The next day it closed, and not where anyone was looking: the Wayland compositor had never been running, because a debug flag it does not have made it print its usage and exit, and the appliance had fallen through to its X fallback on every boot (9ea1e957). With the compositor actually up, an address typed on the UnoDOS side navigated the guest's browser (c75d2427, August 23). The hypervisor essay told that story in full.

What each one proves

The from-scratch browser proves the OS can be a network client with nothing underneath it: DHCP, DNS, TCP, TLS 1.2 over vendored crypto, HTTP with redirects and keep-alive, and a page pipeline that survives hostile input by budgets rather than a sandbox. It cost about three days of commits and three libraries it would have been dishonest to rewrite. It renders text-first sites; the design document lists web apps as a permanent non-goal.

The hosted browser proves the OS can be a host: boot a foreign kernel on a frame loop with no scheduler, give it a display, a keyboard and the wire, and get a 2026 browser rendering real HTTPS in a window the UnoDOS window manager owns. It cost about 5,400 lines at v3.34.0, more since, and an appliance image the repository does not contain. As of v3.35.0 it can be typed into, it has a second appliance (GIMP, which found that the hypervisor had never saved the guest's FPU registers), and it still needs an Intel CPU with VT-x and has mostly been run under nested virtualization.

A hobby OS wants both because they answer different questions. The small one answers "does my stack work", which nothing hosted can, since a guest brings its own stack. The big one answers "can I have the web", which nothing written here will, because the agent did the arithmetic and it came out at twenty-five million lines.

The lesson

Write the small version to prove your platform; host the real one to deliver the feature; and never let either stand in for the other. The failure mode runs both ways and it is the same one: a screenshot of a page that proves less than it appears to. The from-scratch browser "looked like a pass" through the old painter, said "200 OK" over a blank page, and painted nothing at the arena limit; each fix was to make the thing say which claim it was making. The hosted browser rendered a page two days before it could be typed into, and the repository said so rather than calling it done. The next essay is about a driver with no such luxury, because the firmware on the other side of it is undocumented and the war with it is still being narrated as it happens: iwlwifi.

Sources: https://github.com/hmofet/unodos, commits 6fcfa797, b2c8d043, 0e6ac0f0, 781633ad, 81b7a9f8 (July 15-17); 7ef2ddaa, 4610d43e, 1bce05fe, 5e9c4893 (July 27); a8149146, 757cc457, d9f26055, 87a1bf56, b0dbee6f, 2d9a0d79 (August 5); 9e7d3fbe, aec8c4b1, 761f9d54, 403b2de5, 0e848030, 03f72d56, a2cfec12, 6138ba7a (August 6); 795bb4a5 (August 7); after v3.34.0: ddd4136e, 26693e04, d1be9d01, 34ee787e, 104c17cf (August 21), a74b412b (August 22), 9ea1e957, c75d2427 (August 23); docs/WEB-ENGINE-DESIGN.md, docs/BROWSER-ENGINE2-PLAN.md, docs/UNOVIRT-PLAN.md, pc64/UNOVIRT.md, pc64/UNOAUTOMATE-REQUESTS.md (2026-08-06 size-cap claim), csslib/VENDOR.md, pc64/guest/appliance/README.md, THIRD-PARTY.md at v3.34.0.

The OS in this piece runs in your browser. No install, no sign-up: boot it in a tab, or download it for any of 22 machines.

Get the next one

New essays roughly every other week: the war stories, the method, and the receipts. No spam, unsubscribe in one click.

Prefer a reader? RSS.