Chapter 14 Operating Systems

Similar documents
Chapter 14 Operating Systems

Computer Fundamentals : Pradeep K. Sinha& Priti Sinha

OPERATING SYSTEM. Functions of Operating System:

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory

Computer. Operating Systems Introduction to Operating System (OS)

CHAPTER-1: INTRODUCTION TO OPERATING SYSTEM:

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

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

UNIT - 2 OPERATING SYSTEMS

Contents. Today's Topic: Introduction to Operating Systems

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

CSC 453 Operating Systems

Operating System Study Material

Operating Systems Overview. Chapter 2

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Module 1: Introduction

Chapter 1: Introduction

CHAPTER 2: PROCESS MANAGEMENT

Module 1: Introduction

Operating System Overview. Chapter 2

OPERATING SYSTEMS UNIT - 1

Introduction. CS3026 Operating Systems Lecture 01

Module 1: Introduction. What is an Operating System?

OPERATING SYSTEMS OVERVIEW

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

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Operating System Services

Process Description and Control. Chapter 3

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

Chapter 1: Introduction

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

Operating System - Overview

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

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

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

Computer Software A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and

Operating Systems CS3502 Spring 2018

Operating Systems Overview. Chapter 2

An Operating System History of Operating Systems. Operating Systems. Autumn CS4023

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

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

2. The system of... generally ran one job at a time. These were called single stream batch processing.

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

Chapter 8 Operating Systems and Utility Programs أ.أمل زهران

Accounting Software. Collaboration Software

Operating System Review

Overview of Unix / Linux operating systems

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

Department of Computer applications. [Part I: Medium Answer Type Questions]

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

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

Operating Systems. studykorner.org

Chapter 2 Software Components

Introduction to Operating System

Chapter 8 Operating Systems and Utility Programs

Chapter 2 Operating System Overview

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

Introduction to Operating Systems (Part II)

Computer Hardware and System Software Concepts


Chapter 1: Introduction

Solved MCQs on Operating System Principles. Set-1

OPERATING SYSTEMS. P. PRAVEEN Asst.Prof, CSE

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

HANDOUTS/ NOTES/ STUDY MATERIAL. Jagannath Institute of Management Sciences Lajpat Nagar OPERATING SYSTEM

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

Operating System: an Overview. Lucia Dwi Krisnawati, MA

OS - Introduction Ezio Bartocci Institute for Computer Engineering

QUESTION BANK UNIT I

CSC 453 Operating Systems

CS30002: Operating Systems. Arobinda Gupta Spring 2017

Introduction to System Programming

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

Introduction to Operating Systems

Announcement. Exercise #2 will be out today. Due date is next Monday

Chapter 2: Operating-System Structures

CHAPTER NO - 1 : Introduction:

Operating System. Operating System Overview. Layers of Computer System. Operating System Objectives. Services Provided by the Operating System

Operating System Overview. Operating System

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

Operating System. Operating Systems Structure Chapter 2. Services Provided by the OS. Evolution of an Operating System

Following are a few basic questions that cover the essentials of OS:

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

TYPES OF OPERATING SYSTEMS. Dimple Juneja

CSCI 447 Operating Systems Filip Jagodzinski

Systems Programming. The Unix/Linux Operating System

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

CSC 539: Operating Systems Structure and Design. Spring 2006

OPERATING SYSTEM SUPPORT (Part 1)

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

Major OS Achievements. Chris Collins. 15 th October 2006

Chapter 3: Operating-System Structures

Process Description and Control

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

Unit 2 : Computer and Operating System Structure

Operating Systems (ECS 150) Spring 2011

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Operating Systems Course 2 nd semester 2016/2017 Chapter 1: Introduction

Process Description and Control

Technology in Action

Transcription:

Chapter 14 Operating Systems Ref Page Slide 1/54 Learning Objectives In this chapter you will learn about: Definition and need for operating system Main functions of an operating system Commonly used mechanisms for: Process management Memory management File management Security Command interpretation module Some commonly used OS capability enhancement software Some popular operating systems Ref Page 251 Slide 2/54 1

