Operating Systems for Embedded Systems

We have several choices while writing software for an embedded system

  • Use a desktop operating system - Linux, Windows
  • Use a modified desktop operating system - Embedded Linux, Real Time Linux, Embedded XP
  • Use a hand held operating system - Windows CE, Symbian
  • Use a closed source commercial real time operating system - VxWorks, QNX
  • Use an open source commercial operating system- Micrius uCos
  • Use a free, open source real time operating system - FreeRTOS
  • No OS. Do not use a formal off the shelf operating system

Depending on your application, one of these will be more suited to your situation. Here we will try and go through some pros and cons of each that we have considered.

The tradeoffs are

- Development cost versus production cost- Power consumption- Stability- Real Time Requirements

Operating System Features

An operating system, no matter what type it is, provides an Hardware Abstraction Layer (HAL).

An operating system also implements common programming abstractions - tasks, schedulers, semaphores and mutexes.

An operating system also commonly provides communications and file system stacks. An operating system may have for example support TCP/IP stack, USB stack or FAT file system stack.

Tradeoffs - Real Time Requirements

Many systems have hard real time requirements. For example you are controlling a motor.

A rule of thumb that we have found useful is - Do not use an unmodified desktop operating system where the real time requirements are less than 1 ms

You can get latencies lower than 1 ms by using a modified desktop operating system. These modifications are usually done by having a real time operating system layer below the general operating system or by writing special kernel drivers.

If you want to use a desktop operating system and have hard real time requirements you may find it useful to handle the low latency real time requirements using a separate piece of hardware. The kind of hardware that you would use would depend on the kind of real time requirements that you have. If you have latency requirements more than microseconds a microcontoroller will do the trick. For latency requirements below microseconds custom hardware either in the form of Programmable Logic Devices or FPGAs is usually best.

Of course, if you have two processors the unit production cost goes up. So what we have done here is traded development cost versus production cost. Depending on your expected volume of production you may not want to do this.