Download 8051 RTOS

Transcript
1 Introduction to the RTOS
kernel
Summary
1.1
This chapter provides an introduction to the RTOS real-time
multitasking kernel. It discusses the choice of making the
RTOS compliant with the OSEK standard. Additionally, this
chapter provides a high-level introduction to real-time
concepts.
Real-time Applications
A real-time system is used when there are rigid time requirements on the operations of a processor to
perform certain tasks. There are two flavors of real-time systems. A hard real-time system must
guarantee that critical tasks complete on time. Processing must be done within the defined constraints
or the system will fail. A soft real-time system is less restrictive; a critical task gets priority over other
tasks and retains that priority until a point of rescheduling. In a soft real-time system, failure to produce
the correct response at the correct time is also undesirable but not fatal.
In reality most applications consist of tasks with both hard and soft real-time constraints. If these tasks
are single purposed they could be implemented as semi-independent program segments. Still the
programmer needs to embed the processor allocation logic inside the application tasks.
Implementations of this kind typically take the form of a control loop that continually checks for tasks to
execute. Such techniques suffer from numerous problems and represent no solutions for regular
applications. Besides they complicate the maintenance and reusability of the software.
An RTOS (Real Time Operating System) is a dedicated operating system fully compromised to
overcome the time constraints of a real-time system. An RTOS provides, like any other operating
system, an environment in which a user can execute programs in a convenient and structured manner
but at no risk of failing with the real-time constraints. The benefits of using an RTOS are:
• An RTOS eliminates the need for processor allocation in the application software.
• Modifications, and even additions of completely new tasks can be made in the application software
without affecting critical system response requirements.
• Besides managing task execution most real-time operating systems also provide facilities that
include task communication, task synchronization, timers, memory management etc.
• An RTOS hides the underlying hardware specific concerns to the user offering a runtime
environment that is completely independent of the target processor.
• Easy migration to other targets (provided that the RTOS vendor offers support for these other
processor families).
1-1