RTOS-Components: Network Stack
RTOS-Components: Network Stack
Network Stack
Kernel
Kernel Target
s Kernel
Kernel
RT File Systems
A Real Time Kernel
Tasks / Timers/
Interrupts
Communication/
Synchronization
Kernel-Services
Tasks
Scheduler
Memory
Inter Task Communication
Inter Task Synchronization
Interrupts
Timers
Task Concept
What is a task?
Null
Ready
Running
Waiting/Blocked
Task State Transitions
n e e d e d re s o u rc e
b e c o m e s a v a i la b le R u n n in g A h ig h e r p r io r ity
N o h ig h e r p r io r ity ta s k b e c o m e s
re a d y re a d y
n e e d e d re s o u rc e n o h ig h e r
u n a v a i la b le p r io r ity ta s k is
re a d y
B lo c k e d
R eady
n e e d e d re s o u rc e
b e c o m e s a v a i la b le
N o h ig h e r p r io r ity
re a d y
Task-Control Block
Contd..,
Task-Control Block
P ro g ra m C o u n te r
T a s k S ta tu s
T a s k # id
C o n te n t s o f R e g is t e r s
P o in t e r t o n e x t T C B
..
..
o th e r C o n te x ts
How does RTOS handle tasks?
The kernel keeps track of the state of each task by using a data
structure, TCB. The TCB contains the status of the task (Ready,
Delayed or Waiting for an event), the task priority, the pointer to
the task’s top-of-stack and other kernel related information.
Criterion of Criticality
Task whose Failure to meet its time deadline will be
harmful, should be given Higher Priority Irrespective
of length of time deadline
Scheduling
Co-Operative Pre-Emptive
Dynamic priority
RR-Time slice EDF
RR-Priority based
Static priority
Pre-emptive
RM
Co-operative versus Preemptive Multitasking
Contd..
Contd..
Draw- backs of co-operative scheduling
Failure to make task switch call affects all other tasks in the
system
In the round robin all the tasks have equal priorities and they
share the processor co-operatively.That means each task calls the
scheduler to give –up the CPU for the other.
The tasks are scheduled for execution in the order which they
enter the ready queue.
T1, T2 & T3 then the order of execution would be T1,T2 and T3.
Round-robin -Time Slice based
t4
tim e
s lic e p re e m p ts
t1 t2 t3 t1 t2 t2
Pre-emption
p r io r it y
t a s k c o m p le t io n
t3 ta s k
c o m p le tio n
p re e m p ts
t2 t2
p re e m p ts
t1 t1
t im e
Based on the priority type (Dynamic or Static)
we have two advanced Priority based pre-
emptive scheduling techniques called,
Contd.,
Issues in Preemptive Schedulers