Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

qwertyuiopasdfghjklzxcvbnmqwertyui

opasdfghjklzxcvbnmqwertyuiopasdfgh
jklzxcvbnmqwertyuiopasdfghjklzxcvb
nmqwertyuiopasdfghjklzxcvbnmqwer
tyuiopasdfghjklzxcvbnmqwertyuiopas
REPORT
dfghjklzxcvbnmqwertyuiopasdfghjklzx
Real time operating system
cvbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyuio
Submitted to:
Sir Farhan Mughal

pasdfghjklzxcvbnmqwertyuiopasdfghj
Group members:
Mazeya tariq(11913)
Mohammad Faizan
klzxcvbnmqwertyuiopasdfghjklzxcvbn
Arsalan Ali Qureshi
Mohammad Umar

mqwertyuiopasdfghjklzxcvbnmqwerty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmrty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
Real time operating systems 2011

CONTENTS
(a) Introduction 2

(1)Key characteristics 2

(2) task and task states 3

(3) types of real time OS 3

3.1 Hard real time OS 3

3.2 Soft real time OS 4

(b) Real time scheduling 4

(4) Scheduling algorithm 4

4.1 rate monotonic scheduling 5

4.2 Earliest deadline first approach 5

4.3 advantages of EDF 6

(c) Applications of real time OS 6

References 7

Page 2
Real time operating system 2011

a) INTRODUCTION:

A real-time operating system (RTOS) is an operating system which serves to real-time


application requests. It is not only responsible for managing the hardware resources of a
computer and hosting applications that run on the computer but also performs these tasks to run
applications with very precise timing and with higher degree of reliability. This can be especially
important in measurement and automation systems where downtime is costly or a program delay
could cause a safety hazard. The main point is that, if programmed correctly, an RTOS guarantee
that a program will run with very consistent timing. Real-time operating systems do this by
providing programmers with a high degree of control over how tasks are prioritized, and
typically also allow checking to make sure that important deadlines are met. To be considered
"real-time", an operating system must have a known maximum time for each of the operations
that it performs.

(1) KEY CHARACTERISTIC:

A key characteristic of a RTOS is the level of its consistency concerning the amount of time it
takes to accept and complete an application's task. Real-time OS is valued more for how quickly
or how predictably it can respond than for the amount of work it can perform in a given period of
time, Real-time operating systems are often required in small embedded operating systems that
are packaged as part of microdevices

Page 3
Real time operating systems 2011

(2) Task & Task States:

Each task in RTOS is in one of the following three states


1. Running: The microprocessor is executing the instruction that make up this task. In
single processor systems only one task is running at a time.
2. Ready: means that some other task is running but this task has things that it could do
if processor becomes available.
3. Blocked: this task has nothing to do right now even if microprocessor becomes
available. Tasks get into this state because they are waiting for some external event.

(3) TYPES OF REAL TIME OPERATING SYSTEMS:

There are two types of real time operating systems:

 Hard real-time OS
 Soft real-time OS

3.1 Hard real time operating system:

Operating systems that can absolutely guarantee a maximum time for these operations are
referred to as "hard real-time". This operating system deterministically meets the deadline. A
hard real-time system guarantees that critical tasks complete on time. This goal requires that all
delays in the system be bounded from the retrieval of the stored data to the time that it takes the
operating system to finish any request made of it.

Page 4
Real time operating system 2011

Example: suppose you are designing an airbag system for a new model of car. In this case, a
small error in timing (causing the airbag to deploy too early or too late) could be harmful and can
cause injury. Therefore, a hard real-time system is needed

3.2 Soft real time operating system:

A RTOS that can usually or generally meet a deadline is a soft real-time OS. It is the system
where a critical real-time task gets priority over other tasks and retains that priority until it
completes. As in hard real time systems kernel delays need to be bounded

Example: if you were to design a mobile phone that received streaming video, it may be ok to
lose a small amount of data occasionally even though on average it is important to keep up with
the video stream. For this application, a soft real-time operating system may suffice.

b) REAL TIME SCHEDULING ALGORITHM:

