Solved

Advantage of an operating system for embedded systems

Posted on 2011-03-09
8
911 Views
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.

Thanks.
0
Comment
Question by:JohnSantaFe
  • 3
  • 3
  • 2
8 Comments
 
LVL 6

Expert Comment

by:LeeeRussell
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:

http://www.amazon.co.uk/C-OS-III-Real-Time-Kernel/dp/0982337531/ref=sr_1_1?ie=UTF8&s=books&qid=1299750932&sr=8-1-spell

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.
0
 
LVL 12

Expert Comment

by:HappyCactus
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.
0
 

Author Comment

by:JohnSantaFe
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?
0
 
LVL 12

Assisted Solution

by:HappyCactus
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Accepted Solution

by:
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.

Advantages:

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.

Disadvantages:

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.
0
 
LVL 12

Expert Comment

by:HappyCactus
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.
0
 
LVL 6

Expert Comment

by:LeeeRussell
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.
0
 

Author Closing Comment

by:JohnSantaFe
ID: 35110623
Thanks for the responses!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now