Lecture Operating systems: A concept-based approach (2/e): Chapter 1 - Dhananjay M. Dhamdhere

39 49 0
Lecture Operating systems: A concept-based approach (2/e): Chapter 1 - Dhananjay M. Dhamdhere

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter 1 - Introduction. In this chapter, the following content will be discussed: Overview of operating systems, OS and the computer system, memory utilization during operation of an OS, the program status word (PSW), privileged mode of CPU, state of the CPU,...

PROPRIETARY MATERIAL. ©  2007 The McGraw­Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide  may be displayed, reproduced or distributed  in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw­Hill  for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission.  Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 1 Copyright © 2008 What is an operating system ? • An operating system (OS) is a collection of programs that achieve effective utilization of a computer system by providing – Convenient methods of using a computer * Saves users’ time and boosts their productivity – Efficient use of the computer • An OS has several kinds of users – The OS meets diverse requirements of different kinds of users – Each user has a different view of what an OS is, and what it does Each of these views is called an abstract view Chapter 1: Introduction Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:2 Copyrightâ2008 Abstract views An abstract view focuses on the essential characteristics of a system – It contains some selected characteristics, and ignores others * It helps to control complexity in designing and understanding a system, by hiding unnecessary detail – For example, two abstract views of a car: * The driver’s view contains the rear-view mirror, steering, gear shift, and speedometer but ignores engine details * The mechanic’s view contains fluid levels, electrical system, … Q: Give examples of abstract views A: View of an abstract data type, object, Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 3 Copyright © 2008 Abstract views • Abstract views are used in – Software requirements specification * Specify what functions a system should perform  The abstract view of a specific function helps in understanding the system data and fundamental operations on them – Software design and implementation * ‘Hiding’ the details of functions and subsystems while designing or implementing other functions and subsystems helps to control complexity Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 4 Copyright © 2008 A designer’s abstract view of an OS •  User interface: Accepts commands from users: GUI, command line interface •  Non­kernel programs: Implement user commands •  Kernel: Core of the OS─controls the computer, provides functions & services Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 5 Copyright © 2008 A designer’s abstract view of an OS • The abstract view consists of three components – The kernel programs * interact with the computer’s hardware and implement the intended operation – The non-kernel programs * implement creation of programs and use of system resources by them These programs use kernel programs to control operation of the computer – The user interface * interprets the commands of a user and activates non-kernel programs to implement them Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 6 Copyright © 2008 Goals of an OS • Two primary goals of an OS are – Efficient use of the computer’s resources * To ensure cost-effectiveness of the computer – User convenience * A user should find it easy to use the computer • These two goals sometimes conflict – Prompt service can be provided through exclusive use of a computer; however, efficient use requires sharing of a computer’s resources among many users – An OS designer decides which of the two goals is more important under what conditions * That is why we have so many operating systems! Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 7 Copyright © 2008 User convenience • The computing environment influences the notion of user convenience – The computing environment is comprised of * The computer system * Its interfaces with other systems * Nature of computations performed by its users – Computing environments change with the architecture and use of a computer, e.g personal computing, online applications, embedded applications – Hence the notion of user convenience has several facets that depend on the computing environment Chapter1:Introduction Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:8 Copyrightâ2008 User convenience User convenience has several facets – Fulfillment of a necessity * Use of programs and files – Good service * Speedy response – Ease of Use * User friendliness – New programming model * e.g., Concurrent programming – Web-oriented features * e.g., Web-enabled servers – Evolution * Addition of new features, use of new computers Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 9 Copyright © 2008 Operation of an OS • During operation, an OS performs two primary functions – Program management * Perform program initiation/termination * Provide means through which many programs can work toward a common goal  Helps in more convenient or faster fulfillment of user requirements – Resource management * Ensure efficient use of resources  Use of CPU, I/O devices Chapter 1: Introduction Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo:10 Copyrightâ2008 Managing memory The OS services a large number of processes simultaneously – It must make efficient use of memory – It must perform memory allocation and de-allocation speedily – These requirements may conflict, hence special techniques are used to implement effective memory management Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed SlideNo:25 Copyrightâ2008 Virtual Memory Users may wish to write very large programs Some of these programs may not fit in memory – The OS uses virtual memory to overcome this problem * Only some portion(s) of the code and data of a process are present in memory at any time * Other portions are loaded in memory when needed * Portions not presently needed may be removed from memory Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 26 Copyright © 2008 A schematic of virtual memory operation TheOSmaintainsinformationaboutportionsofaprocessthatareinmemory Amissingfrommemoryeventoccursifarequiredportionisnotinmemory TheOSnowloadsitinmemory Chapter1:Introduction Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:27 Copyrightâ2008 File processing • The file system ensures effectiveness of file processing – Provides convenient methods for a user to create, access and share files * Each file organization provides efficient access for a specific record access patterns – Provide assurance needed by users * Security and protection techniques to ensure that files are not accessed by unauthorized persons * Reliability techniques to ensure that files are not lost or damaged due to failures in the system Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 28 Copyright © 2008 Part II: Advanced topics • Process synchronization – Enables processes to work harmoniously towards common goals • Message passing – Facilitates communication among processes • Deadlock handling – Avoids indefinite waits • Implementation of file operations – Techniques to ensure efficiency and reliability • Multiprocessor operating systems – Ensure effective and efficient use of the multiple CPUs • Structure of operating systems – Provides portability and extensibility of operating systems Chapter1:Introduction Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:29 Copyrightâ2008 Process synchronization Process synchronization is employed for two purposes – Data sharing * Processes should share data or resources such that only one process uses a data item or a resource at any time  It avoids data inconsistency – Coordination of activities * Processes must perform their operations in a desired order  e.g., if a process wishes to use some data produced by another process, it must read the data only after the other process has assigned a value to it Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 30 Copyright © 2008 Two kinds of process synchronization (a) The Credit and Debit processes share the account balance, hence only oneofthemshouldaccessitatanytime (b)GenerateproducesasampleandAnalyzeanalyzesit.Analyzemust waitifGeneratehasnotyetproducedasample Chapter1:Introduction Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:31 Copyrightâ2008 Deadlocks Some resources cannot be shared across processes; they must be used by only one process at a time – If a resource is in use by a process, another process wishing to use the resource must wait for the process to release it * Indefinite waits would arise if processes wait for each other  This situation is called a deadlock  It degrades response time and efficiency of use Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 32 Copyright © 2008 A deadlock involving three processes •  Pk  needs a resource that is currently allocated to Pi •  Pi  needs a resource that is currently allocated to Pj •  Pj  needs a resource that is currently allocated to Pk •  Each of the processes waits indefinitely Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 33 Copyright © 2008 Part III: Distributed Operating Systems • A distributed system consists of several computer systems connected through a network – Terminology * A computer, which is called a host or node, exists in a site – A distributed OS manages computers in a distributed system in a well-integrated manner to provide two key benefits * high reliability  Redundancy of resources in various computers is exploited to ensure that a process can complete despite failures * speed-up of a computation by performing some of its parts in different computer systems Chapter 1: Introduction Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo:34 Copyrightâ2008 Issues in Distributed OS Individual computers in a distributed system have their own clocks and memories – Clocks in different computers are not synchronized, hence they may show different times – It is difficult to obtain a consistent view of data and activities * E.g., balances in two accounts, recorded while transferring funds between them, may not be mutually consistent (see next slide) • A distributed OS has to use special techniques to ensure consistency and reliability – Important during normal operation and recovery from a failure Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 35 Copyright © 2008 Consistency issues in a distributed OS •  An observer in node Z records balances in accounts A and B while     funds are being transferred •  Z may record balance of X before $100 are transferred from it to Y,     and balance of Y after the transfer—$100 are generated! •  Z may record balance of X after $100 are transferred from it to Y,     and balance of Y before the transfer—$100 are lost! Chapter 1: Introduction Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo:36 Copyrightâ2008 Issues in Distributed OS Theoretical issues – How to know the order in which events have occurred? * Important for FCFS allocation, etc – How to know the state of a system * Important for avoiding inconsistencies and performing ‘load balancing’ across nodes to obtain good performance • Distributed control algorithms – Parts of the algorithm run in different nodes * Obviates the need to collect ‘global’ state in one node * Special techniques are used to ensure consistency of actions – Used for resource allocation, scheduling, deadlock handling, etc Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 37 Copyright © 2008 Issues in Distributed OS • Recovery – User computations should not suffer due to node or link failures * OS restores computations in a failed node to a previous state * Special techniques are used to ensure consistency across nodes • Distributed file systems – Files can be accessed from any node * Special techniques are needed to ensure good performance when a non-local file is accessed * Special techniques are also needed to ensure reliability when nodes or network links fail Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 38 Copyright © 2008 Issues in Distributed OS • Distributed system security – Security threats arise from intruders, and viruses and worms – OS must provide measures to * Prevent intruders from corrupting or fabricating network messages * Enable processes to verify identities of other processes * Ensure data security  Enable users to know who created a document or data  Enable users to know whether documents or data have been tampered with Chapter 1: Introduction Dhamdhere: Operating Systems— A Concept­Based Approach, 2 ed Slide No: 39 Copyright © 2008 ...      one of them should access it at any time (b) Generate produces a sample and Analyze analyzes it. Analyze must        wait if Generate has not yet produced a sample Chapter 1:  Introduction Dhamdhere: Operating Systems—... systems Chapter 1:  Introduction Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo :13 Copyrightâ2008 Program management A computational structure is a configuration of several programs... programs so that their results are available to one another Chapter1 :Introduction Dhamdhere: OperatingSystems AConceptưBasedApproach,2ed SlideNo :14 Copyrightâ2008 A schematic of scheduling ProgramswaitingforCPUattentionareenteredinapool

Ngày đăng: 30/01/2020, 00:22

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan