Linux Wins - Or Does It? -

Linux Wins – Or Does It?


RTOSes are dying, Linux is in. Or is it?

At the recent RTECC conference Jim Ready, founder of Montavista (which has been part of fast-growing but profit-challenged Cavium since 2009 ) claimed that there really isn’t much need for RTOSes anymore, as Linux can be used instead.

Ironically, Jim created VRTX, one of the very first commercial real-time operating systems back in 1980. Not a week goes by that I don’t hear a similar statement from some pundit, or get email from an engineer wondering if sticking with an RTOS is a bad idea in view of Linux’s many virtues.

Apart from the whole hard- or soft-real-time debate, there are a lot of reasons why Linux will always be a non-starter for huge classes of embedded systems. One of those reasons is that it just does not work in the limited address spaces of microcontrollers, and MCUs are not going away. In fact, they are proliferating as never before.

A quick look at Atmel’s site reveals 258 variants of their immensely popular AVR line. That’s in addition to the 51 kinds of 8051s they sell. Microchip has over 650 microcontrollers, a number that seems to balloon constantly. Freescale packs about 175 eight and 16 bit MCUs into their line card. Plenty of other vendors supply proprietary-architecture controllers.

Then there’s ARM.

NXP offers about 140 different microcontrollers using Cortex-M series cores. NXP has about 200. TI pushes around 400. Dozens of other vendors offer ARM-based microcontrollers. No doubt there are over 1000 MCUs that use the Cortex-M-series processor.

Why focus on the M series? Linux will never run on these parts. The vast majority of them are used in applications that run from on-board memory, which never exceeds a few hundred KB.

To a non-embedded person acquainted with Intel’s never-ending pursuit of performance the Cortex-M family would seem an anachronism, a step back into the era of scarce CPU cycles. But that person would be astounded to learn of the computer in his toothbrush  or the millions of transistors used in a programmable thermostat to replace a simple mercury switch. An essential truism of computing is that the race to the top in performance is always matched by a race to the bottom: the bottom in price, power and in size.

But the real-time debate is important as well. At the most recent ESC the nice folks at Petalogix demonstrated Linux running on one core in a Xilinix FPGA and FreeRTOS in another. I was struck by the following performance graph produced by one of their tools:

Click on image to enlarge.

(Chart courtesy of Petalogix)

Interrupt latency is, in some systems, hugely important. (If you are thinking about Linux-ing an FPGA, do check out their tools at ).

The truth is that in the world of embedded systems applications range from electric toothbrushes and greeting cards to massive weapon systems. Linux is well-suited for some of these; a traditional RTOS is the right choice for others. We engineers benefit from having both in our toolbox.

Jack G. Ganssle is a lecturer and consultant on embedded development issues. He conducts seminars on embedded systems and helps companies with their embedded challenges. Contact him at . His website is .

7 thoughts on “Linux Wins – Or Does It?

  1. You can't run Linux on a 16K Flash/16K SRAM uC. Period. End of discussion.

    That said you can't run an RTOS on a 4K Flash/4K SRAM uC (well maybe a small bare bones one, but not FREE RTOS). So There is also a niche still for the good old super loop. But ju

    Log in to Reply
  2. Obviously the hardware capability at any given price point is ever increasing. Therefore, the set of platforms capable of running a high-end memory-protected OS is always growing, and Linux seems to be winning among such OSes due to its flexibility and hug

    Log in to Reply
  3. If I am needing a very fast RTOS for a very limited piece of hardware I write it from scratch in assembler. And, yes, it is basically a while(1). If I need a file system, networking, and a GUI it's Embedded Linux.

    Log in to Reply
  4. Xilinix? I thinks it's Xilinx.
    Two problems with the latency graph. First a field-programmable gate array (FPGA) is designed to be configured by a customer so it may have been specifically tailored to work with FreeRTOS. Second was this a real time patched

    Log in to Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.