Definition and Need for OS Integrated set of programs that controls the resources (the CPU, memory, I/O devices, etc.) of a computer system Provides its users with an interface or virtual machine that is more convenient to use than the bare machine Two primary objectives of an OS are: Making a computer system convenient to use Managing the resources of a computer system Ref Page 251 Slide 3/54 Logical Architecture of a Computer System Users Other System Software and Application Programs Operating System Computer Hardware The operating system layer hides the details of the hardware from the programmer and provides the programmer with convenient interface for using the system Ref Page 252 Slide 4/54 2

Main Functions of an OS Process management Memory management File management Security Command interpretation Ref Page 252 Slide 5/54 Parameters for Measuring System Performance Throughput: Amount of work that the system is able to do per unit time Turnaround time: Interval from the time of submission of a job to the system for processing to the time of completion of the job Response time: Interval from the time of submission of a job to the system for processing to the time the first response for the job is produced by the system Ref Page 253 Slide 6/54 3

Process Management A process (also called job) is a program in execution Process management manages the processes submitted to a system in a manner to minimize idle time of processors (CPUs, I/O processors, etc.) of the system Ref Page 253 Slide 7/54 Process Management Mechanisms in Early Systems Manual loading mechanism: Jobs were manually loaded one after another in a computer by the computer operator Batch processing mechanism: Batch of jobs was submitted together to the computer and job-to-job transition was done automatically by the operating system Job Control Language (JCL): Control statements were used to facilitate job loading and unloading Ref Page 253 Slide 8/54 4

Use of Job Control Statements in Batch Processing (An Example) $END Data for program $RUN $LOAD COBOL program $COBOL $JOB, ONGC05839, USER=SINHA Ref Page 255 Slide 9/54 Multiprogramming Uniprogramming: Only one job is processed at a time and all system resources are available exclusively for the job until its completion Multiprogramming: Interleaved execution of two or more different and independent programs by a computer Types of Multiprogramming: Multiprogramming with fixed tasks (MFT): Fixed number of jobs can be processed concurrently Multiprogramming with variable tasks (MVT): Number of jobs can vary Area occupied by each job residing simultaneously in the main memory is known as a memory partition Ref Page 255 Slide 10/54 5

Job CPU bound: Mostly perform computations with little I/O operations. Scientific and engineering computations usually fall in this category I/O bound: Mostly perform I/O operations with little computation. Commercial data processing applications usually fall in this category Ref Page 255 Slide 11/54 Uniprogramming System Main memory Operating system OS area User job User program area Execution in progress CPU Only one job is processed by the system at a time and all the system resources are exclusively available for the job until it completes Ref Page 255 Slide 12/54 6

Multiprogramming System Main memory Operating system Writing output data Job A Job B Secondary disk storage Job C (Waiting for CPU) Execution in progress CPU Ref Page 257 Slide 13/54 Process States in Multiprogramming New job Ready Job is allocated the CPU for execution Running Job processing completed I/O completed Blocked Job must wait for I/O completion Ref Page 257 Slide 14/54 7

Requirements of Multiprogramming Systems Large memory Memory protection Job status preservation Proper job mix (CPU and I/O bound jobs) CPU scheduling Ref Page 257 Slide 15/54 Process Control Block (PCB) process identifier process state program counter values of various CPU registers accounting and scheduling information I/O status information PCB is used to preserve the job status of each loaded process in a multiprogramming system Ref Page 257 Slide 16/54 8

Multitasking Interleaved execution of multiple jobs (often referred to as tasks of same user) in a single-user system Computer systems used for multitasking are uniprocessor systems (having only one CPU) Treated differently from multiprogramming that refers to interleaved execution of multiple jobs in a multiuser system Ref Page 258 Slide 17/54 Multithreading Thread is basic unit of CPU utilization. Threads share a CPU in the same way as processes do All threads of a process also share the same set of operating system resources All threads of a process inherit parent s address space and security parameters Each thread of a process has its own program counter, its own register states, and its own stack Referred as mini-process or lightweight process Ref Page 258 Slide 18/54 9

