SlideShare a Scribd company logo
1 of 34
RTOS
Real Time Operating System

By:
VIVEK. P.PATKAR.
PRAKRUTI. JOSHI.

An example of RTOS implementation on Renesas
automotive dashboard platform.
What is RTOS?


An RTOS is multitasking operating system for
the applications needing meeting of :
a) time deadlines and
b)functioning in real time constraints
Block Diagram of RTOS
Architecture of RTOS
Architecture of RTOS
 An RTOS usually comprises only a kernel. For

more complex embedded systems, an RTOS
can be a combination of various modules,
including the kernel, networking protocol
stacks, and other components as illustrated
previously.
 An operating system generally consists of two
parts: kernel space (kernel mode) and user
space (user mode).
Kernel
The kernel of an RTOS
provides an abstraction
layer between the
application software
and hardware.
 This abstraction layer
comprises of six main
types of common
services provided by the
kernel to the
application software.

KERNEL
There are three broad categories of kernel models available

Monolithic Kernel
E.g.. Examples are Linux
and Windows

Microkernel
E.g. Examples are
AmigaOS and QNX

Exokernel
E.g.. library operating
systems (libOSes)
Classification Of RTOS
RTOS
Hard real time

Firm real time

Zero degree of
tolerance

Unacceptable
quality
reduction

E.g. Automobile engine
control system and anti
lock brake, video
transmission, each picture
frame and
audio must be transferred
at fixed rate.

Soft real time
Reduction in
quality
reduction is
acceptable.

E.g. a food processing
plant control system.
E.g. Mobile phone, digital
cameras and orchestra
playing robots.
Features Of RTOS

Task and
Multitask

Running

Scheduler

Timer
Function

Memory
Management

Dormant
Blocked

Ready

Pre emptive

Non Pre emptive

Inter Task
Communication
Task and Multitask
Context

Switch

E.g.20 MHz 68000 process
or task switch times are
roughly 20 microseconds.
In contrast, a
100 MHz ARM CPU
switches in less than 3
microseconds.
Advantages:

a)Can concentrate all the
talent at a particular task.
b)Debugging is simple.
c)Easy to understand.
Scheduler
Pre emptive Scheduler

It allows high priority task to
run first and move low
priority task which is in
running into ready state.
E.g. Solaris 2.0/SunOS
5.0, Windows NT, the Linux
kernel 2.6 and 3.x, AIX and
some BSD systems (NetBSD,
since version 5), Anroid.
Advantages:
High priority task executed
immediately.
Disadvantages:
Starvation.
Scheduler
Non Pre emptive

Scheduler

High priority task co
operate with low priority
task.
E.g. Windows3.1x, Mac
OS pre-9.

Advantages:
No starvation.
Easy to implement.
Disadvantages:
High priority task has to
wait for low priority task
to complete, thus, not
suitable for RTOS.
Timer Function
 Task delay.

E.g. In μC/OS-II, for a task to delay itself:
OSTimeDly(ticks), where ticks is the number of
clock ticks from the timer;
OSTimeDlyHMSM(H,M,S,M), with Hours, Minutes,
Seconds, Microseconds.


Task alert.

E.g. µC/OS-II use system clock, Vx Works use
watchdog timers
Memory Management
Memory allocated for
each task.
 Memory allocated for
each task control
block(TCB).
 Size of queue.
 Size of mailbox
 Size of pipe


TCB
Inter task Communication

Event

Queue Mailbox

Pipe

Shared Data Protected

Disabling
Task Switch

Semaphore

Disabling
Interrupts

Mutex
Counting
Semaphore Semaphore
Priority Inversion

Spinlock
Semaphore

Dead Lock
Event

Event objects are used when task synchronization is required without resource
sharing. They allow one or more tasks to
keep waiting for a specified event to occur.
Queue
Queue :
E.g. AVR microcontroller, Linux 2.4; Windows
NT/XP/Vista, Mac OS X uses a multilevel feedback
queue, uses a Multilevel feedback queue.
mailbox:
E.g. TI SYS/BIOS v6.33 RTOS, Keil RTX.
Pipe:
E.g. QNX RTOS, SMX RTOS.
Semaphores

E.g. ChibiOS/RT, VxWorks
Binary Semaphore









Whenever it is set, shared data is free.
whenever it is reset shared data is busy.
Whenever a task access shared data it takes
semaphore and the semaphore flag is reset.
Whenever a task exit from shared data it releases
semaphore and the flag is reset.
In this way shared data is protected.
Semaphores

E.g. VxWorks, UNIX
Counting Semaphore







