Wind River, one of the world’s top embedded software providers, has acquired a real-time Linux distribution and patented hard-real-time technology from FSMLabs Inc. The acquisition will help Wind River penetrate new and emerging markets requiring extremely tight timing constraints, including the vast, emerging market for low-cost, single-core feature phones, according to the company.
Wind River Acquires Patented Real-Time Linux Technology
2007-02-20 Linux 6 Comments
Basically, RTLinux is a more-or-less stock Linux kernel running on top of a specialized microkernel called RTCore. RTCore traps hardware interrupts, queuing and/or reordering them before passing them up to the Linux kernel. Linux doesn’t realize it’s not receiving hardware interrupts directly from the hardware.
This is necessary because Linux doesn’t implement the concept of interrupt priorities or nested interrupts. All hardware interrupts are treated equally, and interrupt handlers cannot be preempted by another interrupt. They are handled in the order in which they are received from the hardware interrupt controller, with no exceptions. This is a design consideration to accommodate several supported architectures that do not implement these concepts, x86 included.
If Linux handles interrupts on a first come first serve basis, then the only way to enforce various possibly dynamic interrupt priorities is by altering the order in which they “come.” And since an interrupt will always preempt the running process, the only way to let an ultra-important process finish is to delay the arrival of the interrupt. This is what RTCore does. It can’t make Linux support nested interrupts, but it can do everything else.
If RTLinux is in the red corner, Montavista is in the blue corner. Montavista solves the aforementioned issues directly within Linux. In other words, it supports interrupt priorities and nested interrupts whenever the hardware does. The modifications to the process management subsystem are relatively straightforward. Making the interrupt handlers for every driver in the Linux kernel reentrant–that is, safe to be preempted by a higher-priority interrupt–is not so easy. Sometimes an interrupt handler will have to block all interrupts during a critical section, but the ability to preempt interrupts at all is better than just reordering and delaying interrupts. Theoretically, Montavista’s solution is superior to RTLinux. But it isn’t patented. Sort of like that cancer drug.
Both implementations trade a huge amount of efficiency for this real-time response. Every few microseconds they get a clock interrupt from the hardware and run a dispatch routine, RTCore possibly dispatching an interrupt to Linux, and Montavista possibly dispatching a different task. These are usually constant-time, or O(1), operations, but they consume at least a hundred nanoseconds, probably more. In addition, when the dispatcher decides to actually dispatch something, the algorithm becomes O(N) at best. That takes a sizable chunk out of each 5 microsecond clock tick. You don’t get much work done on a real-time system, but you get it done almost exactly when you want it to be done.
Edited 2007-02-20 08:14