Multithreading System Address space Thread Address space Thread Thread Thread (a) Single-threaded and (b) multithreaded processes. A single-threaded process corresponds to a process of a traditional operating system. [Reproduced with permission, from the book titled Distributed Operating Systems: Concepts and Design by Pradeep K. Sinha. 1997 IEEE, USA]. Ref Page 259 Slide 19/54 Multiprocessing System with two or more CPUs having ability to execute multiple processes concurrently Multiple CPUs are used to process either instructions from different and independent programs or different instructions from the same program simultaneously Types of multiprocessing: Tightly-coupled: Single system-wide primary memory shared by all processors Loosely-coupled: Each processor has its own local memory Ref Page 259 Slide 20/54 10

CPU, Memory, and I/O Processors of a Computer System Main memory I/O Units I/O Processors CPU Ref Page 260 Slide 21/54 Multiprocessing System CPU-1 Main memory CPU-2 I/O processors I/O processors I/O units I/O units Ref Page 260 Slide 22/54 11

Time-sharing Simultaneous interactive use of a computer system by many users in such a way that each one feels that he/she is the sole user of the system User terminals connected to the same computer simultaneously Uses multiprogramming with a special CPU scheduling algorithm Short period during which a user process gets to use CPU is known as time slice, time slot, or quantum CPU is taken away from a running process when the allotted time slice expires Ref Page 261 Slide 23/54 Process State Diagram for a Time-Sharing System New Job Ready I/O completed Job is allocated to CPU for execution Allotted time slice is over Blocked Running Job must wait for I/O completion Job processing completed Ref Page 261 Slide 24/54 12

Advantages of Time-sharing Systems Reduces CPU idle time Provides advantages of quick response time Offers good computing facility to small users Ref Page 262 Slide 25/54 Memory Management Memory is important resource of a computer system that must be properly managed for the overall system performance Memory management module: Keeps track of parts of memory in use and parts not in use Allocates memory to processes as needed and deallocates when no longer needed Ref Page 262 Slide 26/54 13

Uniprogramming Memory Model Used in systems that process one job only at a time, and all system resources are available exclusively for the job until it completes Simple and easy to implement Does not lead to proper utilization of the main memory as unoccupied memory space by the currently active user process remains unused Used only on very small or dedicated computer systems Ref Page 262 Slide 27/54 Uniprogramming Memory Model Operating system area Operating system User process User area Unused Ref Page 263 Slide 28/54 14

Multiprogramming Memory Models Two memory management schemes used to facilitate this are: Multiprogramming with fixed number of memory partitions: User area of the memory is divided into a number of fixed-sized partitions Multiprogramming with variable number of memory partitions: Number, size and location of the partitions vary dynamically as processes come and go Ref Page 263 Slide 29/54 Multiprogramming with Fixed Number of Memory Partition Operating system area Operating system Partition 1 Partition 2 User area divided into n equal-sized partitions Partition 3 Partition n Ref Page 263 Slide 30/54 15

Multiprogramming with Variable Number of Memory Partitions Operating system Time Operating system Operating system Operating system P 1 P 1 P 1 P 1 P 2 P 3 User area Free comes Free comes P 2 comes P 2 Free P 3 Free (a) (b) (c) (d) The number, size, and location of the partitions vary dynamically as processes come and go. (contd ) Ref Page 264 Slide 31/54 Multiprogramming with Variable Number of Memory Partitions Operating system Operating system Operating system Operating system P 2 terminates P 1 P 2 Free 2 P 4 Comes which cannot fit in Free 1 so is allocated space from Free 2 P 1 P 4 Free 2 P 1 terminates Free 3 P 4 Free 2 P 5 comes which can fit in Free 3 P 5 Free 3 P 4 Free 2 P 3 P 3 P 3 P 3 Free 1 Free 1 Free 1 Free 1 (e) (f) (g) (h) The number, size, and location of the partitions vary dynamically as processes come and go. Ref Page 264 Slide 32/54 16