It is semaphore in which value can be
incremented or decremented. it is unsigned
integer.
This semaphore can be taken multiple times.
Taking semaphore means decrementing the
integer.
Releasing the semaphore means incrementing
the integer.
Semaphores

E.g. ChibiOS/RT, VxWorks, CHIP-RTOS-x86 RTX
Spin lock Semaphore








This semaphore will not make running task to
blocked immediately.
Spin lock is useful in following situation:
Suppose low priority task is running and only some
time is left for its completion.
Now high priority task wants to run
Now RTOS provides spin lock semaphore to the high
priority task and so it can spin for some time. During
that time low priority task is executed and by itself it
is moved into blocked state.
Now high priority task begins to run.
RTOS Design
 Size of ISR:
If ISR is long, then there are two drawbacks:



Highest priority task is blocked for more time.
ISR is sensitive to error and so it is difficult to debug long
ISR.
Conclusion:
Size of ISR should be small.
RTOS Design
 Number

of Task:

Advantages:
 Can concentrate all talent at a particular task.
 Debugging is simple.
 Very easy to understand.
Disadvantages:
 More memory needed because each task needs memory.
 Speed is less because task switching needs more time.

Conclusion:
Number of tasks should be moderate.
RTOS Design
 Avoid

creating and destroying task:

It is time consuming and thus speed becomes less.
Conclusion:
Must avoid this.

 Task

structure:

Task designing should be such that task is blocked at the most
only one place.
RTOS Design
 Keep time slicing off:
Task should not have equal priority.

 Techniques





to save memory:

For each task provide stack memory, TCB etc. only as much
needed.
Limit RTOS services.
Do not use same function that does nearly same action.
RTOS Design
 Techniques to save power:






Idle mode.
Power down mode.
Sleep mode.
Low power mode.
Standby mode.
RTOS Design
 Encapsulate








hardware with task:

This type of task is known as sever task.
If hardware is having many tasks, then we must have
separate task to encapsulate the hardware.
This separate task is known as server task.
Whenever task has to access hardware, they give
message in the queue to the server task.
Then server task makes accessing the hardware in
proper manner.
Advantages
 Run time facilities i.e. provision of kernel services.

 Provision for interrupts.
 Task can have priority.
 This architecture can suspend low priority task

and make high priority task run immediately
when need arises.
 Scalable.
 Portable.
Disadvantages
 Cost

is more.
 License.
 Supplier stability/ longevity.
 Availability of Development tools.
Examples
 LynxOS.

 OSE
 QNX
 RTLinux
 Windows
 VxWorks

CE
Applications
 Web

server
 Microwave oven
 MRI(Magnetic Resonance Machine)
 Aircraft control
 Automotive applications:
a) automatic breaking systems.
b) fuel injection.
c) path tracking.
REAL TIME OPERATING SYSTEM

More Related Content

What's hot

RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems Bayar shahab
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Dhaval Kaneria
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time KernelsArnav Soni
 
Arm organization and implementation
Arm organization and implementationArm organization and implementation
Arm organization and implementationShubham Singh
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processorMuhammad Ishaq
 
Module 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingModule 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingAmogha Bandrikalli
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded Systemrmkceteee
 
Components in real time systems
Components in real time systemsComponents in real time systems
Components in real time systemsSaransh Garg
 
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSJOLLUSUDARSHANREDDY
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORGurudev joshi
 

What's hot (20)

Embedded systems basics
Embedded systems basicsEmbedded systems basics
Embedded systems basics
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
 
Ec8791 lpc2148 timer unit
Ec8791 lpc2148 timer unitEc8791 lpc2148 timer unit
Ec8791 lpc2148 timer unit
 
RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems RTOS- Real Time Operating Systems
RTOS- Real Time Operating Systems
 
Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)Serial Peripheral Interface(SPI)
Serial Peripheral Interface(SPI)
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
Arm organization and implementation
Arm organization and implementationArm organization and implementation
Arm organization and implementation
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
 
Module 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingModule 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and Programming
 
ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Components in real time systems
Components in real time systemsComponents in real time systems
Components in real time systems
 
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Embedded System Basics
Embedded System BasicsEmbedded System Basics
Embedded System Basics
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Rtos by shibu
Rtos by shibuRtos by shibu
Rtos by shibu
 
INTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSORINTERRUPTS OF 8086 MICROPROCESSOR
INTERRUPTS OF 8086 MICROPROCESSOR
 

Viewers also liked

リアルタイムOSの必要性とTOPPERS/SSPの紹介
リアルタイムOSの必要性とTOPPERS/SSPの紹介リアルタイムOSの必要性とTOPPERS/SSPの紹介
リアルタイムOSの必要性とTOPPERS/SSPの紹介NSaitoNmiri
 
