Similar documents
Chapter 1: Introduction

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

Operating Systems. studykorner.org

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

CSC 453 Operating Systems

Module 1: Introduction

Module 1: Introduction. What is an Operating System?

OPERATING SYSTEMS UNIT - 1

Introduction to Operating System

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

CS370 Operating Systems

OPERATING SYSTEM. Functions of Operating System:

Module 1: Introduction

Introduction to Operating Systems (Part II)

CSC 453 Operating Systems

To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

CS370 Operating Systems

Chapter 3: Operating-System Structures

Module 3: Operating-System Structures

Contents. Today's Topic: Introduction to Operating Systems

Operating Systems Fundamentals. What is an Operating System? Focus. Computer System Components. Chapter 1: Introduction

Operating-System Structures

Operating-System Structures

Module 3: Operating-System Structures. Common System Components

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

NETW3005 Operating Systems Lecture 1: Introduction and history of O/Ss

Operating System Review

Chapter 1: Introduction

Course Details. Operating Systems with C/C++ Course Details. What is an Operating System?

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Institute of Engineering & Management. Course:CS603- Operating System. Course pre-requisites

Chapter 3: Operating-System Structures

Introduction to Computer Systems and Operating Systems

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Operating Systems. Lecture Course in Autumn Term 2015 University of Birmingham. Eike Ritter. September 22, 2015

Introduction to Operating System. Dr. Aarti Singh Professor MMICT&BM MMU

Chapter 1: Introduction

Batch processing is a technique in which Operating System collects programs and data together in

Chapter 1: Introduction. Chapter 1: Introduction

European University of Lefke. Instructor: Dr. Arif SARI

Chapter 1: Introduction

COSC243 Part 2: Operating Systems

CS30002: Operating Systems. Arobinda Gupta Spring 2017

7/20/2008. What Operating Systems Do Computer-System Organization

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

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

Introduction. CS3026 Operating Systems Lecture 01

Chapter 3: Operating-System Structures

Introduction. What is an Operating System? A Modern Computer System. Computer System Components. What is an Operating System?

CSE Opera+ng System Principles

CSI3131 Final Exam Review

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

UNIT I OPERATING SYSTEMS OVERVIEW

UNIT 1 JAGANNATH UNIVERSITY UNIT 2. Define Operating system and its functions. Explain different types of Operating System

Chapter 1: Introduction

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

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

DM510 Operating Systems. Jacob Aae Mikkelsen

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

Operating Systems Overview. Chapter 2

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Operating System - Overview

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

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

ROEVER ENGINEERING COLLEGE, PERAMBALUR DEPARTMENT OF INFORMATION TECHNOLOGY OPERATING SYSTEMS QUESTION BANK UNIT-I

Subject Name:Operating system. Subject Code:10EC35. Prepared By:Remya Ramesan and Kala H.S. Department:ECE. Date:

Chapter 1: Introduction. Operating System Concepts 8th Edition,

QUESTION BANK UNIT I

Lecture 1 Introduction (Chapter 1 of Textbook)

CS420: Operating Systems

MARUTHI SCHOOL OF BANKING (MSB)

Operating System Services

Operating System(16MCA24)

1. Operating System Concepts

Timers 1 / 46. Jiffies. Potent and Evil Magic

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

Module 20: Multi-core Computing Multi-processor Scheduling Lecture 39: Multi-processor Scheduling. The Lecture Contains: User Control.

Chapter 2: Operating-System Structures. Operating System Concepts 8 th Edition

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Introduction to Operating Systems

Introduction to OS (cs1550)

Multiprocessor and Real- Time Scheduling. Chapter 10

Chapter 1: Introduction. Operating System Concepts 8th Edition,

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

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

Chapter 14 Operating Systems

The Lesson Plan of OS. The syllabus of OS. Access the lesson plan and syllabus at

Part I Overview Chapter 1: Introduction

CLASS: II YEAR / IV SEMESTER CSE SUBJECT CODE AND NAME: CS6401 OPERATING SYSTEMS UNIT I OPERATING SYSTEMS OVERVIEW

Operating Systems. Overview. Dr Alun Moon. Computing, Engineering and Information Sciences. 27th September 2011

Unit 2 : Computer and Operating System Structure

Overview of Operating Systems

Course Content. 07-Feb-17 Faculty of Computer Science & Engineering 1 BK TP.HCM

Operating Systems : Overview

CS420: Operating Systems

Operating System: an Overview. Lucia Dwi Krisnawati, MA

Operating- System Structures

Introduction. TDDI04, K. Arvidsson, IDA, Linköpings universitet Contents. What is an Operating System (OS)?

Transcription:

Operating System For Computer Science & Information Technology By www.thegateacademy.com

Syllabus Syllabus for Operating System Processes, Threads, Inter Process Communication, Concurrency and Synchronization, Deadlock, CPU Scheduling, Memory Management and Virtual Memory, File Systems Analysis of GATE Papers Year Percentage of Marks Over All Percentage 2015 8.30 2014 7.00 2013 12.00 2012 9.33 2011 5.00 2010 7.00 8.66% 2009 8.00 2008 9.33 2007 9.33 2006 11.33 : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com