(4) Scheduling algorithm:

This algorithm is systematic method of determining the order in which tasks will be performed
by a computer system, generally incorporated into the operating system.

Some commonly much used RTOS scheduling algorithms are:

 Rate-monotonic scheduling
 Earliest Deadline First approach

Page 5
Real time operating systems 2011

4.1 Rate-monotonic scheduling:


Rate-monotonic scheduling is a scheduling algorithm used in real-time operating systems with a static-
priority scheduling class. The static priorities are assigned on the basis of the cycle duration of the job:
the shorter the cycle duration is, the higher is the job's priority. Rate monotonic scheduling systems
use rate monotonic theory for actually scheduling sets of tasks, rate monotonic analysis can be
used on tasks scheduled by many different systems. We can say that a task is schedulable if the
sum of its preemption, execution, and blocking is less than its deadline. A system is schedulable
if all tasks meet their deadlines. Rate monotonic analysis provides a mathematical and scientific
model for reasoning about schedulability.

Example:

Figure 2 shows that tasks T1 , T2 , T3 with execution times 1, 2, 3 and periods 3, 5, 15 respectively
are feasible using the Rate-Monotonic scheduling algorithm since T1 , T2 , T3 finish execution at
time 1, 3, 14 respectively. T2 is preempted by T1 at time 6 and resume at time 7, T3 is preempted
by T2 at time 5 and resume at time 8, preempted again by task T1 at time 9 and resume at time 13.
Therefore, the total number of preemption times for this task set is 3.

4.2 Earliest Deadline First approach(EDF)

The most important dynamic priority algorithm is Earliest Deadline First (EDF). EDF is an optimal
scheduling algorithm , in the following sense that if a collection of independent jobs, each characterized
by an arrival time, an execution requirement, and a deadline, can be scheduled (by any algorithm) such
that all the jobs complete by their deadlines, the EDF will schedule this collection of jobs such that they
all complete by their deadlines. If two tasks have the same absolute deadlines, it shall choose one
of the two at random. EDF is an optimal algorithm, in the sense that if a task set if schedulable,
then it is schedulable by EDF

 If U > 1 no algorithm can succesfully schedule the task set


 if U <= 1, then the task set is schedulable by EDF (and maybe by other algorithms)

Page 6
Real time operating system 2011

4.3 Advantages of EDF

• There is not need to define priorities


• In general, EDF has less context switches
• Optimality of EDF: We can fully utilize the processor, less idle times.

Example:

Figure 1 above shows the timeline execution for the first job (only) of each task of the task set.
The execution of the jobs is represented by gray rectangles and a black circle states the end of
execution of a job. The priority assignment is done according to the absolute deadline That is, at
a specific time instant the job that is executing is the one with the earliest deadline of all active
jobs.

(c) APPLICATIONS OF REAL TIME OPERATING SYSTEMS:

Real-time operating systems are typically designed to run one application very reliably and with
precise timing. Some of the popular RTOSs are reviewed here to identify their salient features which
make them suitable for different embedded real-time applications

 Windows NT: The overall architecture is good and may be a suitable RTOS for control systems
that need a good user interface and can tolerate the heavy recourse requirements demanded for
installation. It needs hard disk and a powerful processor. Configuration and user interaction
requires a dedicated screen and keyboard.
 Linux provides a few basic features to support real-time applications Provides soft-real time guarantees
 LabVIEW software helps you create hard real-time systems with precise timing,
deterministic I/O, and reliable communication much faster than with traditional development
tools
 The Keil RTX is a royalty-free, deterministic Real-Time Operating System designed for ARM and
Cortex-M devices. It allows you to create programs that simultaneously perform multiple functions
and helps to create applications which are better structured and more easily maintained.

Page 7
Real time operating systems 2011

References//:
http://en.wikipedia.org/wiki/Rate-monotonic_scheduling#Priority_inheritance

http://www.cis.upenn.edu/~lee/06cse480/lec-RTOS_RTlinux.pdf

http://wikipedia.com

http://google.com

Page 8

You might also like