News for hackers. Stuff that matters.
Re:List of Open Source Real-Time Operating Systems by bo1024 on Saturday February 09, 2019 @07:46AM (#19121996)
For others who didn't know what a RTOS was:

https://en.wikipedia.org/wiki/Real-time_operating_system

Re:List of Open Source Real-Time Operating Systems by travisgriggs on Saturday February 09, 2019 @01:11AM (#19121056)
Love this page. After wanting to try something other than FreeRTOS, and having been frustrated with very public projects RIOT and Zephyr, I found TNEO from this page and have used it successfully in multiple gadgets. Still very happy with it.
Re:List of Open Source Real-Time Operating Systems by pantalaimon on Saturday February 09, 2019 @10:31AM (#19122735)
What have been your problems with RIOT and Zephyr?

I'm currently evaluating what to use for the next project, any insight would be good.

Re:List of Open Source Real-Time Operating Systems by peter_retief on Saturday February 09, 2019 @01:41AM (#19121114)
Interesting, I am looking at Zephyr for BLE devices, so you say TNEO is a good option?
Re:List of Open Source Real-Time Operating Systems by makarhum on Saturday February 09, 2019 @08:06AM (#19122058)
Comparing Zephyr and TNEO is like comparing apples and oranges. Zephyr is full fledged operating system with networking etc while TNEO is more like basic building blocks of os for those who want to implement everything themselves.

I can warmly recommend Zephyr for BLE usage. It is up to date with recent bt specs and implementation is really solid.

Re:List of Open Source Real-Time Operating Systems by peter_retief on Saturday February 09, 2019 @08:53AM (#19122255)
Thanks, I had no idea how many options there are
Re:List of Open Source Real-Time Operating Systems by equalunique on Sunday February 10, 2019 @11:31AM (#19128413)
One of the listed ones, ChibiOS, is in the QMK firmware I use on my custom mechanical keyboards: https://docs.qmk.fm/#/
Re:List of Open Source Real-Time Operating Systems by rambojazz on Saturday February 09, 2019 @01:56AM (#19121141)
Can Linux itself be compiled/built as a realtime OS? I mean without adding additional software or hacking.
Re:List of Open Source Real-Time Operating Systems by snvzz on Saturday February 09, 2019 @07:45AM (#19121994)
The short answer is NO.

The long answer is that there's patchsets like linux-rt which give it better "soft realtime" behaviour, but no hard realtime (deadline guarantees), thus not actual realtime.

Linux-rt allows "coexistence" with "hard realtime", but it's basically a cop-out: Just reserve a processor to run something else than Linux for hard realtime tasks.

In reality, while linux-rt patchset (not mainline) suffices for most pro audio work, Linux has over a million LoC of trusted code base running in supervisor mode; It should not go anywhere near where anything requiring any kind of assurance is running. This happens to be the case with tasks requiring hard (i.e. actual) realtime, as hard realtime is all about guarantees.

My advice for hard realtime would be to look at seL4 and eChronos, both open source as per OSI definition, and pick the one best suited to your design.

Re:List of Open Source Real-Time Operating Systems by tyingq on Saturday February 09, 2019 @09:23AM (#19122394)
For some use cases, a Beaglebone black can allow for "real" real time while running Linux. It has two microcontrollers (PRU) that share memory with the main ARM cores. So if the real time part can be satisfied by the PRU, it's a neat solution.
Re:List of Open Source Real-Time Operating Systems by snvzz on Saturday February 09, 2019 @09:32AM (#19122432)
Same idea as linux-rt "hard realtime": Reserve a processor (doesn't matter if it's the same chip or architecture or not).

The issue with this is precisely the shared memory. If Linux can interfere with the PRU, then there's no assurance. This breaks hard realtime: No assurance that the system will react timely in a certain way to a certain event.

Re:List of Open Source Real-Time Operating Systems by tyingq on Saturday February 09, 2019 @09:41AM (#19122484)
It does work well enough to, for example, drive large LED display boards, emulate old video cards, processing audio, etc. Things that don't work well with traditional soft rt-linux. I'm sure, as you say, that it isn't good for all use cases.
Re:List of Open Source Real-Time Operating Systems by snvzz on Saturday February 09, 2019 @09:57AM (#19122571)
Yes, it has its uses but ultimately it is not hard realtime.

Hard realtime is all about guaranteeing deadlines. If Linux (which is not and will never be high assurance due to its TCB size) can interfere with guaranteeing deadlines, then it's only soft realtime.

Re:List of Open Source Real-Time Operating Systems by gmueckl on Saturday February 09, 2019 @02:20AM (#19121178)
There are patchsets out there that add realtime capabilities to the kernel. But as far as I know none of them is in the mainline. I am also not confident that the kernel can be made truly hard realtime capable without major rewrites. The best bet is probably RTLinux which runs the entire Linux kernel as one of the processes managed by a hard realtime kernel.
Re:List of Open Source Real-Time Operating Systems by snvzz on Saturday February 09, 2019 @08:31AM (#19122146)
Linux isolated through virtualization under a microkernel is the way to go if running Linux in the same hardware is actually needed at all. The realtime tasks would simply run outside of Linux, shielded from Linux.

Genode's virtualization (particularly when paired with the excellent seL4 microkernel) is a good way to achieve that.

If Linux can interfere with the "hard realtime" task, then there can be no assurance (of meeting hard deadlines) and it's thus not a solution providing hard realtime.

Re:List of Open Source Real-Time Operating Systems by magnat on Saturday February 09, 2019 @02:27AM (#19121194)
Without any changes, you have SCHED_FIFO and SCHED_RR [1] schedulers, but despite the name, they are not really suitable for proper real-time tasks. Closest to real time on vanilla Linux is SCHED_FIFO task - as long as there is no other task with same or greater priority, your task don't yield, call syscalls or cause page fault, it won't be preempted. When it does yield (one way or the other), there are no guarantees when it's going to be rescheduled, which is severely limiting for considering it as RT.

[1] http://man7.org/linux/man-pages/man7/sched.7.html

Re:List of Open Source Real-Time Operating Systems by pjmlp on Saturday February 09, 2019 @02:33AM (#19121204)
Not at all, at it does not meet the realtime certifications for deployment into production, like for example ISO 26262.

https://en.wikipedia.org/wiki/ISO_26262

https://www.highintegritysystems.com/

Re:List of Open Source Real-Time Operating Systems by sedachv on Saturday February 09, 2019 @12:47PM (#19123560)
One of the reasons why Linux is not suitable for real-time use is virtual memory. It's not even about swapping. The Translation Lookaside Buffer introduces too much variance into timing. Same thing with instruction and data caches and even instruction pipelining. It's not just Linux, but most general-purpose CPUs that are not suited for real-time control applications.
Re:List of Open Source Real-Time Operating Systems by alxlaz on Saturday February 09, 2019 @05:34AM (#19121686)
There is a patchset that enables deterministic behaviour on Linux (https://www.linux.com/news/event/elce/2017/2/inside-real-tim... has a few pointers). Much of it has been mainlined, and it does have trustworthy enough commercial backing that it's worth considering at least.

That being said, the more typical approach for this, as employed by e.g. RTLinux ( http://www.rtlinux.org/ -- I'm not endorsing it, it's just the one I'm more familiar with), is to run a hard RTOS along with Linux, running real-time tasks on the RTOS and everything else on Linux. It's a more complex solution, and it's a little unsettling that we've even had to come up with it, but it works surprisingly well. Writing fancy UIs and multimedia applications on top of things like QNX is difficult (not necessarily in terms of learning/development effort, but also in terms of licensing, cost, hardware support etc.), while writing real-time control applications on a patched Linux kernel requires some trips down the kernel rabbit holes, and is hard to get through some certification processes. Companies optimize for whatever they need :).

Re:List of Open Source Real-Time Operating Systems by javert on Saturday February 09, 2019 @03:21AM (#19121319)
Absolutely.

https://rt.wiki.kernel.org/index.php/Main_Page

This is the wiki for the PREEMPT_RT patchset. Parts of this have been moving into mainline for years, bringing the regular kernel closer and closer to real-time. However, there are some real-time features that will never be appropriate for mainline, so you can get them through this patchset. Some of the "famous" kernel devs are also very active in PREEMPT-RT; it's as official as you can get short of being in the mainline kernel.

For lots of uses, the regular kernel is already realtime enough.

Re:List of Open Source Real-Time Operating Systems by zozbot123 on Saturday February 09, 2019 @09:33AM (#19122444)
AIUI the plan is to merge the patchset itself into mainline to ease the maintenance burden, but to keep the changes that don't actually make sense for mainstream server use under a special config/#define flag, PREEMPT_RT_FULL or similar. It will then be up to users/distributors whether to enable it. I've only tried the current patchset casually, but IME, the throughput penalty is there but is barely perceptible for casual use, and the improved responsiveness due to kernel thread preemption and the priority inversion fix do make the system a lot more usable especially under load.
Re:List of Open Source Real-Time Operating Systems by pantalaimon on Saturday February 09, 2019 @02:05PM (#19123972)
It's currently not possible to compile Linux to something that works with 64k RAM and similar amounts of flash like what you usually would find on a MCU.
Re:List of Open Source Real-Time Operating Systems by magnetic on Saturday February 09, 2019 @07:10PM (#19125558)
The first entry FreeRTOS shows MIT as license, but says it's distributed as GPL in the description. I don't know where they got the GPL part from: it's not mentioned anywhere at https://www.freertos.org/a00114.html
Re:List of Open Source Real-Time Operating Systems by tesseract on Saturday February 09, 2019 @11:33PM (#19126379)
FreeRTOS used to be dual-licensed GPL (with an LGPL-esque linking exception) and commercial. Amazon acquired the copyright in 2017 and relicensed FreeRTOS under the MIT license.
Re:List of Open Source Real-Time Operating Systems by kqr2 on Saturday February 09, 2019 @09:47PM (#19126101)
From https://aws.amazon.com/freertos/pricing/ :

The Amazon FreeRTOS operating system and software libraries are released under the MIT open source license, a permissive license with limited restrictions on reuse.

Re:List of Open Source Real-Time Operating Systems by stephen_g on Saturday February 09, 2019 @04:21AM (#19121485)
Nice, I didn’t know about a lot of these. We’ve used ChibiOS in a few of our products, it’s really great.
Re:List of Open Source Real-Time Operating Systems by rurban on Sunday February 10, 2019 @05:26AM (#19127201)
So many of the best are missing. Eg from the L4 family with widest adoption and best HW support only the smallest SeL4 is present, but not OKL4, L4Re, Fiasco, L4Ka::Pistachio, L4/MIPS, WrmOS, Genode.
Re:List of Open Source Real-Time Operating Systems by BaalZebub on Saturday February 09, 2019 @10:41AM (#19122791)
Isn't TempleOS RTOS?
Re:List of Open Source Real-Time Operating Systems by monocasa on Saturday February 09, 2019 @12:17PM (#19123412)
It's too bad you're being downvoted. It's a legitimate question.

Looking at the source, a case could be made either way IMO. On one hand the scheduler doesn't have priorities, but on the other, you have to explicitly pin tasks to cores so you could actually guarantee real time behavior pretty easily on a fixed platform...

Re:List of Open Source Real-Time Operating Systems by jhallenworld on Saturday February 09, 2019 @11:13AM (#19123009)
Is TI-RTOS really not in development? It's the OS TI gives you when you download their tools.

TI is weird, they have their own C compiler.

Re:List of Open Source Real-Time Operating Systems by applesvsoranges on Saturday February 09, 2019 @01:46PM (#19123868)
Yeah. I used TI-RTOS a couple of years ago for some work and the whole experience was very different. The most unique part was that the RTOS came bundled with a development GUI integrated into the IDE where you could create threads, mailboxes and other such RTOS primitives. I don't think I liked using it very much though.

Surprised to see that they killed the project.

Re:List of Open Source Real-Time Operating Systems by monocasa on Saturday February 09, 2019 @11:24AM (#19123075)
What was the licence? Did you have to run it on TI parts or something?
Re:List of Open Source Real-Time Operating Systems by jhallenworld on Saturday February 09, 2019 @11:28AM (#19123103)
BSD license according to this: http://www.ti.com/tool/TI-RTOS-MCU#descriptionArea

It does compile with gcc, but I don't trust it with gcc. At least with TIVA TM4C processors, it would not boot. I suspect they don't test with gcc as well as with their own compiler.

Re:List of Open Source Real-Time Operating Systems by anta40 on Sunday February 10, 2019 @08:58AM (#19127770)
I want to study OS dev. Linux seems to be pretty complicated. Which one from the list do you folks recommend to study?
Re:List of Open Source Real-Time Operating Systems by snvzz on Saturday February 09, 2019 @07:48AM (#19122003)
What's the criteria the list is sorted by? It seems completely arbitrary or unsorted from a glance.
Re:List of Open Source Real-Time Operating Systems by jhallenworld on Saturday February 09, 2019 @11:25AM (#19123082)
One way to deal with the many available operating systems is to use OSAL. It's an abstraction layer for embedded OS (and POSIX). Admittedly I have mixed feelings about it since it creates work when debugging in a new OS: you need to trace which OS call OSAL is using.
Re:List of Open Source Real-Time Operating Systems by pantalaimon on Saturday February 09, 2019 @02:03PM (#19123960)
But the RTOS is already an abstraction layer around the hardware, how would adding another abstraction possibly help?

It's not like you often find yourself in the situation where you want to run the same application on multiple RTOSes, it's usually way too specific to the device.

Re:List of Open Source Real-Time Operating Systems by naasking on Saturday February 09, 2019 @03:08PM (#19124299)
> It's not like you often find yourself in the situation where you want to run the same application on multiple RTOSes, it's usually way too specific to the device

Perhaps that's the point: make your program more portable across different hardware that may only support specific OSes.

Re:List of Open Source Real-Time Operating Systems by noselasd on Sunday February 10, 2019 @08:02AM (#19127618)
OSAL is written by NASA which do have that situation - NASA have systems they want to run on both Vxworks and RTEMS.
Re:List of Open Source Real-Time Operating Systems by gjsman-1000 on Saturday February 09, 2019 @12:01PM (#19123311)
Where is ThreadX? (ThreadX runs on the RPi GPU cores)
Re:List of Open Source Real-Time Operating Systems by tw04 on Saturday February 09, 2019 @12:02PM (#19123320)
ThreadX isn't open source.
Re:List of Open Source Real-Time Operating Systems by scottlocklin on Saturday February 09, 2019 @02:22PM (#19124050)
I'd be curious how many of these actually provide real time guarantees the way QNX or VxWorks does. I think quite a few of them may simply be "embedded OS" rather than RTOS.