SlideShare a Scribd company logo
RTOS Concepts Part 1
Operating System
• Operating system is the software which is used as interface between
user and hardware.
• It provide uniform access to hardware for the user
• Operating system goals:
– Execute user programs and
make solving user problems easier.
– Make the computer system
convenient to use.
– Use the computer hardware
in an. efficient manner
• Ex:- Windows, Linux, Solaris etc
Real time system
• Real-time systems are defined as those systems in which the correctness of
the system depends not only on the logical result of computation, but also on
the time at which the results are produced.
• In such a type of system result must be obtained within the limited time
constraints.
• If result is not obtained within limited time then result may be incorrect or no
meaning of that result.
Typical Real-time System
Example of a Real Time System
Consider a real-time system comprised of three motors and three switches.
The switches have two positions, ON and OFF.
The switches must be scanned at about 10 times per second,
and the motors turned on or off as appropriate.
S1 S2 S3
M1 M2 M3
Example System
0 100 200 300 400 500 600 700 800 900 1000 msecs
Example of a Real Time System
void main(void)
{
int i;
while(1)
{
for (i= 0; i < 3; i++ )
{
if (switchChanged(i))
changeMotor(i);
}
}
} .
S1 S2 S3
M1 M2 M3
Example of a Real Time System
void main(void)
{
while(1)
{
if (OneTenthSecondIsUp)
{
for (i= 0; i < 3; i++ )
{
if (switchChanged(i))
changeMotor(i);
}
OneTenthSecondIsUp = 0;
}
} .
S1 S2 S3
M1 M2 M3
Adding one sensor
Let a pressure gage must be checked every 50 milliseconds
A valve opened if the pressure is greater than 100 psi.
Once opened, the valve must be closed after the pressure drops below 90 psi.
S1 S2 S3
M1 M2 M3
Example System
0 100 200 300 400 500 600 700 800 900 1000 msecs
50 150 250 350 450 550 650 750 850 950 1000 msecs
Example
if (FiftyMsIsUp)
{
switch (valveState)
{
case CLOSED:
if (pressure() > 100)
{
openValve();
valveState = OPEN;
}
break;
case OPEN:
if (pressure() < 90)
{
closeValve();
valveState = CLOSED;
}
}
FiftyMsIsUp = 0;
}
S1 S2 S3
M1 M2 M3
Let us add datagrams (data packets)
Assume that the system is connected to a network
and that incoming datagrams must be processed.
This could be handled by adding yet another function call to the loop.
checkDatagrams();
S1 S2 S3
M1 M2 M3
DATA
Example System
0 100 200 300 400 500 600 700 800 900 1000 msecs
50 150 250 350 450 550 650 750 850 950 1000 msecs
Let us handle datagrams (data packets)
if the function checkDataGrams is not called at a sufficient rate,
datagrams can be lost.
In order to avoid this,
a queue must be created so that when the interrupt service routine for incoming
datagrams is entered
, the datagram is placed into a queue for processing by the function
checkDatagrams. . S1 S2 S3
M1 M2 M3
DATA
Final code for our system…
Void main()
{
While(1)
{
checkMotorSwitches();
checkPressure();
checkDatagrams();
}
}
S1 S2 S3
M1 M2 M3
DATA
Final code for our system Drawback…
there are no priorities
Busy waiting should not there
and more responsibility (e.g. timer management) is put on the programmer.
User has to manage queue
Priority to task is not given
RTOS Solution…
Three tasks
First Task ------------
Second Task ---------------
Third Task
void checkDatagrams(void)
{
typeMsg * msg;
while (TRUE)
{
msg = waitMsg(DATA_GRAM);
processDataGram(msg);
freeMsg(msg);
}
}
RTOS Solution…
Main Code
----------------------
#include <RTOS.h>
Void main()
{
InitRTOS();
Createtask (checkmotorswitches (),1);
Createtask (checkPressure(),2 );
Createtask (checkDatagrams(),3 );
StartSchedular();
}
Advantages
1. Busy waiting is eliminated.
2. Timer management is no longer a concern of the programmer.
3. checkPressure does not have to retain a state variable.
4. Queue development and management is no longer a concern of the
programmer.
5. Kernel API
1. waitMSG()
2. Pause()
3. freeMSG()
4. Createtask()
5. StartSchedular()
OS Used in Embedded System
Non Real Time
Embedded OS
Real Time OS Handheld/ Mobile OS
Embedded Linux
( kernel 2.4.x)
(www.embedded-linux.org)
www.ghs.com
QNX Neutrino (QNX Software Ltd.)
(www.qnx.com)
VxWorks (Wind River)
(www.windriver.com)
MicroC/OS-II (Jean J. Labross)
(http://www.micrium.com/)
Linux (Kernel 2.6.x)
(www.linyx.org)
Symbian OS
(www.symbian.com)
Windows CE
http://windowsce.com/
OS Used in Embedded System
OS Used in Embedded System
OS Used in Embedded System
OS Used in Embedded System
OS Used in Embedded System
OS Used in Embedded System
Open Source RTOS
1. ucLinux www.uclinux.org
2. Symbian www.symbian.org
3. Linux Kernel 2.6.x www.kernel.org
4. Ecos http://ecos.sourceware.org
5. NemuetOS http://www.menuetos.net/
6. FreeRTOS www.freertos.org
7. RTEM http://www.rtems.com/
8. Solaris www.sun.com
9. etc
Open Source RTOS
Open Source RTOS
Open Source RTOS
Open Source RTOS
Open Source RTOS
Real time Operating system
- Real time operating systems are used as OS in real time system.
- In RTOS tasks are completed in given time constraints.
- RTOS is a multitasking system where multiple tasks run concurrently
- system shifts from task to task
- must remember key registers of each task
(this is called context of task)
Characteristics of Real time Operating system
• Single purpose
• Small size
• Inexpensively mass-produced
• Specific timing requirements
Example of RTOS
.
- INTEGRITY, VelOSity and µvelOSity From Green hills co
www.ghs.com
-RTLinux and VxWorks From Windriver
-www.windriver.com
-µC/OS-II from Micrium
- PowerPac from IAR
-www.iar.com
Real time Operating system categories
Two types
Soft RTOS
SOFT real-time system, tasks are
performed by the system as fast as
possible, but the tasks don't have to finish
by specific times
Hard RTOS
In HARD real-time systems, tasks have
to be performed not only correctly but
on time
Real time System Pitfalls -1: Patriot Missile
When the system turned on then it measure the time in 100 ms. Intervals.
This value is multiplied by 10 to obtain second.
The calculation was performed in 24 bit floating register.
So, value of 1/10 th second is truncated in 24 bits
where as exact value is 0.00011 00110 01100 11001 1001100…
So, if value was truncated then en error occurred. (3.4 ms per hour)
The patriot missile was switched on for about 100 hours, so the accumulated error
was 0.34 second.
Scud travels at speed of 1,676 mps, i.e. more then half a kilometer in 0.34 second.
So, patriot could not intercept the scud.
During 1991 Gulf war, an Iraqi Scud Missile hit an American
army barrack killing many soldiers.
Actually an American patriot missile could not track and
intercept the scud missile.
Reason:
A software bug in patriotic missile
Real time System Pitfalls -2: Lockheed Martin
In 1998 Lockheed Martin Titan 4 booster carrying a $1 billion LockMart Vortex
Class Spy satellite pitched sideways and exploded 40 seconds after liftoff cape
Canaveral, Fla.
Reason:
Fried wiring that had not been inspected. The guidance system remain without
power for fraction of second.
Real time System Pitfalls -3: Mars Orbiter
One of the mars orbiter probe crashed into the planet in 1999.
It did turn out that engineers who build the Mars Climate orbiter had provided a
data table in “proud force” rather then Newton's, the metric measure of force.
$125 Million Dollar lost
Reason:
NASA flight controllers at jet propulsion laboratory in pasadena calif., had used the
faulty table for their navigation calculations during the long trip from Earth to Mars.
Real time System Pitfalls -3: Mars Orbiter
One of the mars orbiter probe crashed into the planet in 1999.
It did turn out that engineers who build the Mars Climate orbiter had provided a
data table in “proud force” rather then Newton's, the metric measure of force.
$125 Million Dollar lost
Reason:
NASA flight controllers at jet propulsion laboratory in pasadena calif., had used the
faulty table for their navigation calculations during the long trip from Earth to Mars.
Real time System Pitfalls - 4: The Ariane 5 satelite launch rocket
Rocket self destructed in 4 June -1996.
Exactly after 40 second of lift off at an attitude of 3700 meters, the
launcher exploded and became a ball of fire.
Cost: $500 Million USD
Reason:
Bad floating-point exception handling.
A 64 bit floating no is converted into 16 bit signed value.
During one calculation the converted value was more then of 16
bit.
This error is know as “500 million dollar software error”
End of Part 1

More Related Content

PPT
Robot operating systems (ros) overview & (1)
PPTX
Rtos concepts
PDF
Ins and Outs of GPIO Programming
 
PPT
Rtos
PDF
Vx works RTOS
PPT
Embedded firmware
 
PPTX
Hardware Software Codesign
PDF
Unit II Arm7 Thumb Instruction
Robot operating systems (ros) overview & (1)
Rtos concepts
Ins and Outs of GPIO Programming
 
Rtos
Vx works RTOS
Embedded firmware
 
Hardware Software Codesign
Unit II Arm7 Thumb Instruction

What's hot (20)

PDF
PPTX
Introduction to RTOS
PPT
Real time-embedded-system-lec-02
PDF
DSP Processor
PPT
Utran architecture(rashmi)
PPTX
Real Time Kernels
PPTX
Embedded systems
PPTX
Introduction to arm processor
PPTX
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
PPTX
OFDM
PPTX
A-Basic-Cellular-System-Connected-to-PSTN
PPTX
Timer counter in arm7(lpc2148)
PPTX
PIC Microcontrollers
PPTX
Lecture 09: Localization and Mapping III
PPT
Driving large capacitive loads
PPTX
Fm demodulation using zero crossing detector
PPTX
Quantum Computing: Welcome to the Future
PPT
Earth Station Subsystem
PPTX
Lcd interfacing with microprocessor 8051
PPT
ARM Micro-controller
Introduction to RTOS
Real time-embedded-system-lec-02
DSP Processor
Utran architecture(rashmi)
Real Time Kernels
Embedded systems
Introduction to arm processor
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
OFDM
A-Basic-Cellular-System-Connected-to-PSTN
Timer counter in arm7(lpc2148)
PIC Microcontrollers
Lecture 09: Localization and Mapping III
Driving large capacitive loads
Fm demodulation using zero crossing detector
Quantum Computing: Welcome to the Future
Earth Station Subsystem
Lcd interfacing with microprocessor 8051
ARM Micro-controller
Ad

Viewers also liked (6)

PDF
Real Time Systems
PPT
E.s unit 6
PPT
E.s unit 4 and 5
PPTX
Embedded System Tools ppt
PDF
Unit 4 Real Time Operating System
PPTX
Real time Operating System
Real Time Systems
E.s unit 6
E.s unit 4 and 5
Embedded System Tools ppt
Unit 4 Real Time Operating System
Real time Operating System
Ad

Similar to REAL TIME OPERATING SYSTEM PART 1 (20)

PPT
1230 Rtf Final
PPTX
RTOS [Autosaved].pptx
PPT
21-Classification of Real time system-12-02-2025.ppt
PPTX
OVERVIEW OF RTOS
PPTX
Embtjhofigkjgzyuibchvjkheddejfjhgjhjgkmd system-3.pptx
PPTX
REAL TIME OPERATING SYSTEM
PPT
Os Concepts
PPT
Rtos 2
PPT
13009690.ppt
PPT
Rtos
PPTX
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
PPT
Rtos
PPTX
Real Time OS For Embedded Systems
PDF
Embedded system software
DOC
UNIT-I-RTOS and Concepts
PPT
Real Time Systems &amp; RTOS
PDF
Embedded OS and Application-2024-01 Embedded system introduction.pdf
PPTX
Embedded system-3 is a note given to fourth year students at Gambella univers...
PPTX
Embedded os
PDF
Realtime embedded systems
1230 Rtf Final
RTOS [Autosaved].pptx
21-Classification of Real time system-12-02-2025.ppt
OVERVIEW OF RTOS
Embtjhofigkjgzyuibchvjkheddejfjhgjhjgkmd system-3.pptx
REAL TIME OPERATING SYSTEM
Os Concepts
Rtos 2
13009690.ppt
Rtos
Real Time Operating Systems, Dynamic Precision: Exploring the Realm of Real-...
Rtos
Real Time OS For Embedded Systems
Embedded system software
UNIT-I-RTOS and Concepts
Real Time Systems &amp; RTOS
Embedded OS and Application-2024-01 Embedded system introduction.pdf
Embedded system-3 is a note given to fourth year students at Gambella univers...
Embedded os
Realtime embedded systems

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Network Security Unit 5.pdf for BCA BBA.
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
sap open course for s4hana steps from ECC to s4
MYSQL Presentation for SQL database connectivity

REAL TIME OPERATING SYSTEM PART 1

  • 2. Operating System • Operating system is the software which is used as interface between user and hardware. • It provide uniform access to hardware for the user • Operating system goals: – Execute user programs and make solving user problems easier. – Make the computer system convenient to use. – Use the computer hardware in an. efficient manner • Ex:- Windows, Linux, Solaris etc
  • 3. Real time system • Real-time systems are defined as those systems in which the correctness of the system depends not only on the logical result of computation, but also on the time at which the results are produced. • In such a type of system result must be obtained within the limited time constraints. • If result is not obtained within limited time then result may be incorrect or no meaning of that result.
  • 5. Example of a Real Time System Consider a real-time system comprised of three motors and three switches. The switches have two positions, ON and OFF. The switches must be scanned at about 10 times per second, and the motors turned on or off as appropriate. S1 S2 S3 M1 M2 M3
  • 6. Example System 0 100 200 300 400 500 600 700 800 900 1000 msecs
  • 7. Example of a Real Time System void main(void) { int i; while(1) { for (i= 0; i < 3; i++ ) { if (switchChanged(i)) changeMotor(i); } } } . S1 S2 S3 M1 M2 M3
  • 8. Example of a Real Time System void main(void) { while(1) { if (OneTenthSecondIsUp) { for (i= 0; i < 3; i++ ) { if (switchChanged(i)) changeMotor(i); } OneTenthSecondIsUp = 0; } } . S1 S2 S3 M1 M2 M3
  • 9. Adding one sensor Let a pressure gage must be checked every 50 milliseconds A valve opened if the pressure is greater than 100 psi. Once opened, the valve must be closed after the pressure drops below 90 psi. S1 S2 S3 M1 M2 M3
  • 10. Example System 0 100 200 300 400 500 600 700 800 900 1000 msecs 50 150 250 350 450 550 650 750 850 950 1000 msecs
  • 11. Example if (FiftyMsIsUp) { switch (valveState) { case CLOSED: if (pressure() > 100) { openValve(); valveState = OPEN; } break; case OPEN: if (pressure() < 90) { closeValve(); valveState = CLOSED; } } FiftyMsIsUp = 0; } S1 S2 S3 M1 M2 M3
  • 12. Let us add datagrams (data packets) Assume that the system is connected to a network and that incoming datagrams must be processed. This could be handled by adding yet another function call to the loop. checkDatagrams(); S1 S2 S3 M1 M2 M3 DATA
  • 13. Example System 0 100 200 300 400 500 600 700 800 900 1000 msecs 50 150 250 350 450 550 650 750 850 950 1000 msecs
  • 14. Let us handle datagrams (data packets) if the function checkDataGrams is not called at a sufficient rate, datagrams can be lost. In order to avoid this, a queue must be created so that when the interrupt service routine for incoming datagrams is entered , the datagram is placed into a queue for processing by the function checkDatagrams. . S1 S2 S3 M1 M2 M3 DATA
  • 15. Final code for our system… Void main() { While(1) { checkMotorSwitches(); checkPressure(); checkDatagrams(); } } S1 S2 S3 M1 M2 M3 DATA
  • 16. Final code for our system Drawback… there are no priorities Busy waiting should not there and more responsibility (e.g. timer management) is put on the programmer. User has to manage queue Priority to task is not given
  • 17. RTOS Solution… Three tasks First Task ------------ Second Task --------------- Third Task void checkDatagrams(void) { typeMsg * msg; while (TRUE) { msg = waitMsg(DATA_GRAM); processDataGram(msg); freeMsg(msg); } }
  • 18. RTOS Solution… Main Code ---------------------- #include <RTOS.h> Void main() { InitRTOS(); Createtask (checkmotorswitches (),1); Createtask (checkPressure(),2 ); Createtask (checkDatagrams(),3 ); StartSchedular(); }
  • 19. Advantages 1. Busy waiting is eliminated. 2. Timer management is no longer a concern of the programmer. 3. checkPressure does not have to retain a state variable. 4. Queue development and management is no longer a concern of the programmer. 5. Kernel API 1. waitMSG() 2. Pause() 3. freeMSG() 4. Createtask() 5. StartSchedular()
  • 20. OS Used in Embedded System Non Real Time Embedded OS Real Time OS Handheld/ Mobile OS Embedded Linux ( kernel 2.4.x) (www.embedded-linux.org) www.ghs.com QNX Neutrino (QNX Software Ltd.) (www.qnx.com) VxWorks (Wind River) (www.windriver.com) MicroC/OS-II (Jean J. Labross) (http://www.micrium.com/) Linux (Kernel 2.6.x) (www.linyx.org) Symbian OS (www.symbian.com) Windows CE http://windowsce.com/
  • 21. OS Used in Embedded System
  • 22. OS Used in Embedded System
  • 23. OS Used in Embedded System
  • 24. OS Used in Embedded System
  • 25. OS Used in Embedded System
  • 26. OS Used in Embedded System
  • 27. Open Source RTOS 1. ucLinux www.uclinux.org 2. Symbian www.symbian.org 3. Linux Kernel 2.6.x www.kernel.org 4. Ecos http://ecos.sourceware.org 5. NemuetOS http://www.menuetos.net/ 6. FreeRTOS www.freertos.org 7. RTEM http://www.rtems.com/ 8. Solaris www.sun.com 9. etc
  • 33. Real time Operating system - Real time operating systems are used as OS in real time system. - In RTOS tasks are completed in given time constraints. - RTOS is a multitasking system where multiple tasks run concurrently - system shifts from task to task - must remember key registers of each task (this is called context of task)
  • 34. Characteristics of Real time Operating system • Single purpose • Small size • Inexpensively mass-produced • Specific timing requirements
  • 35. Example of RTOS . - INTEGRITY, VelOSity and µvelOSity From Green hills co www.ghs.com -RTLinux and VxWorks From Windriver -www.windriver.com -µC/OS-II from Micrium - PowerPac from IAR -www.iar.com
  • 36. Real time Operating system categories Two types Soft RTOS SOFT real-time system, tasks are performed by the system as fast as possible, but the tasks don't have to finish by specific times Hard RTOS In HARD real-time systems, tasks have to be performed not only correctly but on time
  • 37. Real time System Pitfalls -1: Patriot Missile When the system turned on then it measure the time in 100 ms. Intervals. This value is multiplied by 10 to obtain second. The calculation was performed in 24 bit floating register. So, value of 1/10 th second is truncated in 24 bits where as exact value is 0.00011 00110 01100 11001 1001100… So, if value was truncated then en error occurred. (3.4 ms per hour) The patriot missile was switched on for about 100 hours, so the accumulated error was 0.34 second. Scud travels at speed of 1,676 mps, i.e. more then half a kilometer in 0.34 second. So, patriot could not intercept the scud. During 1991 Gulf war, an Iraqi Scud Missile hit an American army barrack killing many soldiers. Actually an American patriot missile could not track and intercept the scud missile. Reason: A software bug in patriotic missile
  • 38. Real time System Pitfalls -2: Lockheed Martin In 1998 Lockheed Martin Titan 4 booster carrying a $1 billion LockMart Vortex Class Spy satellite pitched sideways and exploded 40 seconds after liftoff cape Canaveral, Fla. Reason: Fried wiring that had not been inspected. The guidance system remain without power for fraction of second.
  • 39. Real time System Pitfalls -3: Mars Orbiter One of the mars orbiter probe crashed into the planet in 1999. It did turn out that engineers who build the Mars Climate orbiter had provided a data table in “proud force” rather then Newton's, the metric measure of force. $125 Million Dollar lost Reason: NASA flight controllers at jet propulsion laboratory in pasadena calif., had used the faulty table for their navigation calculations during the long trip from Earth to Mars.
  • 40. Real time System Pitfalls -3: Mars Orbiter One of the mars orbiter probe crashed into the planet in 1999. It did turn out that engineers who build the Mars Climate orbiter had provided a data table in “proud force” rather then Newton's, the metric measure of force. $125 Million Dollar lost Reason: NASA flight controllers at jet propulsion laboratory in pasadena calif., had used the faulty table for their navigation calculations during the long trip from Earth to Mars.
  • 41. Real time System Pitfalls - 4: The Ariane 5 satelite launch rocket Rocket self destructed in 4 June -1996. Exactly after 40 second of lift off at an attitude of 3700 meters, the launcher exploded and became a ball of fire. Cost: $500 Million USD Reason: Bad floating-point exception handling. A 64 bit floating no is converted into 16 bit signed value. During one calculation the converted value was more then of 16 bit. This error is know as “500 million dollar software error”