CONCEPTS OF
REAL-TIME OPERATING SYSTEM
OBJECTIVE To Understand Why we need OS? To identify Types of OS To Define Real - Time Systems
To Classify real time Systems To Understand What is an RTOS ? Components of RTOS
To know secrets of What makes an OS as an RTOS ?
How to choose RTOS?
OPERATING SYTEMS - Converts hardware of the system into virtual machine. - Acts as an interface between s and hardware of the system. - Controls and coordinates use of hardware among various application programs among s.
Types of OS OS Size
Smaller Ex:RTX-51
Function
Larger EX:WinNT,Unix
Multi-Programming Ex:Unix,WinNT
Multi-Tasking Ex:RTX-51
Architecture For Larger OS
I/O
Sy S ste ub m
Application Programs t r o p p Utilities u S e g Fi M a u le a g na n a ge L r e l r h c S
u d e
Despat -cher
U I/O Devices
Int. handler
Kernel
Architecture For Smaller OS Application Programs Int. Dispatcher Scheduler Handler. U I/O Devices
Kernel
3) Multi-tasking OS: - An instance of program in execution is called “Process / Task”. - Capability of OS to perform more than one task at same time. - Ability of OS to concurrent execution of two (or) more programs. - OS switches from task to task simultaneously. - Two types are: 1) Cooperative 2) Preemptive
3) Multi-Programming OS:
= Multi-Tasking
+ * Forms of memory protection * Enforces concurrency control when processes access shared I/O devices and files.
Definition of Real-Time Systems
- Any system in which time at which output is produced is significant.This is because input corresponds to some movement in physical world and output has to relate to that same movement.The lag from input time to output time must be sufficiently small for acceptable timeliness.
OR
- Systems in which correct responses are produced within a definite time limit. If computer responses exceed these time boundary then performance degradation and/or malfunction results. - Ex: Flight control, Industrial control, military applications, robotics, nuclear power plant control, automobile engine control, etc.
Classification of Real-Time Systems
Real-Time Systems
Hard
Soft
Classification of Real-Time Systems Soft:
- Acceptance of lower performance for lateness. - Rising cost for lateness of system. - Ex: vending machine, Temperature controller
d:
- No lateness is accepted under any circumstances. - Catastrophic failure if deadline missed - Cost of missing deadline is infinitely h - Ex: Missile system, aircraft.
What is RTOS? operating system, that helps to build realtime system.
Components of RTOS
* Task Management * Memory Management * Intertask Communication * Intertask Synchronization
Functions of RTOS 1) Task Management: * Allocation of memory and U time to task. a) Scheduler: - To keep a record of the state of each task - To schedule the allocation of U time to each task. b) Dispatcher: - To perform the context-switching.
Task State Diagram
New
Ready
Running
Waiting
Halted
U Scheduling - Deals with the problem of deciding which of the process(Task) in the ready queue is to be allocated with U. - Intention is to a) To maximize U utilization among different tasks in a multi-tasking program. b) To minimize waiting time.
Scheduling Algorithms a) First-Come-First-Served (FCFS) b) Shortest Job First (SJF) c) Priority based Pre-emption d) Round-Robin (RR)
2) Memory management: - Dynamic memory Allocation - Used for storing intermediate results - Memory allocation and deallocation must exist within constant time limits.
3) Intertask Communication: various mechanism available are: (a) Pipes (b) Message queues (c) Remote procedural calls (RPC)
(a) Pipes: - Simple communication channel that can be used to send data from one task to another. - Pipe can be opened,closed,written to and read just like files. - Perform operation in only one direction. (b) RPC: - Procedure in one process can directly call procedure in another process. - Two process may be running on same computer or on 2 different computers connected by network.
(c) Message Queues: - It allows transmission of messages from one task to another task. 4) Intertask Synchronization: Classified as: (a) Signals (b) Semaphores (a) Signals: - Used when task synchronization is required without data exchange. - Simplest and fastest method.
(b) Semaphore: - Resources can be shared free of conflicts between the individual tasks. - Consists of a data item and a pair of operations, wait and release.
What makes an OS as RTOS? * An RTOS has to be multi-tasking and preemptible. * The notion of task priority has to exist. * The OS has to task synchronization mechanisms. * A system of priority inheritance has to exist. * System should be deterministic.
Case Study - Why Windows NT is not an RTOS? * An RTOS has to be multi-tasking and preemptible. * The notion of task priority has to exist. - But has only few level of priority, therefore the predictability is poor * The OS has to task synchronization mechanisms. * A system of priority inheritance has to exist.
* System should be deterministic.
How to Choose RTOS? Factors to be considered * of your processor of choice * Portability to new processor * Scalability to match varied application requirement * Multi processor * Extended services such as Network
* Standards / POSIX compliance * Language * Development environment * Licensing arrangements & Price