Real-Time Operating system (RTOS) Real-time Embedded systems - - PowerPoint PPT Presentation

real time operating system
SMART_READER_LITE
LIVE PREVIEW

Real-Time Operating system (RTOS) Real-time Embedded systems - - PowerPoint PPT Presentation

Real-Time Operating system (RTOS) Real-time Embedded systems often have real-time computing constraints (Temporal) Determinism Correctness of system depends not only on the logical result of the computation, but also on the time at which


slide-1
SLIDE 1

Real-Time Operating system

(RTOS)

slide-2
SLIDE 2

Real-time

Embedded systems often have real-time computing constraints (Temporal) Determinism Correctness of system depends not only on the logical result of the computation, but also

  • n the time at which the result is generated
  • P. A. Laplante, “Real-Time Systems Design and Analysis”, 4th edition, Wiley-IEEE Press

Available online with UiO access

slide-3
SLIDE 3

Real-time

Hard real-time Failure to meet a single deadline may lead to complete system failure Soft real-time Performance/quality is degraded by failure to meet the deadline Average time Worst-case time Average time Worst-case time Deadline

  • P. A. Laplante, “Real-Time Systems Design and Analysis”, 4th edition, Wiley-IEEE Press

Available online with UiO access

slide-4
SLIDE 4

Timing in embedded system

  • Sleep / delay()
  • Timer interrupts

super loop

slide-5
SLIDE 5

Abstraction levels

Software user application Device Drivers

Registers Hardware functions CPU bus SW HW

Hardware abstraction layer

Operating system

RTOS

slide-6
SLIDE 6

Real-Time Operating System (RTOS)

A structure that primarily provides:

  • Time management
  • Task management
  • Inter-task communication
slide-7
SLIDE 7

What does an RTOS do?

  • Break time into uniform chunks (ticks)
  • Split a problem into smaller manageable units / subtask. (tasks)
  • Assign time slots to these subtasks (scheduling)

TASK 1 TASK 3 TASK 2 T1 T2 T1 T2 T3 T1 T2 T1 T2 T3 T3 T3

slide-8
SLIDE 8

Scheduler

The part of the OS or kernel that is responsible for determining which task to run next

T1 T2 T1 T2 T3 T1 T2 T1 T2 T3 T3 T3 But how does it decide?

slide-9
SLIDE 9

Priorities

TASK 1 P2 TASK 3 P1 TASK 2 P3 Most RTOSs assigns an explicit priority to each task The OS then runs the task with the highest priority T3 T3 T3 T3 T3 T3 T3 T3 T3 T3 T3 T3

slide-10
SLIDE 10

Blocking

delay(t) Inter-task communication

slide-11
SLIDE 11

Priorities & blocking

TASK 1 P2 TASK 3 P1 TASK 2 P3 The highest priority unblocked tasks always runs T1 T2 T1 T2 T3 T1 T2 T1 T2 T3 T3 T3 The scheduler evaluates which task to run at every timer tick

slide-12
SLIDE 12

Inter-task communication

“Key” to control access, by multiple tasks, to a common resource

Messages (mailbox, queues) Semaphores

Can be used to communicate data between tasks Both can be used to synchronize the execution of tasks

slide-13
SLIDE 13

Example from FYS4220 project

task_interrupt task_accel

ISR

key1_sem post pend

msg_box

post pend pend and post pend and post shared_jtag_sem