Hacker News new | ask | show | jobs
by realharo 2236 days ago
How are things on the commonly used RTOSes? I'm not really into hardware much, only fairly recently learned basic electronics as a hobby, but I've seen ARM push their "mbed" (https://os.mbed.com/) thing in many places recently (most recently saw their logo printed on a nRF52 BLE dev kit). I've also seen Amazon get more involved with (in charge of?) FreeRTOS (https://aws.amazon.com/freertos/) quite some time ago.

Don't such things solve most of these issues?

2 comments

The RTOS world is much less of an 'operating system' and more so a bare-bones task scheduler. It's not like a POSIX environment at all.
Right, but doesn't it also provide some very basic level of abstraction that things like network stack implementations can target? And then many projects also come with their "standard" (not bundled, just designed for) set of basic libraries? That's the impression I'm getting from skimming through the docs. (https://docs.zephyrproject.org/latest/guides/networking/net-..., https://www.mbed.com/en/technologies/security/mbed-tls/, https://docs.aws.amazon.com/freertos/latest/userguide/freert..., etc.)
You are correct.
that's not really true anymore. it may apply to things like pharlap or vsworks, but there are more modern options that give you a nice real-time linux environment.

https://access.redhat.com/documentation/en-us/red_hat_enterp...

https://www.ni.com/en-us/innovations/white-papers/13/introdu...

Linux with RT patches isn’t exactly RTOS, it’s Linux with such patches.
how is it not an RTOS?

and national instruments and red hat are both large companies that would seem to disagree with you. national instruments has completely replaced pharlap and vxworks in their newer products with their linux real-time OS, so them and their users writing real-time applications would also disagree with you.

See how Red Hat words it? “Red Hat Enterprise Linux for Real Time” not “RHEL RTOS” as if they don’t think Linux is technically not an RTOS. Or maybe they do think that way.

And see that chart down that page? Shows RHEL for RT achieve 3.5 to 85uS variance. I don’t know what application needs it but 80uS is 24km at the speed of light.

LabVIEW is NI’s bread and butter and LabVIEW connects to peripherals via cables and buses. NI not opting for conventional RTOS just means that 80uS errors are probably good enough for their usage.

RTOS also often refers to specific group of lightweight OS and libraries more so than capabilities. People want small no-bullshit runtime, not always a precision scheduler. From that point of view, Linux is just a bloatware towards extreme side so don’t qualify as one.

Overall, no, I still don’t think Linux is RTOS, I don’t think Red Hat says it is, and I think NI just don’t care.

I wonder what's your use case for RTOS? I don't really know any problems that couldn't be solved with micros communicating with linux. Seems like even SpaceX gets away with it.

I mean there seem to be the market so clearly there are some people who need it, I just would like to learn more about where is it really needed.

SpaceX uses FreeRTOS and VxWorks for chips that need hard real time guarantees from what I've heard.
It's not that the problems couldn't be solved that way, it's that they don't necessarily get any simpler. Adding an external micro and all the support it needs is added cost, maybe added real estate, power budget and very often, it makes the solution more complex and less reliable.
RTOS are mainly for micros communicating with Linux.

Lots of time they are just a giant C library that goes into the same a.out, that for devs look close enough to let himself pretend there will be an OS running his code.

Stuff powered from a coin cell battery?
From coin cell battery you can power a microcontroller that is sleeping most of the time, not a real-time operating system.
You can do exactly this with an ESP32. It's got an RTOS (FreeRTOS) which will spend most of its time sleeping https://learn.circuit.rocks/esp32-deep-sleep
Debatable. Personally I would not try to do a project that uses wifi on a cell battery. And if you don't need wifi then you have much better options that use low current not only while sleeping (e.g. nrf series)

But my main point which I should have included in the previous reply was - what does real time OS have to do with the project being run from a cell battery?

So my assumptions in the original question a number of comments above (in the context of the comment above it) were:

- something running regular Linux would be too heavy (though I don't know if that's really the case, especially if you only turn it on a few times a day on average for a little bit)

- adding the "OS" abstraction would presumably result in access to higher quality ecosystem of libraries than whatever is available on bare metal directly (as I assume some of those libraries depend on the "OS" for event handling etc.) - which was the complaint in the comment I was replying to

But like I said, I know very little about this area, so if any of this doesn't make sense, just ignore my comment :D