General RTOS Concepts-Presentation

download General RTOS Concepts-Presentation

of 17

description

General RTOS Concepts-Presentation

Transcript of General RTOS Concepts-Presentation

General RTOS Concepts

General RTOS ConceptsBy:Jhonny VillarroelReal-Time Operating System

RTOS general architectureReal-Time - indicates an expectant response or reaction to an event on the instant of its evolution. Operating System (OS) - is a system program that provides an interface between hardware and application programs..RTOS - is therefore an operating system that supports real-time applications and embedded systems by providing logically correct result within the deadline requiredKernelAn operating system generally consists of two parts: kernel space (kernel mode) and user space (user mode). Kernel is the smallest and central component of an operating system.

Types of KernelMonolithic kernel

It runs all basic system services (i.e. process and memory management, interrupt handling and I/O communication, file system, etc) in kernel space. Examples are Linux and Windows.

Types of KernelMicrokernelIt runs only basic process communication (messaging) and I/O control. The other system services (file system. networking, etc) reside in user space in the form of daemons/servers

Types of KernelExokernelThe concept is orthogonal to that of micro- vs. monolithic kernels by giving an application efficient control over hardware. It runs only services protecting the resources (i.e. tracking the ownership, guarding the usage, revoking access to resources, etc)

What kinds of Kernel uses RTOS.

An RTOS generally avoids implementing the kernel as a large monolithic program. The kernel is developed instead as a micro-kernel with added configurable functionalities. This implementation gives resulting benefit in increase system configurability.

Microkernel and exokernel

RTOS Kernel Services

TASK Management - Task Object

To achieve concurrency in real-time application program, the application is decompose into small, schedulable, and sequential program units known as Task.

(Latente / dormant)

Scheduler

The scheduler keeps record of the state of each task and selects from among them that are ready to execute and allocates the CPU to one of them.

Types of Scheduler

Non-preemptive scheduling cooperative multitasking requires the tasks to cooperate with each other to explicitly give up control of the processor. When a task releases the control of the processor, the next most important task that is ready to run will be executed. A task that is newly assigned with a higher priority will only gain control of the processor when the current executing task voluntarily gives up the control.

Types of SchedulerPriority-based preemptive schedulingrequires control of the processor be given to the task of the highest priority at all time. In the event that makes a higher priority task ready to run, the current task is immediately suspended and the control of the processor is given to the higher priority task.

Dispatcher

The dispatcher gives control of the CPU to the task selected by the scheduler by performing context switching and changes the flow of execution.At any time an RTOS is running, the flow of execution passes through one of three areas: through the task program code, through an interrupt service routine, or through the kernel.

Task SynchronizationEvent objects

Task SynchronizationSemaphores

Intertask Communication

A message queue (FIFO), (LIFO) A pipe Remote procedure (RPC)

Timer ManagementIn embedded systems, system and user tasks are often scheduled to perform after a specified duration. To provide such scheduling, there is a need for a periodical interrupt to keep track of time delays and timeout. Most RTOSs today offer both relative timers that work in units of ticks, and absolute timers that work with calendar date and time. For each kind of timer, RTOSs provide a task delay service, and also a task alert service based on the signaling mechanism (e.g. event flags).