|
Topic: |
Real-time Operating Systems |
|
Location: |
Operating Systems |
|
Author: |
Jason Waltman |
|
Date: |
30 July 1999 |
|
Revisions: |
DRAFT 2 August 1999 (1.1.0) |
A real-time operating system (RTOS) is similar to a
general-purpose operating system, however it is designed with
special characteristics to support real-time applications. In
such applications, the dependability that a certain task will
finish before a particular deadline is just as important as
obtaining the correct results. Besides meeting required
deadlines, a RTOS must also be able to respond predictably to
unpredictable outside events and process multiple events
concurrently. Embedded applications programmers use commercial
RTOSs as a means of reducing the cost and time involved in
development of their system. A POSIX standard exists for
portability of real-time applications between RTOSs.

Background
Control of nuclear power plants, control of
laboratory experiments, medical monitoring, space navigation and
guidance, anti-lock breaking, air traffic control, and burglar
alarms are all classified under a special set of systems
described as real-time. In such systems, correctness depends not
only on retrieving accurate data but also on retrieving it
within a specified time frame. By definition, failure is said to
occur if the results are returned later then the allotted time.
Real-time systems are not necessarily fast
(fast is a relative term), however there is a bounded latency on
the time required to complete certain tasks. Depending on the
system, the latency may be only a few microseconds. A real-world
example of a familiar real-time system is a cashier line in a
grocery store. There is some upper limit on the time that a
customer is willing to wait in line. Normally, customers can get
through in a matter of minutes, but if that time became instead
hours, customers would probably go elsewhere.
In general, real-time systems must be able to
respond predictably to unpredictable events, meet completion
deadlines of particular tasks, and process multiple tasks at
once. There are two flavors of real-time systems, depending on
the degree of failure if the system does not meet a deadline. In
hard real-time systems, no lateness is accepted. Catastrophic
failure, possibly the loss of human life, is possible if
deadlines are not met (e.g., an aircraft control system). On the
other hand, in soft real-time systems there is usually a rising
cost associated with lateness (e.g., a vending machine). Failure
is not catastrophic in this case, but more of an inconvenience
where the inconvenience increases over time.

Overview & Description
A real-time operating system (RTOS) may be a
stripped-down version of an operating system that is common on
desktop PCs, with a few special characteristics. Typically, a
RTOS provides the same functionality as a general-purpose
operating system (GPOS), but eliminates advanced features that
slow operation and are seldom used. RTOSs are generally
preemptible (a process that has control of the processor must
yield to an arriving process with higher priority, allowing the
higher priority process to run) and able to support
multi-threaded processes (the ability of separate sections of a
process to run concurrently). In addition, there are five
general attribute requirements associated with RTOSs, briefly
described below.
Determinism is the ability of the operating
system to perform a task in a determined amount of time. This
attribute is probably most affected by the time required to
acknowledge that an interrupt has occurred (i.e. interrupt
latency). Responsiveness deals with how quickly the system can
respond to an event. Interrupts here again are influential. The
time after an interrupt has been acknowledged to handle the
interrupt, execute it, and manage nested interrupts, plays a
large role in the responsiveness of the system. User control in
a RTOS is the ability of the user (the user writing applications
for the RTOS, not the end-user) to set task and thread
priorities. Reliability is the ability of the system to run for
an extended period of time (maybe multiple years) without
failure. Rebooting a GPOS is a common way to resolve a problem
on a desktop computer. This simply is not acceptable for a
real-time system. Finally, fail-soft operation is the ability of
the operating system to keep running (with possibly a slight
loss of performance) in spite of some internal corruption.
Signaling an alarm, bringing a backup system on-line
automatically, or gracefully shutting down the system (saving as
much data as possible) are all more cost-effective alternatives
than having the system just halt.
There are additional fundamental aspects of
RTOS design. One is the ability of a particular process to
communicate with another process (formally called interprocess
communication or IPC). This allows separate applications to
interact with each other and share the same data. The concept of
IPC introduces another important operating system aspect,
preventing a process from changing data while another process is
using the data. This "mutual exclusion" of data is
typically controlled in RTOSs by the use of semaphores (a
variable that indicates the status of a shared resource). This
method does not disable system interrupts which would hinder
system responsiveness. Another important aspect of RTOSs is the
preemptive scheduling of processes, scheduling such that the
operating system can change the running process to another
process at any given time. This allows higher priority tasks
(normally those with the shortest deadline) to finish first.

