SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafka
Jiangjie Qin
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
Meghaj Mallick
 
Interrupt presentaion
Interrupt presentaionInterrupt presentaion
Interrupt presentaion
TanXeela Sheikh
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
Mukesh Chinta
 
RTOS
RTOSRTOS
RTOS
Ramasubbu .P
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Pawandeep Kaur
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
vivek223
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
Yong Heui Cho
 
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
 
RTOS - Real Time Operating Systems
RTOS - Real Time Operating SystemsRTOS - Real Time Operating Systems
RTOS - Real Time Operating Systems
Emertxe Information Technologies Pvt Ltd
 
Chap2 2 1
Chap2 2 1Chap2 2 1
Chap2 2 1
Hemo Chella
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Murtadha Alsabbagh
 
Concurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorConcurrent Programming Using the Disruptor
Concurrent Programming Using the Disruptor
Trisha Gee
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
Sanad Bhowmik
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
Haziq Naeem
 
Lecture 3 parallel programming platforms
Lecture 3   parallel programming platformsLecture 3   parallel programming platforms
Lecture 3 parallel programming platforms
Vajira Thambawita
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
Wayne Jones Jnr
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
Rajagopal Nagarajan
 
Clock driven scheduling
Clock driven schedulingClock driven scheduling
Clock driven scheduling
Kamal Acharya
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbms
Dilouar Hossain
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafka
Jiangjie Qin
 
Disk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating SystemDisk Scheduling Algorithm in Operating System
Disk Scheduling Algorithm in Operating System
Meghaj Mallick
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
Mukesh Chinta
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Pawandeep Kaur
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
vivek223
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
Yong Heui Cho
 
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
 
Concurrent Programming Using the Disruptor
Concurrent Programming Using the DisruptorConcurrent Programming Using the Disruptor
Concurrent Programming Using the Disruptor
Trisha Gee
 
Round Robin Algorithm.pptx
Round Robin Algorithm.pptxRound Robin Algorithm.pptx
Round Robin Algorithm.pptx
Sanad Bhowmik
 
Operating System Process Synchronization
Operating System Process SynchronizationOperating System Process Synchronization
Operating System Process Synchronization
Haziq Naeem
 
Lecture 3 parallel programming platforms
Lecture 3   parallel programming platformsLecture 3   parallel programming platforms
Lecture 3 parallel programming platforms
Vajira Thambawita
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
Wayne Jones Jnr
 
Clock driven scheduling
Clock driven schedulingClock driven scheduling
Clock driven scheduling
Kamal Acharya
 
Two phase commit protocol in dbms
Two phase commit protocol in dbmsTwo phase commit protocol in dbms
Two phase commit protocol in dbms
Dilouar Hossain
 

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

Intro To RTOS by Silicon labs covering fundamentals
Intro To RTOS by Silicon labs covering fundamentalsIntro To RTOS by Silicon labs covering fundamentals
Intro To RTOS by Silicon labs covering fundamentals
sivakumarrohit2917
 
FreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdfFreeRTOS Slides annotations.pdf
FreeRTOS Slides annotations.pdf
AbdElrahmanMostafa87
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
MOUMITA GHOSH
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
SATOSHI TAGOMORI
 
Rtos ss
Rtos ssRtos ss
Rtos ss
Sudheesh S Madhav
 
Lab3F22.pdf
Lab3F22.pdfLab3F22.pdf
Lab3F22.pdf
ssuser0e9cc4
 
OVERVIEW OF RTOS
OVERVIEW OF RTOSOVERVIEW OF RTOS
OVERVIEW OF RTOS
taruian
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
Sanjiv 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 .pdf
abdulkerimaragaw936
 
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
 
Real time operating system which explains scheduling algorithms
Real time operating system which explains scheduling algorithmsReal time operating system which explains scheduling algorithms
Real time operating system which explains scheduling algorithms
Lavanya Sandeep
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Khuram Shahzad
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
John Adams
 
Entreprenuership notes module 3 notes.pptx
Entreprenuership  notes module 3 notes.pptxEntreprenuership  notes module 3 notes.pptx
Entreprenuership notes module 3 notes.pptx
SreekalaP6
 
1230 Rtf Final
1230 Rtf Final1230 Rtf Final
1230 Rtf Final
luisotaviomedici
 
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
HelpSystems
 
TOS based Embedded system design and development
TOS based Embedded system design and developmentTOS based Embedded system design and development
TOS based Embedded system design and development
BharaniDharan195623
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
Rajan Kumar
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
Arnav Soni
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Rohit Joshi
 
Intro To RTOS by Silicon labs covering fundamentals
Intro To RTOS by Silicon labs covering fundamentalsIntro To RTOS by Silicon labs covering fundamentals
Intro To RTOS by Silicon labs covering fundamentals
sivakumarrohit2917
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
MOUMITA GHOSH
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
SATOSHI TAGOMORI
 
OVERVIEW OF RTOS
OVERVIEW OF RTOSOVERVIEW OF RTOS
OVERVIEW OF RTOS
taruian
 
Real Time Operating System Concepts
Real Time Operating System ConceptsReal Time Operating System Concepts
Real Time Operating System Concepts
Sanjiv 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 .pdf
abdulkerimaragaw936
 
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
 
Real time operating system which explains scheduling algorithms
Real time operating system which explains scheduling algorithmsReal time operating system which explains scheduling algorithms
Real time operating system which explains scheduling algorithms
Lavanya Sandeep
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Khuram Shahzad
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
John Adams
 
Entreprenuership notes module 3 notes.pptx
Entreprenuership  notes module 3 notes.pptxEntreprenuership  notes module 3 notes.pptx
Entreprenuership notes module 3 notes.pptx
SreekalaP6
 
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
HelpSystems
 
TOS based Embedded system design and development
TOS based Embedded system design and developmentTOS based Embedded system design and development
TOS based Embedded system design and development
BharaniDharan195623
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
Rajan Kumar
 
Real Time Kernels
Real Time KernelsReal Time Kernels
Real Time Kernels
Arnav Soni
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Rohit Joshi
 
Ad

Recently uploaded (20)

Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Ad

Real time operating systems (rtos) concepts 4

  • 1. Real Time Operating systems (RTOS) concepts Abu Bakr Mohamed Ramadan [email protected]
  • 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