Subscribe to EDN

Question of the Week: When does it make sense to use an RTOS or operating system?

March 31, 2010

I posted last week’s question about dynamic memory allocation here and in a group discussion at LinkedIn. There were many thoughtful comments at both locations, with the majority of responses made in the LinkedIn discussion. I’m trying to figure out a way to enable you to see the responses from both groups in one place. If you have any ideas, please let me know.

This week’s question expands on one of the underlying premises behind last week’s question – that the size of the system, real time requirements, and reliability affect your answer to the question. For this week, under what conditions do you use or avoid using an RTOS or operating system in your embedded designs?

Depending on where you draw the line on what constitutes a system, I have built embedded systems with none, one, or even multiple operating systems. In general, the smaller systems relied on an infinite loop construct or a manually built scheduler; these systems often had hard real-time and high reliability requirements. In some of the systems, we used an RTOS most significantly to leverage the communication stack support it offered when the system was in a near-real time operating mode. When the system switched to a hard real-time mode, the control software no longer made any RTOS calls.

The only context we used a full blown operating system was for ground and test support equipment that provided a near-real time, data rich user interface for the human operator and for non-real time post-operational analysis. In these cases, the operating system reduced the complexity for driving application-level processing such as receiving inputs from the operator, displaying messages and data to the operator, and communicating with other remotely located components of the systems.

Based on these projects, the team’s decision to use or avoid using an RTOS correlated strongly with the real time and reliability constraints of the system as well as how intimately the software was coupled to controlling and monitoring the hardware components.

Contemporary processors and RTOS offer coupled resources, such as memory protection units and padded cell virtualization support, which may blur the criteria for when it is appropriate to use or avoid using an RTOS. I’m trying to tease out under what conditions, such as resource limits, reliability requirements, project scheduling, and real-time operating constraints that the trade-offs favor adopting or dropping RTOS support. So when answering this question, please try to identify the key criteria for your application space that pushed your decision one way or the other.

 

To make following the Question of the Week series easier (especially with multiple overlapping series), I am including the index below to previous relevant posts. I will be summarizing your answers for these questions in a paper at the end of the series. I encourage you to check out all of the posts for the question of the week series; maybe they will inspire you to share your observations. I would love to be able to consolidate different perspectives and lessons learned here. I suspect there are some valuable lessons to be gleaned from comparing such stories. If you would like to suggest a question, please contact me.

2010, March 24: Question of the Week: Do you use or allow dynamic memory allocation in your embedded design?

2010, March 17: Question of the Week: You know you’re an embedded developer when …

 

Posted by Robert Cravotta on March 31, 2010 | Comments (10)

April 8, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
du00000001 commented:

I'm working in deep-deep embedded areas (automotive and industrial automation) and would never consider not using an RTOS. There is a class of not-so-well-known RTOSses that have no file-system, multi-tasking in the usual way etc. but is still delivering a reliable task scheduling service and a minimum of HW abstraction. In the past I've even written such simple RTOSses on my own to ease the subsequent development. RTOS ? Never again without !


April 8, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
du00000001 commented:

I'm working in deep-deep embedded areas (automotive and industrial automation) and would never consider not using an RTOS. There is a class of not-so-well-known RTOSses that have no file-system, multi-tasking in the usual way etc. but is still delivering a reliable task scheduling service and a minimum of HW abstraction. In the past I've even written such simple RTOSses on my own to ease the subsequent development. RTOS ? Never again without !


April 5, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Doug Abbott (LinkedIn) commented:

It might be useful to make a distinction between a real-time "operating system" and a multi-tasking kernel. As Paul pointed out, an RTOS has lots of facilities like file systems, network stacks and so on that can be useful if you need them. But at the heart of any RTOS is a multi-tasking kernel whose primary job is to schedule tasks in response to events. When I was teaching real-time programming seminars a few years back I told my students that if you have two or more asynchronous interrupts in a system, you probably should use a multi-tasking kernel. And remember that the timer tick is one of those interrupts.


April 5, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Doug Abbott (LinkedIn) commented:

It might be useful to make a distinction between a real-time "operating system" and a multi-tasking kernel. As Paul pointed out, an RTOS has lots of facilities like file systems, network stacks and so on that can be useful if you need them. But at the heart of any RTOS is a multi-tasking kernel whose primary job is to schedule tasks in response to events. When I was teaching real-time programming seminars a few years back I told my students that if you have two or more asynchronous interrupts in a system, you probably should use a multi-tasking kernel. And remember that the timer tick is one of those interrupts.