NiosII と RTOS について
NiosII と RTOS についてNiosII と RTOS について
NiosII と RTOS についてryos36
 
Real time operating-systems
Real time operating-systemsReal time operating-systems
Real time operating-systemskasi963
 
マイコンでマルチタスク
マイコンでマルチタスクマイコンでマルチタスク
マイコンでマルチタスクKatsuhiko Terawaki
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System ConceptsSanjiv Malik
 
Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating SystemDr. Pankaj Zope
 

Viewers also liked (9)

リアルタイムOSの必要性とTOPPERS/SSPの紹介
リアルタイムOSの必要性とTOPPERS/SSPの紹介リアルタイムOSの必要性とTOPPERS/SSPの紹介
リアルタイムOSの必要性とTOPPERS/SSPの紹介
 
G7プレゼンrtos自作
G7プレゼンrtos自作G7プレゼンrtos自作
G7プレゼンrtos自作
 
NiosII と RTOS について
NiosII と RTOS についてNiosII と RTOS について
NiosII と RTOS について
 
Real time operating-systems
Real time operating-systemsReal time operating-systems
Real time operating-systems
 
マイコンでマルチタスク
マイコンでマルチタスクマイコンでマルチタスク
マイコンでマルチタスク
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
 
Unit 4 Real Time Operating System
Unit 4 Real Time Operating SystemUnit 4 Real Time Operating System
Unit 4 Real Time Operating System
 
RTOS Basic Concepts
RTOS Basic ConceptsRTOS Basic Concepts
RTOS Basic Concepts
 

Similar to REAL TIME OPERATING SYSTEM

Similar to REAL TIME OPERATING SYSTEM (20)

RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Lab6 rtos
Lab6 rtosLab6 rtos
Lab6 rtos
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
Rtos
RtosRtos
Rtos
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Rtos ss
Rtos ssRtos ss
Rtos ss
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
Lecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptxLecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptx
 
Embedded os
Embedded osEmbedded os
Embedded os
 
Lab3F22.pdf
Lab3F22.pdfLab3F22.pdf
Lab3F22.pdf
 
rtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdfrtosbyshibu-131026100746-phpapp01.pdf
rtosbyshibu-131026100746-phpapp01.pdf
 
rtos.ppt
rtos.pptrtos.ppt
rtos.ppt
 
1230 Rtf Final
1230 Rtf Final1230 Rtf Final
1230 Rtf Final
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time Java
 
Realtime
RealtimeRealtime
Realtime
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 

Recently uploaded

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 

