Newbie question- Can I run a linux app on RTOS?

Hi, sorry for asking this uber-newbie question, but how is an RTOS not like a linux OS?

Since microcontrollers do not have MMUs, I know they aren’t user-space compatible. But some things like uclinux can run with Busybox+FLTK in external memory. If RIOT-OS has ipv6, SSL & TCP capabilities, could this be used to run a lite web-browser like https://www.dillo.org?

From what I’ve read, “Linux on the other hand, uses a scheduler, which guarantees a fair distribution of processing time. The programming models in Contiki and TinyOS are based on the event driven model, in a way that all tasks are execute within the same context, although they offer partial multi-threading support.” https://medium.com/@manjunathperiyapatna/riot-os-58cbf1005baf

Also, some work has been done recently on some other RISC-V processors: https://www.cnx-software.com/2020/02/17/how-to-build-run-linux-on-kendryte-k210-risc-v-nommu-processor/

However, I understand from the comments that secure-boot is one of the protections that more PCs use today. Some of the extra security features are mentioned here: https://jaycarlson.net/embedded-linux/

One of the reasons I am interested in RTOS-es is the ability to have custom images loaded from a multi-boot drive like X-boot. Since I’d like the run the RTOS entirely in RAM, analagous to Raspup(Puppy Linux), it would be interesting if I could load an image of a user-space linux OS onto a microcontroller with sufficient RAM, having selected an image a single program- such as LibreWriter. Then if I wanted to use Okular to view PDFs, I’d reboot another image with just Okular. microSDs can store GBs so having 100 images for 100programs would be the easy part. Alternatively, a package manager like http://www.davisr.me/projects/rcu/ could store the apps on the external drive like http://www.davisr.me/projects/remarkable-microsd/. I’m curious as a proof of concept, because I’d like to try building a solar powered laptop based on something like the Apollo3 Blue board, which has been used to run a Gameboy on solar and pressing buttons (similar to regenerative braking on a Prius) https://www.freethegameboy.info/

" No ARM MCUs we are aware of contain on-chip fast, byte-addressable non-volatile memory—such as FRAM—serving as a main memory. Only slow and energy-expensive FLASH memory is present. A fast, byte addressable non-volaitile memory is crucial to enable saving and restoring state in spite of power failures. To enable this, we equipped our battery-free console with an external dedicated FRAM IC. Our choice of MCU was the Ambiq Apollo3 Blue ARM Cortex-M4 operating at a clock frequency of 96 MHz, chosen for its best-in-class energy efficiency."

I am writing about this project here: https://forum.ei2030.org/t/e-ink-low-power-cpu-solar-power-3-sides-of-the-same-lid/82/3 Thanks for reading! Suggestions welcome

I try to answer as many questions as I can.

If RIOT-OS has ipv6, SSL & TCP capabilities, could this be used to run a lite web-browser like https://www.dillo.org ?

Maybe. I am not familiar with this browser, so I can’t say anything about it. We have a lvgl implementation in RIOT. So, you are maybe able to port this browser to the library in order to show the browser on the screen. But there is also the issue with a mouse/keyboard. I don’t think we currently have drivers for that. So, you probably need to write some.

It sounds like you are probably better of with a small linux distro and a more capable CPU than with a Microcontroller. There are some projects which ported Contiki to the C64. With deskop as well. Maybe that is something worth looking at. You probably still have a hard time to get this running. Just my best guess. RIOT isn’t really designed for these kind of use-cases. We are more focused on IoT use-cases like sensors, actuators etc. With little to none GUIs.

1 Like

We live in a world where we can run Doom on oscilloscopes and Kitchen blenders. Then surely you must be able to run a browser on an RTOS such as RIOT. It has all the building blocks required for it. However, browsers that were written with Linux (or Windows) in mind probably have a lot of Linux/Windows dependencies. They use the computer to the fullest. So if you want to run a browser on a microcontroller you will most likely need to make some significant changes.

Interfacing with a PS2 mouse or Keyboard also isn’t really rocket science, so I don’t think that’s the main issue.

But still… even though it’s definitely possible to create this as a proof-of-concept or as a fun experiment, I have to agree with citrullin: if you’re thinking about actual applications then you’d be far better of with an embedded Linux device such as a BeagleBone.

2 Likes

Thank you Wosym, I wasn’t aware of Quake on an oscilloscope, but wow. I was pretty impressed with Contiki running on C64 and saw some QNX desktops, but I agree some of the dependencies may be better on an application processor.

So far I am considering microcontrollers mainly because of their power consumption is at least an order of magnitude less than the most efficient application processors. The Raspberry Pi Zero uses approx 0.7W, which is the most efficient of the RPis (except for Model A). https://www.pidramble.com/wiki/benchmarks/power-consumption

The Apollo3 Blue uses approx 6uA/mhz, and at 96mhz is approximately 576uA (edit: times ? volts=__) https://ambiq.com/apollo3-blue/

The lowest power application chip I’ve found seems to be the CVA6(Ariane) by Parallel Ultra Low Platform (pulp-platform.org) http://parallel.princeton.edu/openpiton/tutorial_slides/isca19/1-openpitonariane-opening.pdf (Page 23) There is a core called Kosmodrom with an Ariane LP that runs at 5mW @ 200Mhz: Ariane LP • 7.5T ULP library, 0.5V, 250 MHz • 5 mW @ 200 MHz

That is just for the chip and not the I/O and memory, but knowing the 22nm process is more power efficient than the Pi Zero, I am guessing that with more advances there may be an application processor in the 10nm node that may be able to at the 6uA/mhz like the Apollo3. Also, I could also use 10x the number of solar panels as on the GameBoy and maybe get similar self-powered capabilities.

While it is a fun experiment, I wouldn’t be surprised to see super low-power motherboards being sold like the Raspberry Pi SoC to build one’s own laptops- one could assemble any variation of display with connectors, which I am also looking into.

At that point your main concern shouldn’t be the CPU. There are very efficient CPUs for this kind of purpose. You can even lower the clock in order to lower the energy usage. Put a big battery into your device, a solar panel on the top and add a connector to your bicycle. And you are kind of fine. The trick for a longer battery life is to shut down the CPU. There are multi core CPU/MCU designs where you basiclly shut down the CPU when it isn’t needed. And the MCU in the SoC is keeping every important peripherial etc. alive. Charging battery etc. this kind of stuff. Also, if you want to use a browser you have to do radio as well. Especially radio over long distances. That is very slow and you probably also get a high package loss. That will drain your battery as well.

1 Like

Well, I meant to say I am considering microcontrollers, but I am intending to use it like a microprocessor. It’s intended more of an always-on device. I use the TI-30Xa Solar as an example evn though it powers off when not in use because the power consumption is less than or equal to the solar panel harvest ability. There are plenty of laptops that use a large battery, but the design intention is to fit as much application capability into a microprocessor without draining more than what the solar panels can produce, and ideally in indoor light. Underclocking the processor is most likely one of the design requirements, although dynamic voltage scaling could be used if the CPU not frequently running at 100% utilization. For a first generation solar laptop, it is intended more of a single app at a time laptop, for light productivity apps- Office\writing\reading and not resource intensive apps like youtube or 3D. Eventually I’d like it to handle GIMP and Firefox. I know it sounds kind of impractical, but it’s more of an exploration to see how far transistors have progressed in terms of their efficiency rather than having a laptop with a long enough battery life, of which there are many options.