Appendix B: RTOS Overview

Overview

In general terms, a realtime operating system (RTOS) is an environment that runs on an embedded system and provides facilities that allow properly written programs to react to certain stimuli within an expected time interval. In practice, when I refer to an RTOS, I mean an environment that runs on an embedded target and provides an API that includes, at a minimum, the ability to establish multiple threads of execution (commonly referred to as tasks ). An operating system that can execute multiple tasks concurrently is referred to as a multi-tasking operating system.

The RTOS creates an execution environment for each task that makes it convenient to pass messages between tasks, pass events between an interrupt handler and a task, prioritize task execution, and coordinate multi-task usage of an I/O device. These capabilities, though, are common to most multi-tasking operating systems. To qualify as an RTOS, these facilities must be designed so that the RTOS can react to an incoming stimulus within some maximum, predictable amount of time. The name RTOS clearly suggests real time, but it is safe to say that a large percentage of the applications using an RTOS do not have very many real-time constraints.

Some realtime applications, however, are much easier to implement using an RTOS. As embedded systems get more and more complicated, so does the firmware that makes them work. Often, very large and complex embedded systems can be implemented as a number of smaller, simpler, parallel tasks, each of which is somewhat unaware of the others. Such multi-threaded solutions can often make the code less complicated and more modular by eliminating artificial dependencies among the parallel tasks. Projects with simpler, more coherent modules are easier to manage, allowing firmware programmers to get home before midnight once in a while.

As with many other topics mentioned in this book, another book could be written on the subject of the RTOS. [1] Here, however, I will limit the discussion to some basic definitions.

Note 

The basic building block of any multi-tasking operating system (OS) is a task. A task is a function that is allocated a certain amount of resources and/or time to do what it has to do. With most RTOSs, each task is assigned a priority. The beauty of the RTOS is that you can have several of these prioritized tasks running and they can be somewhat unaware of the fact that they are running in parallel with other tasks.

[1] For example, see: Jean Labrosse, MicroC/OS-II , (Lawrence, KS: CMP Books, 1999.)



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net