Top Banner
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach
26

Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Dec 21, 2015

Download

Documents

Clarissa Arnold
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real-Time Operating System

Chapter – 8Embedded System: An integrated

approach

Page 2: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Tasks

• What is Real Time?– Simply, the time measured by physical clock.– Anything is ‘real time’ means it has direct relation with actual

time.

• Real time task:– Performance is judged on basis of time.– Correct result = correct output + correct time

• Incorrect timing of result leads to :– System failure OR– Reduced QoS

Page 3: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Real Time Tasks– Process control in industrial plants– Robotics– Air Traffic control– Telecommunications– Weapon guidance system e.g. Guided missiles– Medical diagnostic and life support system– Automatic engine control system– Real time data base– Mars Rovers

• Curiosity : OS – VxWorks, Processor BEA’s RAD 750

Page 4: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real time speech or video processing

• A speech or moving picture sample of 1 second, if processed in 1 second or in less, makes it real time processing

Page 5: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

RTOS

• Question: Is real time systems and embedded systems are same?

Page 6: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Terms and definition

• Release time (or ready time): This is the time instant at which a task(process) is ready or eligible for execution

• Schedule Time: This is the time instant when a task gets its chance to execute

• Completion time: This is the time instant when task completes its execution

• Deadline: This is the instant of time by which the execution of task should get completed.

• Runtime: The time taken without interruption to complete the task, after the task is released

Page 7: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Terms and Definitions

• Tardiness: Specifies the amount of time by which a task misses its deadline. Its is equal to the difference between completion time and deadline

• Laxity: Is defined as deadline minus remaining computation time. The laxity of task is the maximum amount of time it can wait and still meets its deadline

Page 8: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Soft and Hard Real Time task

• Hard Real time task: – Task must complete before or at deadline.– Value of completing the task after deadline is zero.

• Software Real Time– Missing deadline is penalty– Penalty increases as tardiness increase

Page 9: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Types of Real Time Tasks– Hard Real-time task

• Air traffic control• Vehicle subsystems control • Nuclear power plant control

– Soft Real-time Task• Multimedia transmission and reception• Networking, telecom (cellular) networks• Web sites and services • Computer games.

– Firm Real Task– Periodic Task – Aperiodic Task– Sporadic Task – Preemptible/Non-Preemptible Tasks

Page 10: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

RTOS

• Do an embedded system need an operating system?

Page 11: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Real time in operating systems: – The ability of the operating system to provide a

required level of service in a bounded response time.

– It responds to inputs immediately(Real-Time).– Here the task is completed within a specified time

delay.– In real life situations like controlling traffic signal or

a nuclear reactor or an aircraft,– The operating system has to respond quickly.

Page 12: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Characteristic of Real time in operating systems: – Consistency – Reliability – Scalability – Predictability – Performance

Page 13: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Functions of Real time in operating systems: – Task management– Scheduling.– Resource Allocation.– Interrupt Handling.

Page 14: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Operating System(Chapter 8)

• Scheduling in Real time in operating systems: – No of tasks – Resource Requirements – Release Time – Execution time – Deadlines

• Rate Monotonic Algorithm• Earliest Deadline First Algorithm

Page 15: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Real Time Scheduling Algorithms

• General Purpose Operating System’s Scheduling Algorithms:

• FCFS, SJF, SRTF, Priority Scheduling, Round Robin

• Some of them are applicable for RTOS.

• There more specific RTOS algorithms

Page 16: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

RTOS Scheduling Classification

Real Time Scheduling

Off-line On-line

Static Priority

Pre-emptive

Non Pre-emptive

Dynamic Priority

Planning Based

Best Effort

Page 17: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Off Line Scheduling (Pre Run time scheduling)

• They generate scheduling information prior to system execution (Deterministic System Model)

• This scheduling is based on :– Release time– Deadlines – Execution

• Disadvantage: Inflexibility, If any parameter changes, the policy will have to be redone

Page 18: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

On-Line Scheduling

• Number and types of tasks, associated parameters are not known in advance.

• Scheduling must accommodate dynamic changes

• Online Scheduling are of two types:– Static Priority– Dynamic Priority

Page 19: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Static Priority

• Tasks with highest priority gets the chance to execute first

• This can be preemptive or Non-preemptive• Non preemptive: task with highest priority runs

till it completes.• Preemptive: The execution of task can be pre-

empted when higher priority task appears in ready queue.

Page 20: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Dynamic Priority

• Priority can be allowed to change at run time• Scheduling needs more computation• Pre-emption may or may not be used• Flexibility is quite high in such system• Two subsets:1. Planning Based:

– Guarantees deadline for all accepted task.

2. Best effort algorithm does its best to maximize performance. – Guarantees meeting deadline for hard time task.– Optimizes the performance of soft time task

Page 21: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Problem: Static PriorityTasks Priority Period CPU Burst

T1 1 7 2

T2 2 17 4

T3 3 24 8

• Draw the Gantt-chart for scheduling these tasks.• Assume the all jobs have same release time• Schedule the process to meet their deadline

– Without Pre-emption – With Pre-emption

• Note: Deadline of task is the time when its next burst arrive

Page 22: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Rate Monotonic Algorithm• Introduced by Liu and Layland in 1973

• Assigning priorities as a monotonic function of the rate of a process.

• (Monotonic means either increasing or decreasing)

• Priorities are assigned according to increased period of a process.• As period increases the priority decreases.

• The process with lowest period will have highest priority

Page 23: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

RM Algorithm

• RM provides simple inequality, to verify the sufficient condition for RM algorithm

• Where C is CPU Burst , P or T is Period• If the condition satisfied, RM will schedule tasks within

their respective deadline• This is sufficient, but not necessary condition

Page 24: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Example

• CPU utilization for the set of task:• LHS : 2/7 + 4/17 + 8/24 = 0.812• RHS : = 3 X (2 1/3 -1)= 3 x .26 = .78• LHS> RHS :RM does not get satisfied• But the task still might get schedulable by RM technique

Tasks Priority Period (T) CPU Burst(C)

T1 1 7 2

T2 2 17 4

T3 3 24 8

Page 25: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Problem 1

Tasks Period (P or T) CPU Burst(C)

T1 15 4

T2 12 2

T3 20 5

Page 26: Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.

Problem 2Tasks Period CPU Burst Release Time

T1 3 1 0

T2 10 3 1

T3 15 4 3