Chapter 12 : Computer Science. Class XI ( As per CBSE Board) Program Execution. New Syllabus Visit : python.mykvs.in for regular updates

Similar documents
Insight into Program execution

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

5-In switch case statement, every case should have a statement as the last statement A- Jump B- Break C- Exit D- Both a and b

Processes, PCB, Context Switch

Year 12 Computer Science Learning Cycle 2 Overview

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

CSE 153 Design of Operating Systems

CD Assignment I. 1. Explain the various phases of the compiler with a simple example.

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

SPOS MODEL ANSWER MAY 2018

EECE.4810/EECE.5730: Operating Systems Spring 2017

OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).

CIS233J Java Programming II. Threads

CS370 Operating Systems

* What are the different states for a task in an OS?

1.1 CPU I/O Burst Cycle

CS 322 Operating Systems Practice Midterm Questions

Q1. State True/false with jusification if the answer is false:

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Software Concepts. It is a translator that converts high level language to machine level language.

Processes. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?

MARUTHI SCHOOL OF BANKING (MSB)

AC59/AT59/AC110/AT110 OPERATING SYSTEMS & SYSTEMS SOFTWARE DEC 2015

UNIT:2. Process Management

LESSON 13: LANGUAGE TRANSLATION

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Table of Contents 1. OPERATING SYSTEM OVERVIEW OPERATING SYSTEM TYPES OPERATING SYSTEM SERVICES Definition...

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

Chapter 3: Processes. Operating System Concepts 8 th Edition,

Operating Systems: Quiz2 December 15, Class: No. Name:

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Midterm Exam. October 20th, Thursday NSC

8: Scheduling. Scheduling. Mark Handley

Process Description and Control

Introduction to Programming: Variables and Objects. HORT Lecture 7 Instructor: Kranthi Varala

Dr. Rafiq Zakaria Campus. Maulana Azad College of Arts, Science & Commerce, Aurangabad. Department of Computer Science. Academic Year

Principles of Programming Languages. Lecture Outline

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers)

COP 3402 Systems Software. Lecture 4: Compilers. Interpreters

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

Process. Discussion session 3 1/30/2016

Operating Systems Comprehensive Exam. Fall Student ID # 10/31/2013

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

Software Development. Integrated Software Environment

Process Scheduling Part 2

Part B Questions. Unit I

Inter-Process Communication and Synchronization of Processes, Threads and Tasks: Lesson-1: PROCESS

Some popular Operating Systems include Linux, Unix, Windows, MS-DOS, Android, etc.

Operating Systems Comprehensive Exam. Spring Student ID # 2/17/2011

CS4411 Intro. to Operating Systems Exam 2 Fall 2009

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

OPERATING SYSTEMS. COMS W1001 Introduction to Information Science. Boyi Xie

Processes. CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers University

SMD149 - Operating Systems

Chapter 5: CPU Scheduling

Processes. OS Structure. OS Structure. Modes of Execution. Typical Functions of an OS Kernel. Non-Kernel OS. COMP755 Advanced Operating Systems

Dr. D. M. Akbar Hussain DE5 Department of Electronic Systems

REVIEW OF COMMONLY USED DATA STRUCTURES IN OS

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

Module 1. Introduction:

Operating System - Overview

Process and Resource Management

2c. Content of Computer systems (Component 01)

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Precept 2: Non-preemptive Scheduler. COS 318: Fall 2018

Introduction to Real-Time Operating Systems

Announcements/Reminders

CHAPTER 2: PROCESS MANAGEMENT

What is a Process? Processes and Process Management Details for running a program

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CS140 Operating Systems and Systems Programming Midterm Exam

Compiler Design. Lecture 1

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Operating Systems. Figure: Process States. 1 P a g e

Topic 4 Scheduling. The objective of multi-programming is to have some process running at all times, to maximize CPU utilization.

Today: Protection! Protection!

Tasks. Task Implementation and management

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers)

Subject Teacher: Prof. Sheela Bankar

OS Structure, Processes & Process Management. Don Porter Portions courtesy Emmett Witchel

Main Points of the Computer Organization and System Software Module

OCR H446 A-Level Computer Science

CSC369H1 S2016 Midterm Test Instructor: Bogdan Simion. Duration 50 minutes Aids allowed: none. Student number:

Comp 310 Computer Systems and Organization

Lecture 2 Process Management

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/os, etc.

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

TDDB68 Processprogrammering och operativsystem / Concurrent programming and operating systems

Chapter 1 Preliminaries

Process Description and Control. Chapter 3

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Transcription:

Chapter 12 : Computer Science Class XI ( As per CBSE Board) Program Execution New Syllabus 2018-19

