Close
0%
0%

ESP32-OS

a kolibrios-compatible desktop os for the esp32-p4 touch board, with a js-capable browser, pdf viewer, doom and quake

Similar projects worth following
0 followers
esp32-os turns the waveshare esp32-p4 5" touch board into a small desktop computer: touch desktop in 3.5 s, web browser (netsurf + quickjs-ng), pdf and image viewer, music (mp3, wav, ogg), weather, notes, file manager, an app store, doom and quake.

how it works: kolibrios is a tiny x86 os. esp32-os reimplements its system functions in rust on the esp32-p4 (risc-v), so kolibrios' c programs run after a recompile. wi-fi goes through the onboard esp32-c6.

install from chrome or edge with the web flasher: https://theunkn0wnc0de.github.io/ESP32-OS/

numbers (logs in the repo): doom 55 fps, quake 27.5 fps, 75 min endurance runs with 0 crashes.

gpl-2.0, developed with claude code. 3d-printable case in the repo.
repo: https://github.com/TheUnkn0wnC0DE/ESP32-OS

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.

  • 1 × Waveshare ESP32-P4-WIFI6-Touch-LCD-5 ESP32-P4 (chip rev v1.x) with 32 MB PSRAM, 5" 720x1280 touch screen and ESP32-C6 for Wi-Fi
  • 1 × microSD card optional, for files, music, photos and the doom/quake shareware data
  • 1 × USB-C cable plug into the "USB TO UART" port to flash with the web flasher
  • 1 × LiPO Battery 3000mAh 2C optional, to use the board without a cable. esp32-os doesn't show the battery level yet

  • where it's at: from 1.0 to 1.0.7 in one week

    theunkn0wnc0de • 3 hours ago • 0 comments

    esp32-os went public about a week ago, and since then it got seven updates. a quick summary of what changed:

    - stability: memory leaks fixed (the start menu leaked about 1 mb per hour), quake and home button crashes fixed, and when system memory is almost full it now refuses new programs instead of crashing

    - new heap: free blocks live in an address-sorted tree instead of a long list, which removed a 41 second browser freeze on heavy sites

    - browser: better css (var, calc, rgb, logical properties), more js apis, and a status bar that tells you when a page is loading, too large or out of javascript memory

    - new stuff: weather app, ogg playback, and an app store that installs doom and quake over wi-fi with a sha-256 check

    - polish: on-screen keyboard no longer loses taps when typing fast, a random light blue flash and 7 other visual glitches are gone, and the ui texts follow the language setting with english as default

    every release runs a 75 minute endurance test with all apps, the last ones with 0 crashes and 0 reboots.

    next up: getting more of the bigger websites to load, and support for a second board (the guition jc4880p443c) thanks to a community pull request.

    you can try it from the browser: https://theunkn0wnc0de.github.io/ESP32-OS/

View project log

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates