PARADIGM-GLOBAL INFOSERVICES Ltd. www.paradigm-global.com
OBJECTIVES OS Introduction Evolution of OS Real - Time Systems Classification of Real-time systems  What is an RTOS ? Components of RTOS Task Management  Memory Management  Intertask Communication Intertask Synchronization.  Requirements of an RTOS
OPERATING  SYTEMS Converts hardware of the  system into virtual machine. Acts as an interface between users and hardware of the system. Controls and coordinates use of hardware among various application programs among users.
OS can be viewed as an: Organized collection of software.  Consists of control routines for operating  the computer. Provides environment for execution of programs.
Functions of OS Government - Proper use of resources. Resource Allocator - Manages the  resources of computer systems such as  CPU time,  memory, file storage, I/O  devices, etc. Resolves conflicting requests for resources in concurrent execution of programs. I/O Management - Need to control I/O devices.
Functions of OS (Contd.) File management - Opening, editing, closing, manipulations and deleting of files. Memory management - Manages the allocation of  memory space to the applications. Program execution and error detection. Protection - Sharing of common resources such as I/O, memory, CPU scheduling need protection.
Evolution of OS  OS was evolved in the following way:   1) Serial processing   2) Batch processing   3) Multi-Programming Serial  Processing  RTOS Batch Processing  Multi programming
Program was executed in a serial manner. Ex: Punched cards, Paper tapes, language translator. Serial execution causes either processor or I/O devices to be idle at sometime. Serial Processing
Serial Programming Drawbacks 1) Low utilization of system resources. 2) User productivity is low. Program 1 Program 2 P1 IDLE P1 IDLE P2 IDLE P2 IDLE P1 P2
Intent to increase system resource utilization. Prearrange submitted jobs so that similar ones are  placed in same batch - “phasing”. Os commands are written in job control language. JCL includes job begin & end commands for loading & execution of programs and commands to announce resource needs. Batch monitor reads, interprets and executes OS commands. Drawbacks : Turnaround time is too long. Phasing increases turnaround time. 2) Offline debugging. Batch Processing
Multi - Programming Program1 Program2 P1 P2 P1 P2 P1 P2
Types of OS OS  Size  Function   Multi-Programming Ex:Unix,WinNT   Multi-Tasking Ex:RTX-51   Smaller  Ex:RTX-51   Larger EX:WinNT,Unix
1) Architecture For Larger OS CPU I/O Devices I/O Sub System File Manager Language  Support Utilities Application  Programs Kernel Scheduler Dispatcher Int.handler
2) Architecture For Smaller OS CPU I/O Devices Application  Programs Kernel Scheduler Dispatcher Int.handler
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 support concurrent execution of two (or) more programs. OS switches from task to task simultaneously. Two types are:   1) Cooperative   2) Preemptive 3) Multi-tasking OS
3) Multi-Programming OS = Multi-Tasking + * Forms of memory protection * Enforces concurrency control when processes access shared I/O devices    and files. 3) Multi-Programming OS
Real-Time Systems 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.  (or) Systems that are used in environments where a larger number of events, mostly external to computer system, must be accepted and processed in short time / within certain deadlines. (or) 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 small for acceptable timeliness.
Timeliness in a real-time system is critical. Ex: Flight control, Industrial control, military applications, robotics, nuclear power plant control, automobile engine control, etc.
Classification of Real-Time Systems Hard Real-Time Systems Soft
Classification of Real-Time Systems   Soft Acceptance of lower performance for lateness.  Rising cost for lateness of system. Ex: vending machine, Temperature controller   Hard No lateness is accepted under any circumstances. Catastrophic failure if deadline missed Cost of missing deadline is infinitely high Ex: Missile system, aircraft.
REAL TIME SYSTEMS 1. CLOCK BASED(Cyclic,Periodic) Signals from the real time clock interrupts the  operations of the computer at a predetermined time. 2.EVENT BASED Actions perfomed in response to some event Using polling or interrupts 3.INTERACTIVE SYSTEMS Based on average response time.
RTOS   Real-time operating systems helps to build real-time system.
System tasks Application tasks Resource  allocation Command Processor I\O subsystem File  manager Task  management Interrupt service routine Real time clock User level Operating system level Structure of a real time OS
Components of RTOS Task Management Memory Management Intertask Communication  Intertask Synchronization
Functions of RTOS – 1.Task Management Allocation of memory and CPU time to task. a)  Scheduler:   To keep a record of the state of each task   To schedule the allocation of CPU time  to each task. b)  Dispatcher:   To perform the context-switching.
Task State Diagram New Ready Running Halted Waiting
CPU Scheduling Deals with the problem of deciding which of the process(Task) is to be allocated with CPU. Intention is to  a) To maximize CPU 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)
Dynamic memory Allocation Used for storing intermediate results  Memory allocation and deallocation must exist within constant time limits. Functions of RTOS – 2.Memory Management
Various mechanism available are   (a) Pipes   (b) Message queues (c) Remote procedural calls (RPC) Functions of RTOS – 3.Intertask Communication
(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.
Requirements of an RTOS An RTOS has to be multi-tasking and preemptible. The motion of task priority has to exist. The OS has to support task synchronization mechanisms. A system of priority inversion has to exist. System should be deterministic.
End

Os Concepts

  • 1.
    PARADIGM-GLOBAL INFOSERVICES Ltd.www.paradigm-global.com
  • 2.
    OBJECTIVES OS IntroductionEvolution of OS Real - Time Systems Classification of Real-time systems What is an RTOS ? Components of RTOS Task Management Memory Management Intertask Communication Intertask Synchronization. Requirements of an RTOS
  • 3.
    OPERATING SYTEMSConverts hardware of the system into virtual machine. Acts as an interface between users and hardware of the system. Controls and coordinates use of hardware among various application programs among users.
  • 4.
    OS can beviewed as an: Organized collection of software. Consists of control routines for operating the computer. Provides environment for execution of programs.
  • 5.
    Functions of OSGovernment - Proper use of resources. Resource Allocator - Manages the resources of computer systems such as CPU time, memory, file storage, I/O devices, etc. Resolves conflicting requests for resources in concurrent execution of programs. I/O Management - Need to control I/O devices.
  • 6.
    Functions of OS(Contd.) File management - Opening, editing, closing, manipulations and deleting of files. Memory management - Manages the allocation of memory space to the applications. Program execution and error detection. Protection - Sharing of common resources such as I/O, memory, CPU scheduling need protection.
  • 7.
    Evolution of OS OS was evolved in the following way: 1) Serial processing 2) Batch processing 3) Multi-Programming Serial Processing RTOS Batch Processing Multi programming
  • 8.
    Program was executedin a serial manner. Ex: Punched cards, Paper tapes, language translator. Serial execution causes either processor or I/O devices to be idle at sometime. Serial Processing
  • 9.
    Serial Programming Drawbacks1) Low utilization of system resources. 2) User productivity is low. Program 1 Program 2 P1 IDLE P1 IDLE P2 IDLE P2 IDLE P1 P2
  • 10.
    Intent to increasesystem resource utilization. Prearrange submitted jobs so that similar ones are placed in same batch - “phasing”. Os commands are written in job control language. JCL includes job begin & end commands for loading & execution of programs and commands to announce resource needs. Batch monitor reads, interprets and executes OS commands. Drawbacks : Turnaround time is too long. Phasing increases turnaround time. 2) Offline debugging. Batch Processing
  • 11.
    Multi - ProgrammingProgram1 Program2 P1 P2 P1 P2 P1 P2
  • 12.
    Types of OSOS Size Function Multi-Programming Ex:Unix,WinNT Multi-Tasking Ex:RTX-51 Smaller Ex:RTX-51 Larger EX:WinNT,Unix
  • 13.
    1) Architecture ForLarger OS CPU I/O Devices I/O Sub System File Manager Language Support Utilities Application Programs Kernel Scheduler Dispatcher Int.handler
  • 14.
    2) Architecture ForSmaller OS CPU I/O Devices Application Programs Kernel Scheduler Dispatcher Int.handler
  • 15.
    An instance ofprogram in execution is called “Process / Task”. Capability of OS to perform more than one task at same time. Ability of OS to support concurrent execution of two (or) more programs. OS switches from task to task simultaneously. Two types are: 1) Cooperative 2) Preemptive 3) Multi-tasking OS
  • 16.
    3) Multi-Programming OS= Multi-Tasking + * Forms of memory protection * Enforces concurrency control when processes access shared I/O devices and files. 3) Multi-Programming OS
  • 17.
    Real-Time Systems Systemsin which correct responses are produced within a definite time limit. If computer responses exceed these time boundary then performance degradation and/or malfunction results. (or) Systems that are used in environments where a larger number of events, mostly external to computer system, must be accepted and processed in short time / within certain deadlines. (or) 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 small for acceptable timeliness.
  • 18.
    Timeliness in areal-time system is critical. Ex: Flight control, Industrial control, military applications, robotics, nuclear power plant control, automobile engine control, etc.
  • 19.
    Classification of Real-TimeSystems Hard Real-Time Systems Soft
  • 20.
    Classification of Real-TimeSystems Soft Acceptance of lower performance for lateness. Rising cost for lateness of system. Ex: vending machine, Temperature controller Hard No lateness is accepted under any circumstances. Catastrophic failure if deadline missed Cost of missing deadline is infinitely high Ex: Missile system, aircraft.
  • 21.
    REAL TIME SYSTEMS1. CLOCK BASED(Cyclic,Periodic) Signals from the real time clock interrupts the operations of the computer at a predetermined time. 2.EVENT BASED Actions perfomed in response to some event Using polling or interrupts 3.INTERACTIVE SYSTEMS Based on average response time.
  • 22.
    RTOS Real-time operating systems helps to build real-time system.
  • 23.
    System tasks Applicationtasks Resource allocation Command Processor I\O subsystem File manager Task management Interrupt service routine Real time clock User level Operating system level Structure of a real time OS
  • 24.
    Components of RTOSTask Management Memory Management Intertask Communication Intertask Synchronization
  • 25.
    Functions of RTOS– 1.Task Management Allocation of memory and CPU time to task. a) Scheduler: To keep a record of the state of each task To schedule the allocation of CPU time to each task. b) Dispatcher: To perform the context-switching.
  • 26.
    Task State DiagramNew Ready Running Halted Waiting
  • 27.
    CPU Scheduling Dealswith the problem of deciding which of the process(Task) is to be allocated with CPU. Intention is to a) To maximize CPU utilization among different tasks in a multi-tasking program. b) To minimize waiting time.
  • 28.
    Scheduling Algorithms a) First-Come-First-Served (FCFS) b) Shortest Job First (SJF) c) Priority based Pre-emption d) Round-Robin (RR)
  • 29.
    Dynamic memory AllocationUsed for storing intermediate results Memory allocation and deallocation must exist within constant time limits. Functions of RTOS – 2.Memory Management
  • 30.
    Various mechanism availableare (a) Pipes (b) Message queues (c) Remote procedural calls (RPC) Functions of RTOS – 3.Intertask Communication
  • 31.
    (a) PipesSimple 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.
  • 32.
    (c) MessageQueues 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.
  • 33.
    (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.
  • 34.
    Requirements of anRTOS An RTOS has to be multi-tasking and preemptible. The motion of task priority has to exist. The OS has to support task synchronization mechanisms. A system of priority inversion has to exist. System should be deterministic.
  • 35.