Program Execution The process of running a computer software program or command by processor is known as program execution.at lowest level/system Programming following steps are involved in the execution of a program: - Fetch: The control unit is given an instruction. - Decode: The control unit then decodes the newly received instruction. - Execute: During the execution the Control unit first commands the correct part of hardware to take action. Once that is found out the control is handed over to the hardware. Now the task is performed. - Store: Once the task is saved successfully the end result is stored. - After the cycle is complete the Control unit is again handled the conrol.

Program Execution Generally, the programs developed in high level language like C, C++, Java etc.,cannot understand by the computer. It can understand only low level language. So, the program written in high level language to be converted into low level language to make it understandable for the computer. This conversion is performed using either Interpreter or Compiler.The basic flow of any program execution is shown in diagram.

Program Execution The compilation mainly undergoes following steps 1. Processing phase-> removal of comments and carry out of processor directives 2. Compilation phase -> a.) analysis phase-identification of tokens b.)synthesis phase formation of syntax tree 3. Assembly phase -> source code is converted into object code(a form of machine code) 4. Linking -> linking of other executable files with object code 5. Loader -> This program Loads the executable module into memory for execution.

Difference between Compiler an interpreter Interpreter Translates program one statement at a time. It takes less amount of time to analyze the source code but the overall execution time is slower. No intermediate object code is generated, hence are memory efficient. Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. Programming language like Python, Ruby use interpreters. Compiler Scans the entire program and translates it as a whole into machine code. It takes large amount of time to analyze the source code but the overall execution time is comparatively faster. Generates intermediate object code which further requires linking, hence requires more memory. It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. Programming language like C, C++ use compilers.

Program Execution Program under compilation moves from following phases Lexical Analyzer Syntax/Semantic Analyzer Intemediate code generator Lexical analyzer breaks stmts/syntaxes into a series of tokens Syntax/Symantic analyser detect any errors in the code(tokens) That syntax tree then can be converted into a linear representation by Intermediate code generator which is machine independent code.

Operating System as a Resource Manager There are no. of resources available in a computer system CPU Memory i/o devices If a computer system is used by multiple applications then they will compete for these resources It is the job of the Operating System to allocate these resources to the various applications so that : The resources are allocated fairly The resources are protected from cross access Access to the resources is synchronized so that operations are correct and consistent Deadlocks are detected, resolved and avoided.

Major Operating System Functions 1. Process Management CPU can perform one task at one time. if there are many tasks, operating system decides which task should get the CPU. 2. Memory Management if there is no operating system, the programs may mix with each other. The OS manages Memory to not to mix programs and to provide memory to these programs. 3. Input/Output management -operating system controls all the inputs and outputs devices, monitors their request and issues commands to the devices.

Program execution under Operating System(Process Management) Any Program under execution of processor is known as a process. A process includes the complete execution context (code to execute, data to manipulate, registers, OS resources in use). Following are the major activities of an operating system with respect to program management Loads a program into memory. Executes the program. Handles program's execution. Provides a mechanism for process synchronization. Provides a mechanism for process communication. Provides a mechanism for deadlock handling.

Process states diagram A process changes its state during its execution. Each process may be in one of the following states: New: when a new process is being created. Running: A process is said to be in running state when instructions are being executed. Waiting: The process is waiting for some event to occur (such as an I/O operation). Ready: The process is waiting for processor. Terminated: The process has finished execution.

Process Control Block It is a data structure maintained by the Operating System for every process. The PCB is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of a process. Process ID-Unique identification for each of the process in the operating system. Process State-The current state of the process i.e., whether it is ready, running, waiting, or whatever. Process privileges-this is required to allow/disallow access to system resources. Pointer-A pointer to parent process. Program Counter-Program Counter is a pointer to the address of the next instruction to be executed for this process. CPU registers-various CPU registers where process need to be stored for execution for running state. CPU Scheduling Information-Process priority Information Process ID Process State Pointer Process priority Program Counter CPU registers Etc. A typical Process Control Block

Process Scheduling Nowadays Processor Performs multiple task at a time.it is only possible when each task(process) is scheduled.there are two types of scheduling. 1) Preemptive: In this all the Processes are executed by using some Amount of Time of CPU. 2) NON-Primitive: In this No Time Scheduling is used. after Completing the First Process, this will Automatically start the Second Process. Some scheduling techniques are following- 1) First Come First Serve: As the name Suggest, the Processes those are Coming first, will be Executed first 2) Shortest Job first: In this Scheduling, All the Process are Arranged into their Size and shortest sized process is selected first. 3) Priority Scheduling: When the Process are Given, then Each Process have a Priority.Highest priority is choosen first. 4) Round Robin: In this Scheduling the Time of CPU is divided into the Equal Parts and Assign to various Processes. 5) Multilevel Queue Scheduling: In this The Time of CPU is divided by using Some Process Categories.