Devlog · 16 November 2026

The base was ours. The foundation was not.

For two weeks we replaced the whole stack under the R36S: a self-compiled mainline kernel, Debian 13, a panel driver written from the vendor’s init sequence. It boots, it runs games, it speaks Chinese. And then we moved it onto somebody else’s base. This entry is about why.

What we built

A 6.12 kernel with a custom DSI panel driver, Debian 13 on top, panfrost for the Mali-G31, audio through the rk817 codec, a Chinese EmulationStation menu, battery reporting, a 16 GiB image that boots a blank card into the menu. The numbers are in the previous entries; the work was real.

What kept breaking

Input. On this board the analog stick is one input device and the buttons are another. SDL and RetroArch do not merge them. We wrote a userspace bridge that turned buttons into a virtual keyboard, and later a second bridge that turned the stick into a mouse for Flash games. It worked well enough to be dangerous: the menu was usable, but the WiFi password keyboard still moved its cursor backwards on the stick, RetroArch needed keyboard-style bindings, and the Ruffle mouse bridge fought with everything else for the same devices.

The frontend. Rebuilding EmulationStation from source lost the vendor’s branding and translations, and our attempts to fix one navigation bug in one dialog had no effect on the device. Without a way to observe which code path a page actually uses, every fix was a guess.

Iteration cost. A 16 GiB image writes to our test card at about 2.6 MB/s. Changing one script meant a two-hour flash.

What we found in somebody else's tree

While reading the device tree of an existing distribution (Arch R) we found a single kernel driver that owns both the ADC stick and the GPIO buttons and presents them as one gamepad. The problem we had been engineering around in userspace does not exist on that base. The same tree also carries a battery calibration patch and a U-Boot routine that identifies dozens of panel revisions.

That was the whole lesson: we were not stuck on a hard problem, we were stuck on a problem somebody had already solved one layer lower.

What we changed

TreeOS stops being a self-maintained distribution. It becomes a layer on top of a maintained base:

  • Kernel, input, panel and boot: the existing distribution.
  • TreeOS: Chinese interface and documentation, the Ruffle runtime, per-game mouse/keyboard mapping, boot art and branding.

The panel parameters, translations, boot images, save backups and the game library all move across. The userspace input bridges retire.

What we are validating next

Before any more system work: two days on a spare card with the real goal — a complete round of a 4399 Flash game, with working controls, sound and persistent save data. If that fails, the honest conclusion is that the problem is the game or the runtime, not the distribution.

The retrospective, in Chinese, is in the repository: the input write-up documents the technical dead end in detail.