the idea
kolibrios is a tiny x86 operating system written in assembly. instead of emulating x86 on the esp32-p4, esp32-os reimplements the kolibrios system functions in rust and compiles the original kolibrios c programs for risc-v. so it's not an emulator, the apps run natively. the skin, fonts, icons and several programs come from kolibrios.
the hard parts
memory. the p4 has 32 mb of psram but only a few hundred kb of fast internal ram, and wi-fi, the display and freertos all want internal ram. at one point only ~86 kb were free. moving the display strips into psram brought it up to ~210 kb, and every program now gets its own heap in a psram pool.
the display. the 5" panel is 720x1280 over mipi-dsi. the desktop is drawn at 640x360 and scaled x2 by the p4's ppa (pixel processing accelerator). that keeps drawing cheap, but one scaled frame takes ~25 ms, which caps smooth scrolling at around 27-32 fps.
a heap that got slow. after a while memory got fragmented and the allocator walked a long list of free blocks. one heavy news site froze the browser for 41 seconds. the fix was an address-sorted tree (treap) for the free blocks, same placement, no extra waste, and the freeze is gone.
the browser. netsurf 3.11 with quickjs-ng runs in about 10 mb. es modules aren't supported, so it uses the nomodule fallbacks most sites ship. html over 512 kb gets cut off, and a status bar tells you when a page is too big or javascript ran out of memory.
wi-fi goes through the onboard esp32-c6 with esp_hosted over sdio.
testing
touch input is injected over the serial port by an autopilot and the framebuffer is read back as screenshots, so whole touch flows are tested automatically. releases get 75 minute endurance runs with every app, and memory leaks were hunted down that way (the start menu alone leaked about 1 mb per hour at one point).
developed with claude code. the source, logs for every number and the web flasher are on github.
theunkn0wnc0de