Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real Time Operating System

Similar presentations


Presentation on theme: "Real Time Operating System"— Presentation transcript:

1 Real Time Operating System
Tasks Widely independent operations, which should be executed as simultaneously as possible Operating System takes over the management and the coordination of the tasks. Task 1 Task 2 Task 3 Real Time - reaction in time of incoming events as fast as possible, - in best compliance with time requirements Embedded Systems

2 Real Time Operating System
Task Management Creation of task Terminatiation of tasks Scheduler: examines, wheter waiting conditions are fulfilled Dispatcher: decides which one of the waiting tasks will be executed Resource Management Memory -management I/O-management File management Protocole-Stacks, etc. Reliability Error-detection, -handling Security Access controle Object Protection Embedded Systems

3 Task Concept Task Task Control Block Task States
- Functional and structural unit of the operating system - Program with appropriate closed environment Task Control Block Information about state and priority of the task CPU and System Context Task States ready, running (busy), waiting, suspended Embedded Systems

4 Task states suspended ready running waiting
suspended: the task doesn‘t take part on what is goining on running ready: the task is ready and waiting for the assignment of the processor running (busy): the code of the task is executed waiting waiting: the task is waiting for the occurrence of an event Embedded Systems

5 Task Management ready running(busy) waiting suspended Dispatcher
tasks are created suspended processor is available Dispatcher running(busy) RTX166tiny: at the beginning task 0 is excecuted, it activates all needed further tasks Waiting condition is fulffilled waiting Scheduler Embedded Systems

6 Task Management Scheduler provides the availability of the tasks (regarding to the priority of the task): Time slicing: Maximum time, which is available for the task Round-Robin-Scheduling - preemptive scheduling Cooperative Scheduling: Task is waiting for the occurrance of an event non preemptive Scheduling Dispatcher performs the correct switching to the provided task Synchronisation Interprocess communication via: Signals Semaphore Mailboxes Messages Embedded Systems

7 Task Interaction - Synchronisation
Asynchronous via Mailbox Synchronous via Message Passing Sender Task Receiver Sender Task Receiver Embedded Systems

8 Real Time Operating System RTX166
RTX166 Full Task Switching Round Robin Cooperative 256 Tasks max.  128 task priorities signal passing message passing with mailbox system semaphores "os_wait" function  interrupt timeout signal from task or interrupt message from task or interrupt semaphore Embedded Systems

9 Real Time Operating System RTX166
RTX166 Tiny Task Switching Round Robin Cooperative 32 tasks max. signal passing "os_wait" function  interval timeout signal from task or interrupt Embedded Systems

10 Real Time Operating System RTX166
Single Task Program int counter; void main (void) { counter = 0; while (1) { /* repeat forever */ counter++; /* increment counter */ } Embedded Systems

11 Real Time Operating System RTX166
Round-Robin Task Switching #include <rtx166t.h> int counter0, counter1; /* global variables */ os_create_task (1); /* Mark task 1 as "ready" */ os_create_task (2); /* Mark task 2 as "ready" */ void job0 (void) _task_ 0 { while (1) { /* Endless loop */ counter0++; /* Increment counter 0 */ } void job1 (void) _task_ 1 { while (1) { /* Endless loop */ counter1++; /* Increment counter 1 */ Rtx_1 Embedded Systems

12 Real Time Operating System RTX166
Cooperative Task Switching: Wait for Timeout #include <rtx166t.h> int counter0, counter1; void job0 (void) _task_ 0 { os_create_task (1); while (1) { counter0++; /* Increment counter 0 */ os_wait (K_TMO, 3, 0); /* Wait 3 timer ticks */ } void job1 (void) _task_ 1 { counter1++; /* Increment counter 1 */ os_wait (K_TMO, 5, 0); /* Wait 5 timer ticks */ Rtx_1 Embedded Systems

13 Real Time Operating System RTX166
Cooperative Task Switching: Wait for Signal #include <rtx166t.h> int counter0, counter1; os_create_task (1); os_create_task (2); void job0 (void) _task_ 0 { while (1) { os_wait (K_TMO, 1000, 0);/* Wait 1000 timer ticks (1s)*/ if (++counter0 == 0) { /* On counter 0 overflow*/ os_send_signal(1); /* Send signal to task 1*/ } void job1 (void) _task_ 1 { os_wait (K_SIG, 0, 0);/* Wait for signal; no timeout */ counter1++; /* Increment counter 1 */ Rtx_1 Embedded Systems


Download ppt "Real Time Operating System"

Similar presentations


Ads by Google