Contents Contents Chapters Page No. #1. Introduction to Operating System 1 11 What is an Operating System 1 2 Evolution of Operating System 2 4 Major Achievements 4 5 Operating System Operations 6 Micro Kernel Architecture 7 9 Assignment 10 Answer Keys & Explanations 11 #2. Process Management 12 43 Process 12 Process vs Program 12 Process State 13 Process Creation 14 15 Process Termination 15 16 Intercrosses Communication, Concurrency and Synchronization 17 19 The Critical-Section Problem 19 21 Bakery Algorithm 22 23 Semaphores 23 26 Readers and Writers Problem 26 Dining-Philosophers Problem 26 28 Monitors 28 31 Solved Examples 32 35 Assignment 1 36 39 Assignment 2 39 40 Answer Keys & Explanations 41 43 #3. Threads 44 49 Thread 44 Life Cycle of Threads 44 46 User Level and Kernel Level Threads 46 47 Assignment 48 Answer Keys & Explanations 49 #4. CPU Scheduling 50 68 Basic Concept 50 Schedulers 50 51 Scheduling Methodology 51 CPU Scheduling Algorithm 52 58 : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com i

Solved Examples 58 61 Assignment 1 62 64 Assignment 2 64 65 Answer Keys & Explanations 66 68 #5. Deadlocks 69 80 Definition 69 Resource Allocation Graph 69 Conditions for Deadlock 70 Deadlock Prevention 70 71 Deadlock Avoidance 71 73 Deadlock Detection 73 74 Recovery From Deadlock 74 Assignment 1 75 77 Assignment 2 78 Answer Keys & Explanations 79 80 #6. Memory Management 81 114 Introduction 81 Logical and Physical Address Space 81 82 Memory Management Requirements 82 84 Memory Allocation Method 84 89 Paging 89 92 Segmentation 93 95 Page Replacement Algorithm 96 97 Thrashing 98 Solved Examples 99 109 Assignment 1 110 111 Assignment 2 111 112 Answer Keys & Explanations 113 114 #7. File System 115 131 Introduction 115 117 Access Methods 117 118 Directory Structure 118 120 Protection 120 125 Solved Examples 126 127 Assignment 1 128 129 Assignment 2 129 130 Answer Keys & Explanation 130 131 Contents : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com ii

#8. I/O System 132 146 Introduction 132 Kernel I/O Subsystem 132 135 Disk Management 135 137 Solved Examples 138 140 Assignment 1 141 143 Assignment 2 143 144 Answer Keys & Explanations 145 146 #9. Protection and Security 147 157 Domain of Protection 147 150 Security Problem 150 152 Solved Examples 152 154 Assignment 1 155 Assignment 2 156 Answer Keys & Explanations 157 Module Test 158 169 Test Questions 158 165 Answer Keys & Explanations 165 169 Reference Books 170 Contents : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com iii

CHAPTER 1 "The highest reward for one's toil is not what one gets for it, but what one becomes by it." John Ruskin Introduction to Operating System Learning Objectives After reading this chapter, you will know: 1. What is an Operating System 2. Evolution of Operating System 3. Major Achievements 4. Operating System Operations 5. Micro Kernel Architecture What is an Operating System An operating system is a collection of programs and utilities. It acts as the interface between user and computer. It creates an user friendly environment for user. The Operating System acts as a Resource Manager. A Computer system has many resources (Hardware and Software) which may be required for completing a task. The computer uses resources like input/output device, memory, file, storage space, CPU time and so on. The operating system acts as a manager of these resources and allocates them to specific program and users as necessary for their tasks. Therefore we can say an operating system acts as a resource manager. Generally resource sharing will be done in two ways in time and in space. For example a CPU is a time sharing resource and the main memory is a space sharing resource. The main difference between in time sharing and in space sharing resource is in time resource is not divided into units, where as in space resources is divided into units. Structure of Computer System The structure of Computer system consists of 4 layers; These are hardware, software, system program and application program. The hardware part consists of CPU, Main memory, I/O device, Secondary storage etc. The software includes process management routines, memory management routines, I/O control routines, file management routines. The system program layer consist of complier, assembler etc. Last one is the application program that depends on users. : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com 1

