A Tiny OS For A Tiny Board

As microntrollers have become ever more powerful, we have started to see an increasing number of operating systems written to take advantage of this extra power. Usually they’re aimed at handheld or other similar devices with support for screens and input devices, but just what can be done if a developer eschews those niceties? KoaOS is a small OS for the ESP32-S3 on the Heltec WiFi LoRa 32 V4, and it’s headless. You can only talk to it via a serial terminal on its USB port.

What it provides is a UNIX-like shell, with editor, GPS, weather and APRS apps ready to run. It’s not just limited to those, there’s an SDK of sorts to create new apps and compile them from C. These .esp files can be installed and uninstalled at will over the network.

There are a few limitations, for example it’s only for the Heltec V4 due to a large requirement for PSRAM. We are guessing that another similar spec board could probably be made to perform, however it’s clear that hasn’t yet been done. Despite that we think this OS is interesting for concentrating on the OS rather than the interface, and we hope to see it develop further.

Several takes on an ESP32 OS have appeared in recent times, including this JavaScript one.

24 thoughts on “A Tiny OS For A Tiny Board”

    1. It runs on top of FreeRTOS.

      It’s built on the esp arduino core, which runs FreeRTOS

      They’ve built an os on top of an os.

      1. It’s a bit more interwoven in Windows, but if you run any *nix, Mac or Android, you’ll also run a separate graphical environment on top of a shell environment, duplicated keyboard and display setup and all.

      1. After looking into both (an dabbling with one) this comment explained what I was really looking for. Cookies will be thankfully accepted.

    1. This is more like a runtime environment. It has an interpreter that can load code at runtime and execute it.

      The whole thing runs on top of FreeRTOS as an Arduino sketch

  1. Interesting but not a real networked OS, and it is not at all secure. Interesting POC, that is it. I’d go with a tiny Linux SOC + LoRa for anything more sophisticated that you wanted to actually deploy.

    1. Well, it also can’t play Crysis but this doesn’t make it bad.

      Regarding security – if you switch a RISC-V MCU, most of them support Physical Memory Protection (PMP) module, which is good enough as a security for an embedded application. rp2350 also supports it in RV mode. In addition, if you decide to run the rp2350 in Cortex-M33 mode, it supports ARMv8 Security Extensions, which is very similar to RV PMP. Actually Cortex-M4/M7 supports Memory Protection Unit (MPU, optional on Cortex-M3), if you need it there, not sure whether FreeRTOS supports it (and too lazy to check). But you can add the support for yourself, it’s not that hard.

      Regarding the “tiny Linux SOC” – almost all widespread Linux-capable SBCs that are available on the market have horrible power consumption, especially @ idle, and AFAIK they don’t have suspend/sleep mode. So basically any of the current widespread MCUs has:
      — Much lower & predicable power consumption that depends “close to linearly” on the cpu clock;
      — Much lower sleep power consumption.

      And the MCUs are cheap and available (for now!), compared to those f…king expensive SBCs.

  2. “Applications” are interpreted/webassembly, inside a sandbox. Seems like far too much for embedded/constrained target.

  3. Building on the Arduino core and FreeRTOS, as Chris points out, looks like the pragmatic choice rather than a flaw: the Wi-Fi stack, PSRAM handling and drivers come for free, and the effort goes into the shell and the app model. If the .esp apps really run as sandboxed WebAssembly, as Orzel says, that would explain the PSRAM requirement, and it’s a reasonable trade: a crashing app can’t take the system down, and apps install over the network without reflashing. A safe-mode boot that skips installed apps would still be handy for a board left running unattended.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.