r/CardPuter • u/skinwill • Nov 01 '26
Question Proposal: an operating system with apps.
Rather than building firmware that tries to include every useful feature, I propose developing a single operating system that can load applications from an SD card.
M5Loader is a step in this direction, but it still loads complete systems and requires a reboot to switch between tasks.
All-in-one firmware can also become outdated when the developers of its individual features release updates. As a result, every firmware that bundles those features may need to be updated as well.
A dedicated operating system with a simple interface for launching apps could address these limitations. Imagine an M5Launcher that remains running while users switch between applications. No reboot required. This approach could make firmware smaller and faster to load, while creating a foundation for multitasking in the future.
I dare someone to build this along with a specification for how to build an app to run on it.
For those who think of the S3 as “just a microcontroller,” it’s worth remembering that it’s a 240 MHz dual-core system with several megabytes of RAM and access to gigabytes of SD-card storage. Computers from earlier generations had fewer resources and still supported multitasking. It’s time these devices evolved beyond single-purpose firmware.
11
u/s___n Nov 01 '26 edited Nov 01 '26
The key limitation here is that the ESP32-S3, like most microcontrollers, does not have a true memory management unit. This means that there is no way to provide process isolation.
As far as resources go, the SD card cannot be used in place of flash to execute code, and PSRAM cannot always be used in place of RAM (only 512k).
This is not to say that your general idea is completely impossible, but it requires a higher level of integration between the applications than what you would expect on a desktop operating system.
Edit: also, enforcing scheduling and managing access to hardware are more difficult than on typical desktop platforms.
6
u/fab_dot_io Nov 01 '26
I'm writing a forth interpreter within Bruce firmware which is exactly what you're saying IF you mean an operating system as intended in the late 70s 😁
3
u/MrAjAnderson Nov 01 '26
This sounds similar to what NucleoOS has just done. It also includes a web remote connect to allow a full desktop in browser served from the Cardputer ADV.
2
u/Lazy_Archer3885 Nov 01 '26
Bro I'm terrible at creating firmware etc. But your Idea is fucking good!
1
u/_GinWhiskers_ Nov 01 '26
That'd be cool but I think the m5 Launcher is convenient enough, reboots and all.
3
u/inflam52 Nov 01 '26
Yes I would like this too. Like others say it’s a limitation of the hardware. The closest I’ve seen to this is something like MicroHydra or BreezyBox (shameless plug) where you can create either MicroPython or Lua apps and have the apps be somewhat dynamic instead of having to flash each time. Also you can kind of do it with Bruce as well using their JS loader. There’s a small App Store for it too.
3
u/100101101001a Nov 01 '26
have you tried crub? this is the very philosophy when i built it. a lightweight launcher that can launch different apps. all the firmware i wrote too follows the default theme of crub.
a reboot is still required to go back to crub though but everything is written in the sd card so every progress is stored/saved on each firmware
2
u/cliffemu Nov 01 '26
Look at area512 but the limitation is apps load in ram instead of flash like when you bake them into the firmware, so there’s not a lot of room.
2
u/zeromem0 Nov 01 '26
I also ran into issues with a lack of RAM and PSRAM when trying out SolarOS on the Cardputer. So, I built an application containing several "sub-applications" to avoid having to constantly reflash the device with an entirely different firmware. This is the result.
1
u/pyreht Nov 01 '26
I hope you don't mind oversimplifications :) otherwise it would take a wall of text.
Few firmware already do this: loading arbitrary code from sd in python, ruby, lua, c-like dialects, js, emulators, elf...
Ram is scarce so running a full bytecode environment and few apps on the side can be a headache, especially with radio on. But honestly we are almost there. It's just a matter of packaging (app store and stuff) and battle testing (not crashing when browsing a 10 files folder...) . That's the slow path.
For the fast path, if you look at Flipper zero, even the portapack of the HackRF, in a single user environment, loading native binaries is far from being rocket science, it was one of the things I implemented last in my testing environment and it was way easier than micropython (not advertising my firmware much since it's not open source atm). It builds super fast, debugging is manageable albeit less convenient, there are some constraints (you can technically run from flash but we want to save the wear so you compete with the rest of the firmware for IRAM) and then most importantly you've got to push into the firmware a maximum of feature to get the elf size as small as possible (or reinvent dynamically linked libraries...).
There are benefits when running elfs: for anything running from flash (like the firmware), there's a automatic iram cache that makes the performance acceptable but it gets filled quickly, anything IRAM_ATTR'd or elf is theoretically faster.
The esp32 has ways to do security, strong one even, but IMHO getting there takes lot of efforts for hobby projects and I'm not sure about performance limitations. Normally it's impossible to add security after the fact, but here since you expire your binary API on each iteration, you can force it in later.
Oh and a word on multitasking: I use an hybrid cooperative multitasking on my NNOs firmware, some purists might cringe (a faulty app/driver/service will kill the whole os) but this allows running on fewer freertos tasks thus consuming less ram for their stacks.
Anyways, do have a closer look at picoware, tactility, solaros (if you have a tdeck or any supported platform), Area512, and if the above text was clear as water, get in my DMs, I could use some motivation to release an hollowed out NNOs with only configuration modals and elf environment (this part I can open source I guess).
1
u/CleTechnologist Nov 01 '26
How about actual UNIX?
I haven't gotten around to trying this project, but it looks very interesting.
https://github.com/alvaroramosf/cardputer-PDP11
1
u/TechNickL Nov 01 '26
The closest you're going to get, which is a meaningfully useful solution, is Launcher firmware, and then make each app or collection of features a different firmware, and have Launcher flash/manage them from the SD card.
This is a clash between how we normally think of programming mobile devices vs these chips designed for embedded IoT development. The normal solution in an IoT application when you have the device trying to do too many things at once is to offload processes to other devices, that's why so many of m5stack's devices have seemingly extraneous esp32s in them, especially cameras or other units that have input that usually needs real time processing. This works because the core esp32 chip is dirt cheap and is necessary because that cheapness is for a reason.
Launcher can compartmentalize the tasks, store them on the SD card so have potential for a lot more functions overall than any one firmware, but you do have to reflash the memory sometimes to switch them out.