Introduction to Operating System Components of a Computer System User User User User n Compiler ssembler Text ditor atabase ystem perating ystem Computer ardware Evolution of Operating System (i) Serial Processing: Before 1950 the programmers were directly interacting with hardware. There was no operating system at that time. If the programmer had to execute a program on those days the following steps were necessary. Type the program on punch card Convert punched card to card reader Submit to the computing machine, if there is any error, the condition was indicated by lights. The programmer examines the registers and main memory to identify the cause of error. Take the output of error. Take the output on the printers. Then the programmer ready for the next program This type of processing takes much time and next program should wait for the completion of previous one. The programs are submitted to the machine one after one. Therefore this machine is said to be serial processing. (ii) Batch Processing: In older days (before 1960), it was difficult to execute a program using computer. Because the computer located in three rooms. One room for card reader second room for executing the program third room for printing the result. The user or machine operator needs to run between these three rooms to complete a job. We can solve this problem using Batch Processing. In batch processing same type of tasks are grouped together and executed at a time. The carrier carries the group of job at a time from one room to another. Therefore the programmer need not to run between these 3 rooms several times. (iii) Multiprogramming: Multiprogramming is a technique to execute number of programs simultaneously by a single processor. In multiprogramming, more than one process can reside in main memory at a time. The operating system picks and begins execute one of the jobs in the main memory. In non multiprogramming system, the CPU can execute only one program at a time. If the running program is waiting for any I/O device, the CPU becomes idle, so it will effect the : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com 2

Introduction to Operating System performance of the CPU. But in multiprocessing environment, any I/O wait happened in a process then the CPU switches from the job to another job in the job pool. So the CPU is not idle at any time. (iv) Time Sharing System: Time sharing or multitasking is a logical extension of multiprogramming. In time sharing system, the CPU selects a job from the ready queue and switches the CPU to that job. When the time slot is expired, the CPU switches from this job to another. In this method CPU is shared by different processes, so it is said to be Time haring ystem. The main advantage of time sharing system over the batch processing system is the user can interact with the job when it is executing but it is not possible in batch system. Another advantage of time sharing system is efficient CPU utilization. (v) Parallel System/Multiprocessing System: If a system has more than one processor in close communication, sharing the computer bus, the clock, memory and peripheral devices, this system is referred as tightly coupled system. system consisting of more than one processor and if it is a tightly coupled and then the system is called parallel system. One advantage of parallel system is increased Throughput. The performance of CPU is measured in terms of Throughput. The number of jobs completed by a CPU with in a time period is said to be Throughput. Multiprocessor can also save money compared to multiple single system because the processor can share peripherals, cabinet and power supply. Another advantages of multiprocessor system is that they increase reliability. (vi) Distributed System: In distributed system, the processor can t share memory or clock, each processor has its own local memory. The processor communicate one another though various communication lines. These systems are usually called loosely coupled systems. The advantage of distributed system are: 1. Resource sharing 2. Computation speed up 3. Reliability (vii) Real Time System: Used when there are rigid time requirements on the operating of a processor or the flow of data. Systems that control scientific experiments, medical imaging systems, industrial control systems and some display system are real time systems. Two types of real time systems are 1. A Hard Real Time System: guarantees that critical tasks completed on time. 2. Soft Real Time System: A less restrictive type of real time system is a soft real time system. Given their date of deadline support they are risky to use for industrial control and robotics : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com 3

Spooling Introduction to Operating System The expansion of spooling is simultaneous peripheral operations on line. Simultaneous means for example if two or more users issue print command and the printer accept the request even the printer is printing some other jobs. The printer printing one job at the same time the spool disk can load some other jobs. Operating System Functions 1. Program creation 2. Programs execution 3. Input output operation 4. Error detection 5. Resource allocation 6. Accounting 7. Protection Major Achievements The major functionalities of operating system are given below: Process Management A process is a program in execution: (A program is passive in nature while a process is active) A process has resources (CPU time, files) and attribute that must be managed. Management of Processes Includes Process scheduling (Priority, Time Management) Creation/Termination Block/Unblock (Suspension/Resumption) Synchronization Communication Deadlock handling Debugging Main Memory Management Allocation/De-allocation of memory for processes, files, I/O Maintenance of several processes at a time Keep track of memory usage Movement of process memory to/from secondary storage. File Management A file is a collection of related information defined by its creator, commonly files represent program (both source and object forms) and data. The operating system is responsible for the following activities in connections, with file : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com 4

Management File creation and deletion Directory creation and deletion Support of primitives for manipulating files and directories Mapping files onto secondary storage File backup on stable (nonvolatile) storage media Introduction to Operating System I/O Management Buffer caching system Generic device driver code Drivers for each device- translate requests into position commands Secondary Storage Management Disk, tapes, optical Free space management (Paging/Swapping) Storage allocation (what data goes where on disk) Disk scheduling Networking Communication system between distributed processors Getting information about files/processes/etc, on remote machine Can use either a message passing or a shared memory model Protection Protection of files, memory, CPU, etc. Controlling of access Depends on the attributes of the file and user System Program Command Interpreters Program that accepts control statements (Shell, GUI interface, etc.) Compilers/Linkers Communication (FTP, Telnet, etc.) System Tailoring Modifying the operating System program for a particular machine. The goal is to include all the necessary pieces but not too many extra ones. Typically a system can support many possible devices but any installation has only a few of the possibilities. Plug and play allows for detection of device and automatic inclusion of the code (driver) necessary to drive these devices. A system is usually a link of many OS routines/modules in order to produce an executable code to run the drivers. : 080-617 66 222, info@thegateacademy.com Copyright reserved. Web:www.thegateacademy.com 5