28-01-2012, 10:04 AM
REAL TIME OPERATING SYSTEM
VIVEK JAISWAL
0813331103
EC VI B
Operating System
Collection of system calls (functions)
Provides a set of basic services to interact with the hardware
Core of the OS is Kernel
Basic structural unit of OS
Typically a library or set of libraries
Operates in supervisory mode
Basic Structure of Operating System
Real Time Operating System
A variant of OS
Operates in constrained environment where computer memory and processing power is limited
Provides services in definite amount of time
Features
Fast
Response times are highly predictable
Small and occupy very little memory
Consume fewer resources
Mission-critical
Unpredictable environment
Life risking applications
[b]Examples of RTOS
Types of RTOS[/b]
Hard Real-Time Systems
Soft Real-Time Systems
Hard Real-Time Systems
Meets deadlines with zero degree of flexibility
Missed deadlines cause catastrophe
Cost of catastrophe is high
[b]Example of Hard Real-Time Systems
Weapons defense system[/b]
Missile guidance system
Soft Real-Time Systems
Meets deadlines with some degree of flexibility
Missed deadline does not cause catastrophe
Costs rise in proportion to the delay
Example of Soft Real-Time Systems
DVD or multimedia players
Scheduling
Make sure that all tasks meet their timing constraints
It is not a task but a function call [schedule()]
Called at various scheduling points likewise end of ISR, when tasks go to sleep or when they are ready to run
Types of algorithms
Preemptive priority based scheduling algorithm
Round Robin scheduling algorithm
Preemptive priority based scheduling algorithm
Each task has a priority and highest-priority task runs first
Round Robin scheduling algorithm
Each task of same priority uses time slice to achieve equal share of CPU execution time
Tasks
An independent thread of execution
It is schedulable
Characterized by associated name, unique ID, priority, task control block (TCB), stack & task routine
Each task moves from one state to another using finite state machine (FSM)
Semaphores
A kernel object that one or more threads of execution can acquire or release for the purposes of synchronization or mutual exclusion.
Acts like a key
Allows a task to carry out some operation or to access a resource
Types
Binary Semaphore
Counting Semaphore
Mutual Exclusion Semaphore
Message Queues
It is like a pipeline through which tasks & ISRs communicate and synchronize with data.
Ways to use Message Queues
Non-interlinked
one-way data communication
Interlocked
one-way data communication
Interlocked
two-way data communication
Broadcast Communication
Exceptions & Interrupts
Exception is any event that disrupts the normal execution of the processor and forces the processor into execution of special instructions
Types
Synchronous Exceptions Raised by internal events like processor instructions
“An arithmetic operation that results in a division by zero”
Asynchronous Exceptions Associated with hardware signals from external hardware devices
Also called as INTERRUPTS
“Pushing the reset button on the embedded board”