Professional Documents
Culture Documents
Chapter 4 Rtos Concepts Real Time Systems Concepts: Radio Transmissions, Etc..
Chapter 4 Rtos Concepts Real Time Systems Concepts: Radio Transmissions, Etc..
Chapter 4 Rtos Concepts Real Time Systems Concepts: Radio Transmissions, Etc..
Types of RTS
Soft Real Time
– Tasks are performed by the systems as fast as possible, but failing to complete within
specified deadlines is not catastrophic
– Video Surveillance, Radio Transmissions, Online Ticket reservation systems, etc..,
Hard Real Time
– Tasks have to be performed not only correctly but in time. Failure to comply to the set
deadlines would result catastrophical
– Nucleur Reactors, Vehicle Braking, etc...
Most RTS will have Combination of both.
GPOS vs RTOS
Determinism
Load-Independent Timing
Task Scheduling
Dynamic Memory Allocations
Interrupts
Intertask Communication
Task Priority
A priority is assigned to each task
The more important the task the more the priority
Two types of priority assigning
– Static (Assigned at Compile Time)
– Dynamic (Assigned at Execution Time)
Scheduler
Part of the Kernel which will decide the next task to run
Most RT Kernels are priority based
Control is always given to highest priority task ready to run
Two types of priority based Kernels
– Non-Preemptive
– Preemptive
Reentrancy A reentrant function can be used by more than one task without data corruption
A reentrant function can be interrupted at any time and resumed at a later time without loss of data
Mutual Exclusion
Disabling and Enabling the Interrupt
Test-and-Set
Disabling and Enabling the Scheduler
Semaphores
– Binary Semaphores
– Counting Semaphores
Semaphores
Control Access to a shared resource (ME)
Signal Occurrence of an event
Allow two tasks to synchronize their activities
Intertask Communication
Message Mailboxes
Message Queues
4
Deadlock
Two task unknowingly waiting for resources held by each other
Solution for Deadlock:
– Acquire all resources before proceeding
– Acquire the resources in the same order, and
– Release the resources in the same order.
Interrupts
Hardware mechanism to inform the CPU that asynchronous event has occurred
What happens when an Interrupt occurs
– Saves the present context
– Jumps to the ISR
– Executes ISR & returns
Where does the Interrupt RETURN
The Background for Foreground/ Background System
Interrupted task for a Non-Preemptive Kernel
The highest priority task ready to run for a Preemptive Kernel
Interrupt Latency
One of the important specifications of a Real Time Kernel
Longer the Interrupts are disabled the Higher the Interrupt Latency
Equation
Max amount of time Interrupts are disabled +
Time to start executing the first Instruction in the ISR
Interrupt Response
The time between the reception of the Interrupt and the start of the user code that handles the
Interrupt
It involves all the overhead involved in handling an Interrupt
Foreground/Background System
Interrupt Latency+Time to save CPU context
Clock Tick
The clock tick is a special interrupt that occurs periodically
This interrupt can be viewed as the system heartbeat
The time between Interrupts is application specific and is generally 10 to 200ms