SlideShare a Scribd company logo
1 of 8
Real Time Operating systems
(RTOS) concepts
Abu Bakr Mohamed Ramadan
Eng.abubakr88@gmail.com
Content:
• The Scheduler.
• What if two tasks have the same priority are ready?
• Task object data.
• System tasks.
• Hello World application using RTOS.
• References and Read more
RTOS Scheduler.
• Scheduler the core Component of any RTOS kernel,
• Its a set of algorithms that determines which task executes when.
• It’s keeping track on the status of each task, and decides which to
run.
• In Most RTOSs the developers is the one who sets the priority of
each task, regarding to this priority the scheduler will decide which
task will run.
• The scheduler assumes that you knew what you where doing while
setting tasks priority.
• A bad design for tasks priority, may leads to a high priority task hogs
the processor for long time, this is called CPU starvation.
RTOS Scheduler.
• It’s keeping track on the status of each task, and decides which
to run.
• Scheduler has no control on tasks on the blocked status.
• If tasks are blocked the scheduler waits an event to unblock
this tasks, like an external interrupt from pushing a button.
• If no events happened, surely it’s a bad design from your side.
Whatiftwotaskshave thesamepriorityareready?
• Some RTOSs make it illegal to set two tasks with the same
priority, and here the kernel limits the number of tasks in an
application to the number of priority levels.
• Others will time slice between the two tasks(Round robin).
• Some will run one task until it blocks, then run the other task.
Task object data
• Each task has an associated:
• a name,
• a unique ID,
• a priority,
• a task control block (TCB),
• a stack,
• and a task routine,
Hello World application using RTOS.
void hello_world1_task(void* p)
{
while(1) {
puts("Hello World1!");
vTaskDelay(1000);
}
}
void hello_world2_task(void* p)
{
while(1) {
puts("Hello World2!");
vTaskDelay(1000);
}
}
int main()
{
xTaskCreate(hello_world1_task, (signed char*)"task_name", STACK_BYTES(2048), 0, 1, 0);
xTaskCreate(hello_world2_task, (signed char*)"task_name", STACK_BYTES(2048), 0, 1, 0);
vTaskStartScheduler();
return 0;
}
Two Tasks
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

More Related Content

What's hot

Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos conceptsanishgoel
 
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 SystemsAditya Vichare
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals哲豪 康哲豪
 
Real time operating system
Real time operating systemReal time operating system
Real time operating systemKhuram Shahzad
 
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
 
Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Ceph Community
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ESJOLLUSUDARSHANREDDY
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDKKernel TLV
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingFastBit Embedded Brain Academy
 
Concurrent programming with RTOS
Concurrent programming with RTOSConcurrent programming with RTOS
Concurrent programming with RTOSSirin Software
 
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingFastBit Embedded Brain Academy
 

What's hot (20)

FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
RTOS
RTOSRTOS
RTOS
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
 
Sistemas de tiempo real
Sistemas de tiempo realSistemas de tiempo real
Sistemas de tiempo real
 
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
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Free FreeRTOS Course-Task Management
Free FreeRTOS Course-Task ManagementFree FreeRTOS Course-Task Management
Free FreeRTOS Course-Task Management
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)
 
Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0Performance optimization for all flash based on aarch64 v2.0
Performance optimization for all flash based on aarch64 v2.0
 
Basic functions & types of RTOS ES
Basic functions & types of  RTOS ESBasic functions & types of  RTOS ES
Basic functions & types of RTOS ES
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-2 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
Concurrent programming with RTOS
Concurrent programming with RTOSConcurrent programming with RTOS
Concurrent programming with RTOS
 
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 

Similar to Real time operating systems (rtos) concepts 4

Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic conceptMOUMITA GHOSH
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra PerfectSATOSHI TAGOMORI
 
OVERVIEW OF RTOS
OVERVIEW OF RTOSOVERVIEW OF RTOS
OVERVIEW OF RTOStaruian
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System ConceptsSanjiv Malik
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfabdulkerimaragaw936
 
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...NETWAYS
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Stop Feeding IBM i Performance Hogs - Robot
Stop Feeding IBM i Performance Hogs - RobotStop Feeding IBM i Performance Hogs - Robot
Stop Feeding IBM i Performance Hogs - RobotHelpSystems
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsPawandeep Kaur
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementationRajan Kumar
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time KernelsArnav Soni
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsRohit Joshi
 
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxEmbedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxProfMonikaJain
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptxLECO9
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptxSKUP1
 

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

FreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdfFreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdf
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
 
Rtos ss
Rtos ssRtos ss
Rtos ss
 
Lab3F22.pdf
Lab3F22.pdfLab3F22.pdf
Lab3F22.pdf
 
OVERVIEW OF RTOS
OVERVIEW OF RTOSOVERVIEW OF RTOS
OVERVIEW OF RTOS
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdf
 
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
1230 Rtf Final
1230 Rtf Final1230 Rtf Final
1230 Rtf Final
 
Stop Feeding IBM i Performance Hogs - Robot
Stop Feeding IBM i Performance Hogs - RobotStop Feeding IBM i Performance Hogs - Robot
Stop Feeding IBM i Performance Hogs - Robot
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Vxworks
VxworksVxworks
Vxworks
 
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptxEmbedded_ PPT_4-5 unit_Dr Monika-edited.pptx
Embedded_ PPT_4-5 unit_Dr Monika-edited.pptx
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptx
 
Processes, Threads.pptx
Processes, Threads.pptxProcesses, Threads.pptx
Processes, Threads.pptx
 

Recently uploaded

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

Real time operating systems (rtos) concepts 4

  • 1. Real Time Operating systems (RTOS) concepts Abu Bakr Mohamed Ramadan Eng.abubakr88@gmail.com
  • 2. Content: • The Scheduler. • What if two tasks have the same priority are ready? • Task object data. • System tasks. • Hello World application using RTOS. • References and Read more
  • 3. RTOS Scheduler. • Scheduler the core Component of any RTOS kernel, • Its a set of algorithms that determines which task executes when. • It’s keeping track on the status of each task, and decides which to run. • In Most RTOSs the developers is the one who sets the priority of each task, regarding to this priority the scheduler will decide which task will run. • The scheduler assumes that you knew what you where doing while setting tasks priority. • A bad design for tasks priority, may leads to a high priority task hogs the processor for long time, this is called CPU starvation.
  • 4. RTOS Scheduler. • It’s keeping track on the status of each task, and decides which to run. • Scheduler has no control on tasks on the blocked status. • If tasks are blocked the scheduler waits an event to unblock this tasks, like an external interrupt from pushing a button. • If no events happened, surely it’s a bad design from your side.
  • 5. Whatiftwotaskshave thesamepriorityareready? • Some RTOSs make it illegal to set two tasks with the same priority, and here the kernel limits the number of tasks in an application to the number of priority levels. • Others will time slice between the two tasks(Round robin). • Some will run one task until it blocks, then run the other task.
  • 6. Task object data • Each task has an associated: • a name, • a unique ID, • a priority, • a task control block (TCB), • a stack, • and a task routine,
  • 7. Hello World application using RTOS. void hello_world1_task(void* p) { while(1) { puts("Hello World1!"); vTaskDelay(1000); } } void hello_world2_task(void* p) { while(1) { puts("Hello World2!"); vTaskDelay(1000); } } int main() { xTaskCreate(hello_world1_task, (signed char*)"task_name", STACK_BYTES(2048), 0, 1, 0); xTaskCreate(hello_world2_task, (signed char*)"task_name", STACK_BYTES(2048), 0, 1, 0); vTaskStartScheduler(); return 0; } Two Tasks
  • 8. 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