Advantage of an operating system for embedded systems

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.

Who is Participating?
LeeeRussellConnect With a Mentor Commented:
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.
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.
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.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

JohnSantaFeAuthor Commented:
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?
HappyCactusConnect With a Mentor Commented:
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.
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.
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.
JohnSantaFeAuthor Commented:
Thanks for the responses!
All Courses

From novice to tech pro — start learning today.