View this week's entry ad »
Part Inventory
powered by:
Part Finder
Go
powered by:
  • Quick Poll
What Social Networking site do you use the most?



VOTE VIEW RESULTS
Previous Polls
Hotspots » Analog & Mixed SignalPowerEmbedded

Premium Content

Editors' Picks

Featured Industry Resources

EiED Online>> Single-Stack RTOS

By William Wong

December 06, 2004

Print
Reprints Comment Subscribe

Single-stack operating systems are small and fast but most programmers are unfamiliar with them. They must be matched to the desired application. See how they work and where to use them.

Most embedded developers are familiar with interrupt driven, multitasking operating systems that provide a stack area for each task but I think most developers will be unaware of single-stack operating systems. A single-stack operating system typically uses less memory and it is well suited for microcontrollers that implement their stack in hardware.

Single-stack operating systems are not for all applications, especially where tasks are relatively independent and potentially complex such as a web server. Single-stack operating systems do fit well in control and digital signal processing applications where tasks are well defined and often where timing is critical. This may seem a bit confusing, as single-stack operating systems are non-preemptive. But time critical does not necessary mean minimum latency, especially when interrupt handlers can provide low-latency response time.

Although less common, commercial versions of single-stack operating systems are available. Quadros RTXCss is one product that employs a single-stack architecture. It can use the same operating system support as Quadros' other RTOS implementations. This includes features such as intertask communication and synchronization, memory management, and other kernel oriented functions.

The Quadros RTXCdm operating system mixes single-stack and multiple-stack operating systems. In this case, one of the stacks is reserved for the single-stack operating system tasks. As it turns out, the single-stack operating system is the highest priority thread in the multiple-stack environment. This approach is not a requirement when mixing a single-stack operating system with a multiple-stack operating system but it is the case with the Quadros product. In fact, it is architecturally possible to have single-stack tasks grouped by stacks where each of these threads manages a set of tasks. Of course, the operating system must take this into account when implementing kernel services.

OSEK/VDX is an open system definition for automotive electronics. It includes a single-stack definition as one of its many specifications. There are a number of commercial OSEK operating systems available.

Why Use A Single-Stack RTOS?
Low RAM requirements often make a single-stack RTOS the right choice. The primary memory savings is in stack memory usage. Applications will still need to allocate memory for buffers and other structures. The use of a single-stack RTOS will not change these requirements. On the other hand, an application's stack must support interrupt routines as well as the maximum amount of stack space required by an application. In a single-stack RTOS, the task that will use the largest stack sets the amount of memory.

Low ROM requirements can be an issue with respect to the operating system footprint. A single-stack implementation can be smaller because synchronization issues are simpler. A multiple-stack operating system must make sure task switches occur properly, including proper support for task synchronization primitives that often require disabling interrupts for a small period of time.

Low overhead and low interrupt latency for operating system services is one benefit of using single-stack operating systems again because of the simple implementation of task synchronization primitives. Interrupts typically are not disabled at any time because a task switch only occurs under very specific conditions that cannot conflict with synchronization primitive changes.

Average ( Ratings):
Filed Under:

Check for price and availability on Source ESB:

Go
powered by  

Related Products

You must log on before posting a comment.

Are you a new visitor? Register Now

Acceptable Use Policy

Sponsored Links