Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
The Challenge
The Rising Software Intensity:
Mobile Terminals
Software > 10X Intensity
2G 4 M bit 30MIPS 3-30MlPS --8-16 bits 10 M Hz 3G 64 M bit 200MIPS 30MIPS 50MIPS 100MIPS 16-32bits 50 M Hz
Memory Radio Channel Speech Codec Voice Control Video Codec CTRL Processor Speed
an RTOS architecture
time means that correctness of system depends not only on logical results but also on the time the results are produced
real indicates: reaction to external events must occur during their evolution.
system time ( internal time ) has to be measured with same time scale as controlled environment ( external time )
Definition
A real-time Computer system is a computer system in which the correctness of the system behaviour depends not only on the logical results of the computation, but also on the physical instant at which these results are produced. -Kopetz
RR Dhruva, CVR College of Engg.
What is RTOS?
Embedded systems, industrial robots, spacecraft, industrial control and scientific research equipment.
Facilitates the creation of a real-time system Does not guarantee the final result will be real-time; this requires correct development of the software.
RR Dhruva, CVR College of Engg.
For many years small embedded RTS have not used a RTOS Profound (but not immediately apparent) effects of using an RTOS - major impact on software:
Main difference between real time and nonreal-time : deadline Critical applications: result after deadline not only late but wrong deadline to be met under all (even worst) circumstances real time means predictable
if missing its deadline may cause catastrophic consequences on the environment under control if missing its deadline makes the result useless, but missing does not cause serious damage if meeting its deadline is desirable (e.g. for performance reasons) but missing does not cause serious damage
RTOS that is able to handle hard RT tasks is called hard real-time operating system
Hard RT systems:
automotive : power-train control, air-bag control, steer by wire, brake by wire aircraft : engine control, aerodynamic control Weather forecast Decisions on stock exchange orders communication systems (voice over IP!) user interaction comfort electronics (body electronics in cars)
RR Dhruva, CVR College of Engg.
Firm RT systems:
Soft RT systems:
Tasks
Basic SW entity handled by the OS:Process Process = task in our context One processor, concurrent tasks...
CPU has to be assigned to tasks with respect to predefined criterion:scheduling policy implementation of scheduling policy: scheduling algorithm allocation of selected task to CPU: dispatching
RR Dhruva, CVR College of Engg.
Introduction to Scheduling
We observe that processes require alternate use of processor and I/O in a repetitive fashion. Each cycle consist of a CPU burst followed by an I/O burst.
Introduction to Scheduling
In multiprogramming systems, when there is more than one runnable tasks (i.e., ready), the operating system must decide which one to activate. The decision is made by the part of the operating system called the scheduler, using a scheduling algorithm. The scheduler is concerned with deciding policy, not providing a mechanism.
Introduction to Scheduling
An algorithm for ordering the use of system resources (CPU) A means of predicting the worst-case behavior of the system when the scheduling algorithm is applied.
Types of Constraints
The following are general types of constraints: Timing constraints
Precedence constraints
Resource constraints
Task Scheduling
active : can potentially execute ready : is waiting for CPU running : is executing on CPU
activation
Execution
Assume three tasks J1, J2, J3 At times t1, t2, t3, t4 the processor performs a context switch
idle J1 (t)
3 2 1
J2
J3
t1
t2
t3
t4
Preemption
Running task may be interrupted at any point to allow a more important task to gain the processor immediately.
dispatching scheduling preemption termination
activation
Execution
Importance of Preemption
Tasks performing exception handling may need to preempt running tasks to ensure timely reaction Tasks may have different levels of criticalness. This can be mapped to a preemption scheme More efficient schedules can be produced with preemption
Scheduling Goals
All systems
Fairness - giving each process a fair share of the CPU Policy enforcement - seeing that stated policy is carried out Balance - keeping all parts of the system busy Response time - respond to requests quickly Proportionality meet users expectations Meeting deadlines - avoid losing data Predictability avoid quality degradation in multimedia systems
Interactive systems
Real-time systems
set of periodic tasks a generic periodic task instance j of task i release time of i,j
i
phase of i (= i,1, i.e. release time of first instance) period of i (= interval between two consecutive activations)
28
di,j
si,j
fi,j
Each interval [ti, ti+1) with (t) constant for t[ti, ti+1) is called time slice A preemptive schedule allows a running task to be suspended at any time.
A schedule is called feasible if all tasks can be completed according to a set of specified constraints A set of tasks is called schedulable if there exists at least one algorithm that can produce a feasible schedule
RR Dhruva, CVR College of Engg.
Arrival time ai :
the time Ji becomes ready for execution also called request time or release time, denoted by ri time necessary for execution without interruption
Ci
Ji
t ai Si fi di
Deadline di:
time before which task has to be completed its execution time at which Ji start its execution time at which Ji finishes its execution
Ci Ji
t ai Si fi di
Aperiodic Scheduling
Earliest Deadline First (EDF) Modified EDF Rate Monotonic Priority Assignment (RM) Earliest Deadline First (EDF) Fixed Priority Dynamic Priority
RR Dhruva, CVR College of Engg.
Periodic Scheduling
Servers
Periodic task i consists of infinite sequence of identical activities, called instances or jobs regularly activated at a constant rate Activation of first instance of i is called phase i
i is ai,k= i + (k-1) Ti
Periodic task i can be characterized by Ci, Ti and Di Ci, Ti and Di are constant for each instance. In most cases: Ti = Di Aperiodic task Ji also consists of infinite sequence of identical activities (instances) Their activations are not regular
U=
i= 1
Ci Ti
37
For given A least upper bound Ulub (A) is the minimum of the utilization factors over all task sets, that fully utilize the processor:
39
Schedulability Test
Ulub allows to easily verify the schedulability of a task set: Uub (i) Ulub (A) => i schedulable.
Uub (i) > Ulub (A) => i may be schedulable, if the periods of the tasks are suitable related. Uub (i) > 1 => i is not schedulable
40
41
More precisely : Rate Monotonic Priority Assignment Priorities are assigned to tasks according to their request rates. Tasks with higher request rates (i.e. shorter periods) get assigned higher priority. Periods constant => RM is fixed-priority assignment RM is intrinsically preemtive: currently executing task is preempted by a newly released task with shorter period.
44
45
Concluding remarks on RM
RM is optimal among all fixed priority assignment
RM guarantees that an arbitrary set of periodic tasks is schedulable if the total processor utilization U does not exceed the value of 0.69
Ulub = 0.69 is sufficient but not necessary to guarantee the feasibility of a given task set.
46
EDF algorithm:
Tasks with earlier deadlines will be executed at higher priorities Absolute deadline of periodic task depends on current j-th instance: di,j= i + (j - 1) Ti + Di => EDF is dynamic priority assignment
n i=1
ci
i
48
Example: EDF vs RM
Survey of RTOS
LynxOS www.lynx.com Microkernel and plug in modules. UNIX compatible. pSOSystem www.windriver.com Iridium satellites. VxWorks www.windriver.com Mars Pathfinder QNX www.qnx.com Suitable for multiprocessors on big (shared memory) machines. Symbian www.symbian.com Mobile phones
Questions Please...