Virtual Memory Memory management scheme that allows execution of processes that might not be completely loaded in the main memory. It does not require the entire process to be in memory before the process can execute Ref Page 265 Slide 33/54 Virtual Memory Realization Three basic concepts used for its realization are: On-line secondary storage: Used to keep a process s address space ready to be loaded into the memory Swapping: Process of transferring a block of data from the on-line secondary storage to main memory (swapping in) or vice-versa (swapping out) Demand paging: Scheme of swapping in of pages of a process as and when needed during execution of the process, rather than loading all the pages before starting the process s execution Ref Page 265 Slide 34/54 17

Advantages of Virtual Memory Provides a large virtual memory to programmers on a system having smaller physical memory Enables execution of a process on a system whose main memory size is less than the total memory required by the process Enables a process s execution to be started even when sufficient free memory for loading the entire process is not available Makes programming easier there no longer need to worry about the memory size limitations Often leads to less I/O activity resulting in better throughput, turnaround time, and response time Ref Page 266 Slide 35/54 Disadvantages of Virtual Memory Difficult to implement because it requires algorithms to support demand paging If used carelessly, it may substantially decrease performance due to high page fault rate Ref Page 266 Slide 36/54 18

File Management A file is a collection of related information Every file has a name, its data and attributes File s name uniquely identifies it in the system and is used by its users to access it File s data is its contents File s attributes contain information such as date & time of its creation, date & time of last access, date & time of last update, its current size, its protection features, etc. File management module of an operating system takes care of file-related activities such as structuring, accessing, naming, sharing, and protection of files Ref Page 266 Slide 37/54 File Access Methods Two commonly supported file access methods are: Sequential access: Information stored in a file can be accessed sequentially (in the order in which they are stored, starting at the beginning) Random access: Information stored in a file can be accessed randomly irrespective of the order in which the bytes or records are stored Ref Page 267 Slide 38/54 19

File Operations Set of commands provided by an operating system to deal with files and their contents Typical file operations include create, delete, open, close, read, write, seek, get attributes, set attributes, rename, and copy Ref Page 267 Slide 39/54 File Naming File naming deals with the rules for naming files in an operating system. This may include such rules as: Maximum number of characters that a file name may have Special characters allowed in a file name Distinction between upper case and lower case letters Multi-part file names allow file extensions to be part of a file name. File extensions indicate something about the file and its content Used by applications to check for the intended type of file before operating on it Ref Page 268 Slide 40/54 20

