Embedded Systems Firmware Demystified

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