SlideShare a Scribd company logo
Real Time Operating systems
(RTOS) concepts
Abu Bakr Mohamed Ramadan
Eng.abubakr88@gmail.com
Content:
• Task Context.
• Context Switching between tasks.
• Shared Data Problem.
• Non Reentrant Function.
• Reentrant Function.
• Gray area of reentrancy.
• How to protect Shared Data?
• References and Read more
Task Context
• Every task has it’s own context (it’s own Data).
• Every Task Created has it’s own data structure called
Task Control Block (TCB).
• Task saves it’s data like: tasks status, ID , priority, stack
pointer, Pointer to function( task itself) ……, in it’s TCB.
• Task context also saved in it’s own stack and CPU registers.
Context Switching between tasks
• Context switching : Is how to switch the processor between
the context of one task to the another, so the system must:
• Save the state of the old process,
• Then load the saved state for the new process,
• The new process continues from where it left off just before the
context switch.
• When the task is not running, its context is frozen within the
TCB, to be restored the next time the task runs.
• The Dispatcher :
• Is the part of the scheduler that performs context switching.
Context Switching between tasks Cont.
• Context Switch Time: Is the time it takes for the scheduler to
switch from one task to another.
• frequent context switching
makes a performance overhead.
Context Switching between tasks Cont.
Context Switching between tasks Cont.
Context Switching between tasks Cont.
TCB
Context Switching between tasks Cont.
TCB
Context Switching between tasks Cont.
Context Switching between tasks Cont.
Shared Data Problem.
Non Reentrant Function.
• Is a function that can’t be used between more than one task.
• Can’t be interrupted or a data loss will happen.
• Example:
Reentrant Function.
• Is a function that can be used between more than one task with out fear of
data corruption.
• Can be interrupted at any time and resumed without loss of data.
• Reentrant functions either:
• Use local variables, Or use protected global variables.
• Can’t Call other non reentrant function.
Gray area of reentrancy
• Some Functions and some operation on a shared data are
processor and compiler dependent.
• Example:
• printf() Function Is reentrant or non reentrant?
• The answer is it’s depend on the processor and on the compiler.
• A++
How to protect Shared Data?
• Using Mutual Exclusion access.
• Examples on Mutual Exclusion methods are:
• Disable and enable interrupts,
• Disabling Scheduling, and
• Using Semaphores.
References and Read more:
• Real-Time Concepts for Embedded Systems book by Qing Li and
Carolyn.
• http://www.e-reading.club/book.php?book=102147
• An Embedded Software Primer by David E. Simon.
• http://www.amazon.com/Embedded-Software-Primer-David-
Simon/dp/020161569X
• Linux Kernel Embedded Systems Building Blocks 2e by Jean J.
Labrosse.
• http://www.amazon.com/Embedded-Systems-Building-Blocks-
Ready/dp/0879306041
• FreeRTOS website.
• http://www.freertos.org
Ad

More Related Content

What's hot (20)

Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
Abu Bakr Ramadan
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Murtadha Alsabbagh
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
Sundaresan Sundar
 
Approaches to real time scheduling
Approaches to real time schedulingApproaches to real time scheduling
Approaches to real time scheduling
Kamal Acharya
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)
Naren Chandra
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
prakrutijsh
 
Interrupts
InterruptsInterrupts
Interrupts
Urwa Shanza
 
Real time-system
Real time-systemReal time-system
Real time-system
ysush
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
Himanshu Ghetia
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
Vijay Kumar
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
Emertxe Information Technologies Pvt Ltd
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
University of Computer Science and Technology
 
FreeRTOS introduction
FreeRTOS introductionFreeRTOS introduction
FreeRTOS introduction
Jegadeesh Vontlin
 
Interrupts
InterruptsInterrupts
Interrupts
guest2e9811e
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
anishgoel
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
Hariharan Ganesan
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
Aditya Vichare
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
MOHIT DADU
 