April 5, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Li Xu (LinkedIn) commented:

Most of time I will consider using an RTOS in the application as it usually offers a unified hardware abstraction layer and bunch of inter-process(task) communication APIs. Those offerings make applicaiton code more portable and more structure. On the other hand, if it is a very hard realtime application which means any time overhead are not acceptable I will not consider using RTOS. Finally I heard if the product needs to pass SIL(safety integrity level) certification, RTOS is probably not allowed.


April 5, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Li Xu (LinkedIn) commented:

Most of time I will consider using an RTOS in the application as it usually offers a unified hardware abstraction layer and bunch of inter-process(task) communication APIs. Those offerings make applicaiton code more portable and more structure. On the other hand, if it is a very hard realtime application which means any time overhead are not acceptable I will not consider using RTOS. Finally I heard if the product needs to pass SIL(safety integrity level) certification, RTOS is probably not allowed.


April 4, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Paul Burega (LinkedIn) commented:

It makes sense to use an RTOS when you require the facilities of an RTOS - file system, protocol stack, scheduler, debug tools, .... If you are building a system that doesn't require input or output, and doesn't execute much code, you probably don't need an RTOS. If you have several developers, and industry standard I/O ports, you probably need an rtos unless you have a very simple application, or you have enough time and money to write the entire product yourself and exhaustively test all the code. But an RTOS gives you future growth, to add capabilities that your customers demand, by just incorporating additional parts of the RTOS : Ethernet port, USB, wireless, web access, touch screen gui, .... an RTOS lets you buy these commodity items and lets you focus on your value add, where your product really differentiates itself from other products. And the RTOS comes tested, so you only have to test and debug your application, not the entire system. And a RTOS allows easy migration to a new processor or hardware, without your software development team having to rewrite everything for the new hardware. I would hate to have to write my own file system, disk drive code when this is a commodity item, and would work with all the disk drives out there. If manufacturing changes hardware due to cost or availability, your software needs to be able to respond without a major software rewrite if you want to be cost competitive in today's environment.


April 4, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Paul Burega (LinkedIn) commented:

It makes sense to use an RTOS when you require the facilities of an RTOS - file system, protocol stack, scheduler, debug tools, .... If you are building a system that doesn't require input or output, and doesn't execute much code, you probably don't need an RTOS. If you have several developers, and industry standard I/O ports, you probably need an rtos unless you have a very simple application, or you have enough time and money to write the entire product yourself and exhaustively test all the code. But an RTOS gives you future growth, to add capabilities that your customers demand, by just incorporating additional parts of the RTOS : Ethernet port, USB, wireless, web access, touch screen gui, .... an RTOS lets you buy these commodity items and lets you focus on your value add, where your product really differentiates itself from other products. And the RTOS comes tested, so you only have to test and debug your application, not the entire system. And a RTOS allows easy migration to a new processor or hardware, without your software development team having to rewrite everything for the new hardware. I would hate to have to write my own file system, disk drive code when this is a commodity item, and would work with all the disk drives out there. If manufacturing changes hardware due to cost or availability, your software needs to be able to respond without a major software rewrite if you want to be cost competitive in today's environment.


April 4, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Paul Newton (LinkedIn) commented:

Buying an RTOS gives a big advantage as follows: thousands of design decisions have already been made (for better or worse) and the project does not have to be slowed down to consider each of those decisions. In this day and age, all but the most cost or power constrained projects can afford the runtime overhead associated with at least a small fast kernel.


April 4, 2010
In response to: Question of the Week: When does it make sense to use an RTOS or operating system?
Paul Newton (LinkedIn) commented:

Buying an RTOS gives a big advantage as follows: thousands of design decisions have already been made (for better or worse) and the project does not have to be slowed down to consider each of those decisions. In this day and age, all but the most cost or power constrained projects can afford the runtime overhead associated with at least a small fast kernel.

POST A COMMENT
Display Name
captcha

Before submitting this form, please type the characters displayed above. Note the letters are case sensitive:

Advertisement
Advertisement
Advertisement
About EDN   |   Site Map   |   Contact Us   |   Subscription   |   RSS
© 2012 UBM Electronics. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other UBM Canon sites

UBM Canon | Design News | Test & Measurement World | Packaging Digest | EDN | Qmed | Pharmalive | Appliance Magazine | Plastics Today | Powder Bulk Solids | Canon Trade Shows