BEROUNOS for AI-native devices

Targets

One system, many bodies.

Everything device-specific sits behind a small set of interfaces. A device, a simulator or a phone supplies them.

Beroun does not know what device it runs on. Everything device-specific sits behind a small set of interfaces, each with a system implementation and a test double. A device, a simulator or a phone supplies the interfaces, and the apps, Caroline and the store don't change.

Beroun · apps · Caroline · shell · storethe same everywhere Interface: input · power · clock · network · audio · vibration · display · storage · swap A deviceLinux · real hardware A simulatoryour PC · or in the browser Androida WebView shell
One system above the line, many targets below it.

The interfaces

InterfaceIn the codeIn the simulatorOn a device
Input and sensorsVirtualHardwareA virtual gamepad and touch screen; files for battery and ACLinux input events for the logical buttons, sticks and touch; the power supply files
PowerpowerdA process that sleeps, powers off and on the simulated consoleSleep on a short POWER press, shutdown on a long one
Clock and zonetimectlA fake clock: host time plus an offset; the host's clock is never touchedThe system clock: one-shot NTP, /etc/localtime, hardware clock
NetworknetctlThe host's network, with made-up Wi-Fi networks to connect toWi-Fi control on the device's interface
AudioALSA configurationThe host's sound serverALSA directly
VibrationsysapiLogged, with the page's edge lighting upStrength written to the motor's file
DisplayA Weston output, 640×480A window, or a stream in a browserA DRM/KMS panel
External displayextdisplay (rules) and a driverA second virtual screen, plugged and unplugged by a callConnector hot-plug and mode, and a pointer of its own
StorageThe memory card's mountA sparse ext4 imageThe card
Swapmemdzram plus a backing filezram with write-back to flash
Temp-directory pressuretmpwatchWatches the host's RAM-backed /tmpThe same, if /tmp is in RAM

Required of any Linux target

  • Weston 14.x, WPE WebKit 2.52.x (libwpe, wpebackend-fdo, cog), Python 3 for the daemon, and GStreamer with H.264/AAC and VP8/Opus decoding for media.
  • A 640×480 display, a gamepad-style input set and touch. The interface is designed for them (see the input model).
  • About 2 GB of RAM for everything open.
  • Ports: shell 8765, power 8764, Caroline 48765–48767, A2A 48772, store apps 49000–49999, inspector 9222. Each simulator instance adds 100 per instance number.

Memory that holds

Everything Beroun runs lives inside one memory budget. On top of it sit compressed swap in RAM and write-back of idle pages to flash under a daily write limit. When room still runs out, the service manager stops the lowest-priority services first.

lowest priority · stopped first higher priority · stopped later 90 and above · never stopped declared by every service in its manifest: priority and memory_mb the memory budget for everything the device runs compressed swap in RAM (zram) idle pages written back to flash, daily cap
Caroline's backend runs at priority 100, so it is never a victim.

The simulator target

The simulator runs the same stack natively and shows it in one window, or streams it to a browser. No CPU or GPU is emulated: only the interface above is replaced. That is why the manifests, the shell, the apps and Caroline are exactly the ones a device runs. Development never waits for hardware.

  • A virtual gamepad, touch screen, battery and memory card.
  • The memory budget and swap enforced on the PC.
  • A second screen on demand for external-display apps.
  • Several simulators side by side, each with its own ports, data and card.

Beroun on Android

The design: Beroun runs as an ordinary Android app, and every app, the same packages as in the store and never rebuilt, runs in it on a phone or a tablet. Interfaces are HTML, JavaScript and CSS, so the app is a shell around a web view.

QuestionDecision
Web engineThe system WebView (Chromium). The shell checks its version at start and asks for an update below a minimum
ScreenNone of its own: immersive full screen, the WebView is the whole screen
ControlsAn Android input method of our own, in the same APK, that repeats the logical buttons. Text uses Android's keyboard
PagesServed by WebViewAssetLoader with the same paths: /apps/<id>/…, /system/<id>/…, /api/…
BrowserIn WebViews of the shell
Wi-Fi, date and timeAndroid versions of these apps, managing Android's own settings
New APIPlatform.capabilities() and Platform.device(), so an app knows where it runs

The Python side (services, MCP servers, the shell and Caroline) runs inside the APK on CPython, with the shell in an Android mode. Caroline's updates for platform beroun run unchanged.

Adding a target interface

Add the method to VirtualHardware (or the matching module), expose it in the shell, document the counterpart in the table above, and add a Caroline tool for any new /api/ route.