REAL TIME OPERATING SYSTEM

  • 1. RTOS Real Time Operating System By: VIVEK. P.PATKAR. PRAKRUTI. JOSHI. An example of RTOS implementation on Renesas automotive dashboard platform.
  • 2. What is RTOS?  An RTOS is multitasking operating system for the applications needing meeting of : a) time deadlines and b)functioning in real time constraints
  • 5. Architecture of RTOS  An RTOS usually comprises only a kernel. For more complex embedded systems, an RTOS can be a combination of various modules, including the kernel, networking protocol stacks, and other components as illustrated previously.  An operating system generally consists of two parts: kernel space (kernel mode) and user space (user mode).
  • 6. Kernel The kernel of an RTOS provides an abstraction layer between the application software and hardware.  This abstraction layer comprises of six main types of common services provided by the kernel to the application software. 
  • 7. KERNEL There are three broad categories of kernel models available Monolithic Kernel E.g.. Examples are Linux and Windows Microkernel E.g. Examples are AmigaOS and QNX Exokernel E.g.. library operating systems (libOSes)
  • 8. Classification Of RTOS RTOS Hard real time Firm real time Zero degree of tolerance Unacceptable quality reduction E.g. Automobile engine control system and anti lock brake, video transmission, each picture frame and audio must be transferred at fixed rate. Soft real time Reduction in quality reduction is acceptable. E.g. a food processing plant control system. E.g. Mobile phone, digital cameras and orchestra playing robots.
  • 9. Features Of RTOS Task and Multitask Running Scheduler Timer Function Memory Management Dormant Blocked Ready Pre emptive Non Pre emptive Inter Task Communication
  • 10. Task and Multitask Context Switch E.g.20 MHz 68000 process or task switch times are roughly 20 microseconds. In contrast, a 100 MHz ARM CPU switches in less than 3 microseconds. Advantages: a)Can concentrate all the talent at a particular task. b)Debugging is simple. c)Easy to understand.
  • 11. Scheduler Pre emptive Scheduler It allows high priority task to run first and move low priority task which is in running into ready state. E.g. Solaris 2.0/SunOS 5.0, Windows NT, the Linux kernel 2.6 and 3.x, AIX and some BSD systems (NetBSD, since version 5), Anroid. Advantages: High priority task executed immediately. Disadvantages: Starvation.
  • 12. Scheduler Non Pre emptive Scheduler High priority task co operate with low priority task. E.g. Windows3.1x, Mac OS pre-9. Advantages: No starvation. Easy to implement. Disadvantages: High priority task has to wait for low priority task to complete, thus, not suitable for RTOS.
  • 13. Timer Function  Task delay. E.g. In μC/OS-II, for a task to delay itself: OSTimeDly(ticks), where ticks is the number of clock ticks from the timer; OSTimeDlyHMSM(H,M,S,M), with Hours, Minutes, Seconds, Microseconds.  Task alert. E.g. µC/OS-II use system clock, Vx Works use watchdog timers
  • 14. Memory Management Memory allocated for each task.  Memory allocated for each task control block(TCB).  Size of queue.  Size of mailbox  Size of pipe  TCB
  • 15. Inter task Communication Event Queue Mailbox Pipe Shared Data Protected Disabling Task Switch Semaphore Disabling Interrupts Mutex Counting Semaphore Semaphore Priority Inversion Spinlock Semaphore Dead Lock
  • 16. Event Event objects are used when task synchronization is required without resource sharing. They allow one or more tasks to keep waiting for a specified event to occur.
  • 17. Queue Queue : E.g. AVR microcontroller, Linux 2.4; Windows NT/XP/Vista, Mac OS X uses a multilevel feedback queue, uses a Multilevel feedback queue. mailbox: E.g. TI SYS/BIOS v6.33 RTOS, Keil RTX. Pipe: E.g. QNX RTOS, SMX RTOS.
  • 19. Binary Semaphore      Whenever it is set, shared data is free. whenever it is reset shared data is busy. Whenever a task access shared data it takes semaphore and the semaphore flag is reset. Whenever a task exit from shared data it releases semaphore and the flag is reset. In this way shared data is protected.
  • 21. Counting Semaphore     It is semaphore in which value can be incremented or decremented. it is unsigned integer. This semaphore can be taken multiple times. Taking semaphore means decrementing the integer. Releasing the semaphore means incrementing the integer.
  • 23. Spin lock Semaphore       This semaphore will not make running task to blocked immediately. Spin lock is useful in following situation: Suppose low priority task is running and only some time is left for its completion. Now high priority task wants to run Now RTOS provides spin lock semaphore to the high priority task and so it can spin for some time. During that time low priority task is executed and by itself it is moved into blocked state. Now high priority task begins to run.
  • 24. RTOS Design  Size of ISR: If ISR is long, then there are two drawbacks:   Highest priority task is blocked for more time. ISR is sensitive to error and so it is difficult to debug long ISR. Conclusion: Size of ISR should be small.
  • 25. RTOS Design  Number of Task: Advantages:  Can concentrate all talent at a particular task.  Debugging is simple.  Very easy to understand. Disadvantages:  More memory needed because each task needs memory.  Speed is less because task switching needs more time. Conclusion: Number of tasks should be moderate.
  • 26. RTOS Design  Avoid creating and destroying task: It is time consuming and thus speed becomes less. Conclusion: Must avoid this.  Task structure: Task designing should be such that task is blocked at the most only one place.
  • 27. RTOS Design  Keep time slicing off: Task should not have equal priority.  Techniques    to save memory: For each task provide stack memory, TCB etc. only as much needed. Limit RTOS services. Do not use same function that does nearly same action.
  • 28. RTOS Design  Techniques to save power:      Idle mode. Power down mode. Sleep mode. Low power mode. Standby mode.
  • 29. RTOS Design  Encapsulate     hardware with task: This type of task is known as sever task. If hardware is having many tasks, then we must have separate task to encapsulate the hardware. This separate task is known as server task. Whenever task has to access hardware, they give message in the queue to the server task. Then server task makes accessing the hardware in proper manner.
  • 30. Advantages  Run time facilities i.e. provision of kernel services.  Provision for interrupts.  Task can have priority.  This architecture can suspend low priority task and make high priority task run immediately when need arises.  Scalable.  Portable.
  • 31. Disadvantages  Cost is more.  License.  Supplier stability/ longevity.  Availability of Development tools.
  • 32. Examples  LynxOS.  OSE  QNX  RTLinux  Windows  VxWorks CE
  • 33. Applications  Web server  Microwave oven  MRI(Magnetic Resonance Machine)  Aircraft control  Automotive applications: a) automatic breaking systems. b) fuel injection. c) path tracking.