evolution of operating system
evolution of operating systemevolution of operating system
evolution of operating system
Amir Khan
 
Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
Abu Bakr Ramadan
 
Approaches to real time scheduling
Approaches to real time schedulingApproaches to real time scheduling
Approaches to real time scheduling
Kamal Acharya
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)
Naren Chandra
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
REAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
REAL TIME OPERATING SYSTEM
prakrutijsh
 
Real time-system
Real time-systemReal time-system
Real time-system
ysush
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
Himanshu Ghetia
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
Vijay Kumar
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
anishgoel
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
Hariharan Ganesan
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
Aditya Vichare
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
MOHIT DADU
 
evolution of operating system
evolution of operating systemevolution of operating system
evolution of operating system
Amir Khan
 

Similar to Real time operating systems (rtos) concepts 5 (20)

Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2
mohanaps
 
Apache airflow
Apache airflowApache airflow
Apache airflow
Purna Chander
 
Stateful streaming and the challenge of state
Stateful streaming and the challenge of stateStateful streaming and the challenge of state
Stateful streaming and the challenge of state
Yoni Farin
 
dbms.ppt
dbms.pptdbms.ppt
dbms.ppt
ThontadharyaThontadh
 
dbms.ppt
dbms.pptdbms.ppt
dbms.ppt
KRISHNARAJ207
 
dbms.ppt
dbms.pptdbms.ppt
dbms.ppt
GeorgeSamaan9
 
dbms (1).ppt
dbms (1).pptdbms (1).ppt
dbms (1).ppt
UbaidURRahman78
 
Dbms
DbmsDbms
Dbms
Maria Stella Solon
 
Process Control Block (PCB) print 4.pdf
Process Control Block  (PCB) print 4.pdfProcess Control Block  (PCB) print 4.pdf
Process Control Block (PCB) print 4.pdf
fentahunmuluye23
 
Multitasking.pdf good presentation education 8970
Multitasking.pdf good presentation education 8970Multitasking.pdf good presentation education 8970
Multitasking.pdf good presentation education 8970
deepparmar73
 
Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure Data
Taro L. Saito
 
stigbot_beta
stigbot_betastigbot_beta
stigbot_beta
Zachary Job
 
Unit-3.ppt
Unit-3.pptUnit-3.ppt
Unit-3.ppt
surajranjankumar1
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
Sina Madani
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
vishal choudhary
 
Essential concepts of data architectures
Essential concepts of data architecturesEssential concepts of data architectures
Essential concepts of data architectures
Marco Brambilla
 
Lecture 5 inter process communication
Lecture 5 inter process communicationLecture 5 inter process communication
Lecture 5 inter process communication
Kumbirai Junior Muzavazi
 
Unit 1- dbms.ppt
Unit 1- dbms.pptUnit 1- dbms.ppt
Unit 1- dbms.ppt
minnu41
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
morganjohn3
 
2Chapter Two- Process Management(2) (1).pptx
2Chapter Two- Process Management(2) (1).pptx2Chapter Two- Process Management(2) (1).pptx
2Chapter Two- Process Management(2) (1).pptx
jamsibro140
 
Process management in Operating System_Unit-2
Process management in Operating System_Unit-2Process management in Operating System_Unit-2
Process management in Operating System_Unit-2
mohanaps
 
Stateful streaming and the challenge of state
Stateful streaming and the challenge of stateStateful streaming and the challenge of state
Stateful streaming and the challenge of state
Yoni Farin
 
Process Control Block (PCB) print 4.pdf
Process Control Block  (PCB) print 4.pdfProcess Control Block  (PCB) print 4.pdf
Process Control Block (PCB) print 4.pdf
fentahunmuluye23
 
Multitasking.pdf good presentation education 8970
Multitasking.pdf good presentation education 8970Multitasking.pdf good presentation education 8970
Multitasking.pdf good presentation education 8970
deepparmar73
 
