Chapter Five: Real-Time Operating Systems Rtos
Chapter Five: Real-Time Operating Systems Rtos
Timing Constraints
Precedence Relations
Mutual Exclusion Constraints on Shared Resources.
TIMING CONSTRAINTS
Arrival Time ai: is the time at which a task becomes ready for
execution.
Computation Time Ci: is the time necessary for the processor to
execute the task without interruption.
Deadline di: is the time before which a task should be completed
to avoid damage to the system.
Start Time si: is the time at which a task starts execution.
Finishing Time fi: is the time at which a task finishes execution.
Cont…
Criticalness: is a parameter related to the consequences of missing
the deadline.
Value vi: represents the relative importance of the task with respect
to other tasks in the system.
Lateness Li: Li = fi – di represents the delay of a task completion
with respect to its deadline, it is negative if a task completes before
its deadline.
Tardiness or Exceeding Time Ei: Ei = max(o, Li) is the time a task
stays active after its deadline.
Laxity or Slack Time Xi: Xi = di – ai – Ci is the maximum time a
task can be delayed on its activation to complete within its deadline.
Cont…
Another timing characteristic that can be specified on a real time
task concerns the regularity of activation. In particular, tasks can
be defined as periodic or a-periodic.
Periodic tasks consist of an infinite sequence of identical
activities called instances or jobs, that are regularly activated at a
constant rate.
A-periodic tasks also consist of infinite sequence of identical
activities, however, their activations are not regular.
scheduling
Giving an execution order for the jobs/tasks to
get the service such that various constraints are
satisfied.
Done according to the task/job information
Scheduling policy
Things to be considered in scheduling a real-time
system:
Meeting the timing constraints of the system
Preventing simultaneous access to shared resources
and devices
Reducing the cost of context switches caused by
preemption
Attaining a high degree of utilization while satisfying
the timing constraints of the system
Reducing the communication cost in real-time
Scheduling in RTOS
More information about the tasks are known
No of tasks
Resource Requirements
Release Time
Execution time
Deadlines
Being a more deterministic system better
scheduling algorithms can be devised.
CLASSIFICATION OF SCHEDULING ALGORITHMS
Resource Allocation
The issues with scheduling applicable here.
Resources can be allocated using
• Weighted Round Robin
• Priority Based
• Some resources are non pre-emptible
Example : semaphores
• Priority Inversion if priority scheduling is used
Other RTOS issues
• Interrupt Latency should be very small
– Kernel has to respond to real time events
– Interrupts should be disabled for minimum
possible time
• For embedded applications Kernel Size should be
small
– Should fit in ROM
• Sophisticated features can be removed
– No Virtual Memory
– No Protection
INTERRUPT HANDLING OF RTOS.