Advantage of an operating system for embedded systems

Posted on 2011-03-09
Last Modified: 2013-11-14
I'm doing a fair amount of embedded application development lately.  I keep running into the argument of whether or not an operating system is necessary.
Usually it's the electrical engineers that like bare C and like to directly access a processor's registers, whereas the application developers seem to like having an OS to abstract the hardware.

Does anyone have an opinion or a  good reference on the advantages of using an OS?

I know "it depends" on a lot of factors so let's assume that the embedded system could be programmed with or without an operating system.  I realize there are many times an OS is absolutely required and some very simple microcontroller environments where an OS is not possible.

Question by:JohnSantaFe
  • 3
  • 3
  • 2

Expert Comment

ID: 35093331
I can see that your question tries to mitigate against this answer, but unfortunately it really does depend on a lot of factors.

Also, there's almost always room for an OS, it just depends which OS you want.  For instance the micro-C OS will fit most places, and also I think the book that describes this operating system is one of the best resources for learning about embedded OSes:

Unfortunately, I think it has to depend on the type of project your developing.  An operating system can help when you have a lot of developers, or if you need lots of higher level functions and don't want to write loads of drivers.  An operating system doesn't mean sacrificing access to the processors registers.  But you don't want an operating system on a microprocessor that controls a thermostat - although it will probably have a round robin OS in it somewhere, it then depends on what you call on OS.

With time you'll learn how to assess the need for an OS at the start of every project.
LVL 12

Expert Comment

ID: 35094798
Start from the definition of "operating system" and try to see if you need the functions it provides.
More generally, if you need to manage in a "standard way" some resource - like memory, I/O, or process space - you need an operating system.
If your application is sufficiently simple that you can manage these resources by yourself, inside your own application, you do not need an OS.
But sometime this boundary is very fuzzy - can a memory allocation system be considered an OS? Maybe.

Author Comment

ID: 35096711
Thanks for the replies so far.
I intended this to be worth more points than 50 so I just increased it.

Anyone have a good list of advantages and/or disadvantages?
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 12

Assisted Solution

HappyCactus earned 250 total points
ID: 35106586
There are two disadvantages, in my opinion: first, you need some more resources needed (memory and processing), second, you sometime can't optimize the code (in terms of size and time) as you could with a simple "program" without the OS.
But it strongly depends on what is the OS you use, there are some microkernel that are very lightweight.
If your application isn't very simple, you'll better choose to use an O/S.

Accepted Solution

LeeeRussell earned 250 total points
ID: 35106590
OK, I'll try and give you a list of advantages and disadvantages, but you have to remember that embedded operating systems are available to fit on a wide variety of processors.  I've worked on embedded systems with an OS on tiny processors with 8-bit architecture and miniscule RAM through systems that are more like a 64-bit desktop computer running a Real-Time Linux OS.  This will also play a part in deciding if you should use an embedded OS.


Using an OS will give you a known architecture and will probably make it easier for more developers to contribute.
As stated by HappyCactus and myself, using an OS will mean you won't have to write drivers and code for common functionality (e.g. networks, graphics, etc.).
An OS will offer a level of robustness as you can have some faith that the code in the OS will have been thoroughly tested in an established OS.
A proprietory OS will hopefully offer you a level of security that would take a lot of time to code yourself.
It is not always a good thing to let developers have the power that comes with access to the registers.  Bugs introduced down there can be incredibly difficult to find.


An OS will have some kind of cost - either in learning and training in how to use it properly or an actually money cost in the case of a proprietory OS.
An OS is overkill for a lot of very simple embedded systems (e.g. a thermostat, a timer on a power supply).
Some embedded software developers don't like being constrained by an OS.
LVL 12

Expert Comment

ID: 35106630
LeeeRussell, I would remark that sometimes - my personal experience - the time spent in learning the "new" operating system is balanced by the time on rewriting drivers, subsystems and services. For example, a customer of mine didn't want to use an OS because that seems an overkill. We spent all the time debugging uart, i2c and libraries related code, that with the O/S we should have for free...
Obviously, this is my, very personal, experience.
About proprietary OS, they haven't any advantage against "open" OS other than the technical support, that is a very good point.

Expert Comment

ID: 35107399
Yeah, I think I'd probably go with your personal experience, and the point I was trying to make is that an OS is unnecessary in a system where you are reading one pin on a microprocessor, and then using that input to simply drive another pin.

You can, of course, just use libraries for things like uart, i2c and not the full OS if you can find them for your particular processor.

Author Closing Comment

ID: 35110623
Thanks for the responses!

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question