Presto At Treasure Data
Presto At Treasure DataPresto At Treasure Data
Presto At Treasure Data
Taro L. Saito
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
Sina Madani
 
SE-coupling and cohesion.ppt
SE-coupling and cohesion.pptSE-coupling and cohesion.ppt
SE-coupling and cohesion.ppt
vishal choudhary
 
Essential concepts of data architectures
Essential concepts of data architecturesEssential concepts of data architectures
Essential concepts of data architectures
Marco Brambilla
 
Unit 1- dbms.ppt
Unit 1- dbms.pptUnit 1- dbms.ppt
Unit 1- dbms.ppt
minnu41
 
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
Module 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModule 2 - PPT.pdfModul...
morganjohn3
 
2Chapter Two- Process Management(2) (1).pptx
2Chapter Two- Process Management(2) (1).pptx2Chapter Two- Process Management(2) (1).pptx
2Chapter Two- Process Management(2) (1).pptx
jamsibro140
 
Ad

Recently uploaded (20)

Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest VersionAdobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
usmanhidray
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest VersionAdobe Photoshop Lightroom CC 2025 Crack Latest Version
Adobe Photoshop Lightroom CC 2025 Crack Latest Version
usmanhidray
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Ad

Real time operating systems (rtos) concepts 5

  • 1. Real Time Operating systems (RTOS) concepts Abu Bakr Mohamed Ramadan [email protected]
  • 2. Content: • Task Context. • Context Switching between tasks. • Shared Data Problem. • Non Reentrant Function. • Reentrant Function. • Gray area of reentrancy. • How to protect Shared Data? • References and Read more
  • 3. Task Context • Every task has it’s own context (it’s own Data). • Every Task Created has it’s own data structure called Task Control Block (TCB). • Task saves it’s data like: tasks status, ID , priority, stack pointer, Pointer to function( task itself) ……, in it’s TCB. • Task context also saved in it’s own stack and CPU registers.
  • 4. Context Switching between tasks • Context switching : Is how to switch the processor between the context of one task to the another, so the system must: • Save the state of the old process, • Then load the saved state for the new process, • The new process continues from where it left off just before the context switch. • When the task is not running, its context is frozen within the TCB, to be restored the next time the task runs. • The Dispatcher : • Is the part of the scheduler that performs context switching.
  • 5. Context Switching between tasks Cont. • Context Switch Time: Is the time it takes for the scheduler to switch from one task to another. • frequent context switching makes a performance overhead.
  • 8. Context Switching between tasks Cont. TCB
  • 9. Context Switching between tasks Cont. TCB
  • 13. Non Reentrant Function. • Is a function that can’t be used between more than one task. • Can’t be interrupted or a data loss will happen. • Example:
  • 14. Reentrant Function. • Is a function that can be used between more than one task with out fear of data corruption. • Can be interrupted at any time and resumed without loss of data. • Reentrant functions either: • Use local variables, Or use protected global variables. • Can’t Call other non reentrant function.
  • 15. Gray area of reentrancy • Some Functions and some operation on a shared data are processor and compiler dependent. • Example: • printf() Function Is reentrant or non reentrant? • The answer is it’s depend on the processor and on the compiler. • A++
  • 16. How to protect Shared Data? • Using Mutual Exclusion access. • Examples on Mutual Exclusion methods are: • Disable and enable interrupts, • Disabling Scheduling, and • Using Semaphores.
  • 17. References and Read more: • Real-Time Concepts for Embedded Systems book by Qing Li and Carolyn. • http://www.e-reading.club/book.php?book=102147 • An Embedded Software Primer by David E. Simon. • http://www.amazon.com/Embedded-Software-Primer-David- Simon/dp/020161569X • Linux Kernel Embedded Systems Building Blocks 2e by Jean J. Labrosse. • http://www.amazon.com/Embedded-Systems-Building-Blocks- Ready/dp/0879306041 • FreeRTOS website. • http://www.freertos.org