Tuesday, August 12, 2014

Webcom Technologies: Choose a Real-Time Operating System

Webcom Technologies  provides article on c RTOS to choose a Real-time operating system? This article provides an overview of RTOSes and how you can select the best one for your project.

Engineers often use the term “real time” to describe computing problems for which a late answer is as bad as a wrong one. These problems are said to have deadlines, and embedded systems frequently operate under such constraints. Webcom Technologies renders a brief introduction with Real Time System:

Real time systems

The designers of real-time systems at webcom technologies spend a large portion of their time worrying about worst-case performance. They must constantly ask themselves questions like: what is the worst-case time between the human operator pressing the brake pedal and an interrupt signal arriving at the processor? What is the worst-case interrupt latency?

Most of the commercial embedded operating systems available today are designed for possible inclusion in real-time systems. In the ideal case, their worst-case performance is well understood and documented. To earn the distinctive title “Real-Time Operating System” (RTOS), an operating system should be deterministic and have guaranteed worst-case interrupt latency and context-switch times. Given these characteristics and the relative priorities of the tasks and interrupts in your system, it is possible to analyze the worst-case performance of the software using a technique such as rate monotonic analysis.

Webcom Technologies finds three major parameters of choosing the OS. An operating system is said to be deterministic if the worst-case execution time of each of its system calls is calculable. An operating system vendor that takes the real-time behavior of its product seriously will usually publish a datasheet providing the minimum, average, and maximum number of clock cycles required by each system call.

Interrupt latency is the total length of time from an interrupt signal arriving at the processor to the start of the associated interrupt service routine (ISR). When an interrupt occurs, the processor must take several steps before executing the ISR. First, the processor must finish executing the current instruction. Next, the interrupt type must be recognized. This is done by the hardware and does not slow or suspend the running task. Finally, and only if interrupts are enabled, the CPU’s context is saved and the ISR associated with the interrupt is started.

The third real-time characteristic of an operating system is the amount of time required to perform a context switch. This is important because it represents overhead across your entire system. For example, imagine if the average execution time of any task before it blocks is 100ms but that the context-switch time is also 100ms. In that case, fully one half of the processor’s time is spent within the context-switch routine!

Again, there is no magic number and the actual times are usually processor-specific, since they are dependent on the number of registers that must be saved and where. Be sure to get these numbers from any operating system vendor you are thinking of using. That way, there won’t be any last minute surprises.


Post a Comment