Advantages
Real-time systems are typically embedded
systems. The use of a commercial real-time operating system
liberates the embedded applications programmer, saving the time
and cost developing a hardware interface. The principle is the
same as using a high-level language to write software, instead
of assembly language. A possible tradeoff is some overhead in
return for low development cost and effectiveness. However,
certain industries (e.g., medical, avionics, etc.) may have
standards that a commercial RTOS will not meet. In these cases,
the embedded applications programmer can write only the hardware
interface needed for the particular application, eliminating
unnecessary operating system overhead. Another solution however
emerges from the fact that many RTOSs are "scalable."
This means applications programmers need use only the RTOS
features required by the application, thus reducing the overall
size and increasing the performance of the system.
Standards
POSIX is a standard for applications and
operating systems that allows some assurance that applications
conforming to the standard are able to be ported to operating
systems that also conform to the standard. Originally, this
standard did not cover attributes specifically relevant to
real-time applications. Real-time extensions to the standard (POSIX
1003.1b) have enabled the appearance of POSIX-compliant
real-time operating systems. More information can be found on
the Internet at either the Portable Application Standards
Committee (http://www.pasc.org/)
or the official ISO POSIX site (http://anubis.dkuug.dk/JTC1/SC22/WG15/).

Commercial Products (listed alphabetically)
CMX-RTX - CMX Company
http://www.cmx.com/
CMX-RTX RTOS from CMX Company supports many
8, 16, and 32 bit embedded microcontrollers and microprocessors.
The product provides over 65 kernel services allowing
configuration of many operating system controls, including
events, messages, resources, semaphores, cyclic timers, queues,
fixed memory blocks, and UARTs. The vendor claims the operating
system has fast context switch times, low interrupt latency and
small ROM and RAM requirements for smaller applications. Support
is included for automatic power down management and the ability
to have cooperative or time sliced schedulers, in addition to
preemption. CMX-RTX supports over 30 compiler versions. Source
code is included and is royalty-free. Development hosts: Windows
NT and Linux.
eCos - Cygnus Solutions
http://www.cygnus.com/
The source code for eCos, including all
kernel components, Hardware Abstraction Layers (HAL), drivers,
math and ISO C runtime libraries is available free for download
from Cygnus Solutions. Two additional Cygnus products (which are
not free), Source-Navigator and GNUPro Toolkit, are GUI based
applications that provide simpler code browsing and the ability
to build, debug, and configure eCos applications. eCos is
targeted at high-volume embedded systems and was designed to
reduce the cost and increase the quality of embedded system
development. eCos supports simulation of embedded applications
on the host, without the use of the target hardware. Among the
features included are: support for nested interrupts,
platform-independent HAL options, binary and counting
semaphores, source-level debugging, alarm and cyclic handlers,
and uITRON compatibility. Source code is included and is
royalty-free. Development hosts: Windows NT, Windows 95, and
Linux.
LynxOS - Lynx Real-Time Systems, Inc.
http://www.lynx.com/
LynxOS is a UNIX-compatible operating system
designed for various levels of hard real-time applications. The
preemptible RTOS kernel has 256 global user-thread priority
levels; vendor claims fast context switching and short,
deterministic blocking times. LynxOS has a modular design that
allows the operating system to be highly scalable. For
specialized embedded applications, the kernel only can be linked
with an application. On the other hand, the full LynxOS
consists, in part, of a development environment and has a
graphical user interface. In addition, LynxOS supports various
peripheral devices, networking protocols, and a wide range of
microprocessors. Open POSIX and UNIX APIs. Development hosts:
Sun Solaris, SunOS, RS6000, and LynxOS. POSIX-compliant
(1003.1a, .1b, .1c).
NucleusPLUS - Accelerated Technologies Inc.
http://www.atinucleus.com/
NucleusPLUS is a small real-time kernel
available for most processor families. The kernel is implemented
as a C library, therefore only the portions used in a specific
application are bound into the executable. In addition,
applications written with NucleusPLUS are highly portable, as
the kernel was written mostly in ANSI C. Features include task
control, task communications, task synchronization, memory
management, programmable timers, and dynamically created and
deleted objects. Add-ons are available for Web, networking, and
graphic support. Source code is included and is royalty-free.
Development host: Windows NT.
QNX - QNX Software Systems Ltd.
http://www.qnx.com/
QNX is a scalable RTOS designed for hard
real-time performance. Its modular design allows it to be used
in small, embedded applications or to run a distributed network
of several hundred processors. Modules can be independently
loaded depending on applications‘ needs, and new modules can
be created for extensibility. In part, QNX‘s modularity comes
from that fact that operating system services run in their own
protected address space. Access to these services is provided
through message-passing interprocess communication mechanisms.
Device drivers run in user space making the kernel more
reliable. Additional features include nested interrupts,
dynamically attachable and removable interrupt handlers,
multiple timers per process, user-configurable system limits and
resources, 32 priority levels, and preemptive, prioritized
context switching. The vendor offers an add-on product named
Photon microGUI, which is a complete embeddable windowing system
that requires less than 500KB of flash memory or ROM.
Development hosts: Windows NT, and QNX RTOS. POSIX-compliant
(1003.1, 1003.1b).
VRTX - Mentor Graphics Corp.
http://www.mentor.com/
VRTX is a deterministic, preemptive
multitasking, and scalable real-time operating system.
Scalability is provided through a modular, library based
architecture and the choice of two compatible, modular kernels.
Separately the kernels are designed for use on microcontrollers
with restrictive footprint requirements, or in an environment
requiring a full-featured real-time operating system. Additional
features include priority inheritance and preemptible system
calls; additional modules support networking and file protocols.
VRTX is supported by the VRTX Development System, which provides
application simulation, debugging, and analysis. VRTX is
FAA-certified. Development hosts: Windows NT, Sun Solaris, and
HP-UX.
VxWorks - Wind River Systems, Inc.
http://www.wrs.com/
VxWorks is one of three components in the
Tornado suite of tools from Wind River Systems. In addition to
the VxWorks RTOS, Tornado includes development and debugging
tools, and a range of communications software options (e.g.,
Ethernet, serial line, in-circuit/ROM emulator). VxWorks is
scalable through the configuration of over 100 different options
and the removal of individual functions from run-time libraries.
Additional features include interrupt support, preemptive and
round robin scheduling, network functionality, file system
support, C++ support, 1800 application program interfaces
(APIs), 256 priority levels, and incremental linking and loading
of components. Interprocess communication is provided through
the use of shared memory; message queues and pipes; binary,
counting, and mutual exclusion semaphores. Development hosts:
Windows NT, Windows 95, Sun Solaris, SunOS, and HP-UX. POSIX-compliant
(1003.1b).

Useful Links
IEEE-CS Technical Committee on Real-Time
Systems
http://cs-www.bu.edu/pub/ieee-rts/
Contains an archive of the committee‘s
newsletter and links to numerous university and institute,
research and special interest groups. The site houses
information on conferences, workshops, books, and journals
dealing with real-time systems, and as well, links to various
research tools and commercial products.
Real-Time Concurrent Operating System
Applications
http://www.dcs.shef.ac.uk/~prc/COM324-97/m6rfs/
A collection of RTOS Internet references
compiled by a student from the University of Sheffield.
Extracted articles and abstracts define real-time operating
systems, show the difference between general-purpose operating
systems, and contrast hard and soft systems.
Usenet FAQ - Real-time Computing
http://www.cis.ohio-state.edu/
hypertext/faq/usenet/realtime-computing/top.html
Contains definitions, publications,
controversial questions, market information, and research
resources on real-time systems. In addition there is an
extensive list of real-time operating systems and company
contacts. The FAQ is a helpful resource for both newcomers and
experts in the field.
Real-Time Encyclopedia
http://www.realtime-info.be/
The home of Real-Time Magazine (subscription
information available). Provides many real-time related
resources including current press releases, publication
information, and a large glossary of real-time system and
general operating system (including RTOS) terminology. The site
also contains a long list of commercial real-time operating
systems with brief descriptions.
Real-Time and RTOS by EG3
http://www.cera2.com/navi/real.htm
Links to a wide variety of Internet resources
on real-time and real-time operating systems. |