Professional Documents
Culture Documents
Thiet-Ke-He-Thong-Nhung - Introduction - To - Rtos - m2 - (Cuuduongthancong - Com)
Thiet-Ke-He-Thong-Nhung - Introduction - To - Rtos - m2 - (Cuuduongthancong - Com)
.c
ng
Introduction to RTOS
co
an
th
o ng
du
u
cu
CuuDuongThanCong.com https://fb.com/tailieudientucntt
About SwiftACT
om
• A Technology services startup company
.c
o Under establishment
ng
co
• Areas of specialties:
an
o Mobile telecommunication services development
Embedded systems development
th
o
ng
• Types of services:
o
du
o Consultation
o Managed services
u
o Sourcing
cu
o Training
om
• Graduated 2004
.c
o ECE, ASU: 5 yrs distinction
ng
• 5+ years in embedded systems development
co
o SDLC, Apps, MW, DD, Porting, ...
• 3+ years in SW engineering
an
PSP, CMMI, Systematic reuse, ...
th
o
• 3+ years in SW testing ng
o IBM certified, ISTQB certified, ...
o
du
u
cu
om
• Materials in this course is the property of Amr Ali Abdel-Naby.
.c
ng
• Reproduction or transmission of the materials in any manner
co
without the copyright owner permission is a law violation.
an
th
o ng
du
u
cu
om
•
.c
Introduction
• Tasks
ng
• Semaphores
co
• Message Queues
an
• Other Kernel Objects
th
• Other Kernel Services o ng
du
u
cu
om
•
.c
Introduction
• Tasks
ng
• Semaphores
co
• Message Queues
an
• Other Kernel Objects
th
• Other Kernel Services o ng
du
u
cu
om
• Multiple tasks
.c
o Each a sequential “thread” of execution
ng
co
• Explicit task manipulation Task 1 Task 2 Task 3
an
o Separate context for each task
th
ng
P1 P2 P3
o
• Pre-emption is dynamic: The highest priority ready task is the
du
Kernel
task that must be running
u
cu
om
• A task is an independent thread of execution capable of
.c
executing in parallel with other threads of execution.
ng
• Each task has its own stack.
co
o Maybe more than 1 stack
Supervisor mode stack, user mode stack
an
• A task may synchronize and/or communicate with other tasks.
th
o Primary mechanism is messages.ng
o Also shared memory (with semaphores)
o
• You must write programs for your application tasks.
du
services.
cu
om
Task 3
• Managed by RTOS for each task
.c
o Current state of task
ng
o Unique ID of task
co
o Priority of task TCB 3
Type of task
an
o
Task 2
o Stack location and size
th
o Current stack pointer ng
o File and line info (for debug)
o
o Waiting messages
du
TCB 2
o Desired messages
u
o ... Task 1
cu
TCB 1
om
.c
ng
Ready
co
an
HPT became ready
Needed resource is
th
available + HPT is
ready ng
No HPT is ready
o
du
u
cu
Needed resource is
unavailable
Amr Ali Abdel-Naby@ 2009 Real-Time Operating Systems
CuuDuongThanCong.com https://fb.com/tailieudientucntt
System vs. Application Tasks
om
• Systems tasks
.c
o Created by the kernel
ng
o Have reserved priorities
co
o Initialization task, Idle task, logging task …
an
• The kernel jumps to a predefined entry point.
th
ng
• From the entry point, the developer can
o
du
require.
cu
om
• Task creation and deletion
.c
o Create
ng
o Delete
co
• Task scheduling
an
o Suspend and Resume
o Get Priority and Set Priority
th
o Preemption Lock and Preemption unlock
ng
o Delay
o
o Restart
du
o Get ID
cu
o Get TCB
om
.c
ng
co
Run to Completion Endless Loop
an
RunToCompletionTask(){ EndLessLoopTask(){
th
Initialize application Initialization code
Create kernel objects ng Loop forever {
Create endless loop tasks Loop body
o
Delete or Suspend task }
du
} }
u
cu