File Extensions (Example) File extension.bas.c.ftn.pas.obj.bin.lib.dat.hlp.man Its meaning Basic source program file C source program file Fortran source program file Pascal source program file Object file (compiler output, not yet linked) Executable binary program file Library of.obj files used by the linker Data file Text file for HELP command Online manual page file (Continued on next slide Ref Page 268 Slide 41/54 File Extensions (Example) (Continued from previous slide) File extension.man.txt.bak.doc.wav.wk4.xls.jpg.gif Its meaning Online manual page file General text file Backup file Microsoft word document file Microsoft windows sound file Lotus 1-2-3 spreadsheet file Microsoft Excel spreadsheet file JPEG graphics file GIF graphics file Ref Page 268 Slide 42/54 21

Security Deals with protecting the various resources and information of a computer system against destruction and unauthorized access External security: Deals with securing computer against external factors such as fires, floods, earthquakes, stolen disks/tapes, etc. by maintaining adequate backup, using security guards, allowing access to sensitive information to only trusted employees/users, etc. Internal security: Deals with user authentication, access control, and cryptography mechanisms Ref Page 269 Slide 43/54 Security User authentication: Deals with the problem of verifying the identity of a user (person or program) before permitting access to the requested resource Access Control: Once authenticated, access control mechanisms prohibit a user/process from accessing those resources/information that he/she/it is not authorized to access Cryptography: Means of encrypting private information so that unauthorized access cannot use information Ref Page 269 Slide 44/54 22

Command Interpretation Provides a set of commands using which the user can give instructions to the computer for getting some job done by it Commands supported by the command interpretation module are known as system calls (Continued on next slide) Ref Page 269 Slide 45/54 Command Interpretation (Continued from previous slide) Two types of user interfaces supported by various operating systems are: Command-line interface: User gives instructions to the computer by typing the commands Graphical User Interface (GUI): User gives commands to the system by selecting icon or menu item displayed on the screen with the use of a pointand-draw device Ref Page 269 Slide 46/54 23

OS Capability Enhancement Software Perform several tasks of routine nature, frequently needed by users but are not provided as part of the OS They are primarily grouped into three categories: Translating programs: Translate a source program into an object program Library programs: Consist of frequently used functions and operations Utility programs: Assist users with system maintenance tasks such as disk formatting, data compression, data backups, antivirus utilities Ref Page 270 Slide 47/54 UNIX OS Developed in the early 1970s at Bell Laboratories by Ken Thompson and Dennis Ritchie Written in C high-level language, hence, highly portable Multi-user, time-sharing OS Used on a wide variety of computers ranging from notebook computers to super computers Especially prevalent on RISC workstations such as those from Sun Microsystems, Hewlett-Packard, IBM, and Silicon Graphics Structured in three layers kernel, shell, and utilities Ref Page 272 Slide 48/54 24

MS-DOS Stands for Microsoft Disk Operating System. Single-user OS for IBM and IBM-compatible personal computers (PC) Structured in three layers BIOS (Basic Input Output System), kernel, and shell Very popular in the 1980s, now not in much use and development with the launch of Microsoft Windows OS in 1990s Ref Page 272 Slide 49/54 Microsoft Windows Developed by Microsoft to overcome limitations of MS- DOS operating system Single-user, multitasking OS Native interface is a GUI Designed to be not just an OS but also a complete operating environment OS of choice for most PCs after 1990 Ref Page 272 Slide 50/54 25

Microsoft Windows NT Multi-user, time-sharing OS developed by Microsoft Designed to have UNIX-like features so that it can be used for powerful workstations, network, and database servers Supports multiprogramming and is designed to take advantage of multiprocessing on systems having multiple processors Native interface is a GUI Built-in networking and communications features Provides strict system security Rich set of tools for software development Ref Page 273 Slide 51/54 Linux Open-source OS enhanced and backed by thousands of programmers world-wide Multi-tasking, multiprocessing OS, originally designed to be used in PCs Name Linux is derived from its inventor Linus Torvalds Several Linux distributions available (Red Hat, SuSE). Difference in distribution is mostly set of tools, number and quality of applications, documentation, support, and service Ref Page 273 Slide 52/54 26

Keywords/Phrases Access control Batch processing Command interpretation Command-line interface (CLI) CPU-bound jobs Cryptography Demand paging External security File File attributes File extensions File management Graphical User Interface (GUI) I/O-bound jobs Internal security Job control language (JCL) Library programs Linux Loosely coupled system Memory management Memory partition Microsoft Windows Microsoft Windows NT MS-DOS Multiprocessing Multiprogramming Multiprogramming with fixed tasks (MFT) Multiprogramming with variable tasks (MVT) Operating systems Multithreading Process Process Control Block (PCB) Multitasking Process management Random access files Response time Security Sequential access files Swapping Ref Page 274 (Continued on next slide) Slide 53/54 Keywords/Phrases Throughput Tightly coupled system Time-sharing Time slice Time slot Translating programs Turnaround time Unix User authentication Utility programs Virtual machine Virtual memory (Continued from previous slide) Ref Page 274 Slide 54/54 27