|
|||||
Embedded Systems -> OS world seeks a portable interface
OS world seeks a portable interface The original Portable Operating System Interface for Computing Environments (Posix) standard, first published in 1990, is based on Unix, a well-established technology dating back to the early 1970s. It defines a standard way for an application to interface to the operating system. The original Posix standard defines interfaces to such core functions as file operations, process management, signals and devices. Subsequent releases of Posix have also been defined to cover real-time extensions and multi-threading. In a perfect world, one would always choose a standard. However, in the real world there are a number of questions one needs to ask before deciding to use a standard:
In the c ontext of Posix, the best way to assess its usefulness is to look at its implementation in relation to three factors-functionality, performance and availability-on some typical commercial operating systems (OSes), in this case Linux, LynxOS, QNX Neutrino and Solaris. Predictable timing Of the more than 30 Posix standards, seven are especially relevant to the development of real-time and embedded systems. Posix 1003.1a defi nes the interface to basic operating system functions and was the first to be adopted in 1990, while real-time extensions are defined in the standards 1003.1b, 1003.1d, 1003.1j and 1003.21. However, the original real-time extensions, defined by 1003.1b, are the only standards commonly implemented. Support for multiple threads in a process is provided in a separate standard, Posix 1003.1c. Posix also includes support for high availability in the 1003.1h standard. Posix 1003.1b, as well as 1003.1d and 1003.1j, defines extensions useful for development of real-time systems. Functions defined in the original real-time extension standard 1003.1b are supported across a wider number of operating systems than the other two specifications. For that reason, this article focuses on Posix 1003.1b. The following constitute the bulk of the features defined in Posix 1003.1b:
For the purposes of evaluating the real-time performance of the various operating systems, a C-language program for creating and using a Posix timer can be used. Creating a timer consists of two steps: specifying a signal to be used to deliver the timer and creating/setting the timer itself. In this example, we use the highest-priority real-time signal (sigrtmin) to asynchronously call the timer handler routine. Two values must be specified for the timer: the initial expiration time (it_value) and the frequency (tv_sec). The structure (itimerspec) allows nanosecond time specification; however, ac tual resolution is dependent on the system. The Posix call clock_getres() can be used to determine the actual resolution, typically 10 or 1 millisecond. Varied compliance Solaris, a general-purpose Unix operating system available from Sun Microsystems and developed to run on Sparc and Pentium-class CPUs, has many of the features required for a real-time system. Solaris implements both user-level and kernel-level threads. User-level threads are implemented as a library at the user application level; kernel-level threads are the unit of execution seen by the kernel. Solaris uses the lightweight processes (LWP) mechanism to run kernel-level threads on processors. The mapping of user-level threads to LWPs can be done in a number of different ways. If multiple user-level threads are mapped to a single kernel-level thread, then at most one thread can be active at a time. To take advantage of multiple processors, user-level threads can be mapped one-to-one to LWPs. LynxOS is a Unix-style operating system developed for real-time embedded systems. The Lynx kernel is pre-emptable, re-entrant and can be scaled down to a footprint as low as 97 kbytes. LynxOS 3.0.1 supports a single scheduling policy, fixed-priority pre-emptive with 256 priority levels. The clock tick frequency is fixed at 1 00 Hz, which limits the resolution of timers to 10 ms. The scheduler is also invoked in response to asynchronous events and a change in the system state. The six benchmarks used in this study are divided into two categories: those that measure the determinism of the OS and those that measure the latency of important operations. The benchmarks test core operating system capabilities and they are independent of any actual application. The first three benchmarks-timer jitter, response and bintime-are designed to measure the determinism of an operating system. The time-jitter test creates a timer, sets it to expire at a given period, and when it expires, determines the actual expiration time. The jitter is then defined as the deviation between the actual and desired expiration times. Most current CPUs include a stamp counter that is updated on every CPU cycle. The second deterministic benchmark (response) measures the actual execution time of a 10-ms fixed block of processing. The actual execution time over a number of separate runs is calculated to determine whether or not application response time is deterministic. The last deterministic benchmark (bintime) determines the maximum kernel blocking time. This benchmark uses a high-priority real-time thread to repeatedly call a time-of-day clock and calculate the time required by each call. The message-passing benchmark uses Posix message queues to measure the latency and throughput of data transfers between two threads in the same process or in different processes.
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |