©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

7 Operating Systems Foundations of Computer Science ã Cengage Learning.
Chapter 10 Operating Systems.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Operating System Support Focus on Architecture
©Brooks/Cole, 2003 Chapter 7 Operating Systems. ©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components.
Chapter 8 Operating System Support
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Chapter 11 Operating Systems
Computer Organization and Architecture
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Chapter 91 Memory Management Chapter 9   Review of process from source to executable (linking, loading, addressing)   General discussion of memory.
Chapter 3 Memory Management: Virtual Memory
Operating systems CHAPTER 7.
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
The Operating Systems Layer
©Brooks/Cole, 2003 Chapter 7 Operating Systems. ©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
SWE202 Review. Processes Process State As a process executes, it changes state – new: The process is being created – running: Instructions are being.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
OPERATING SYSTEMS Lecture 3: we will explore the role of the operating system in a computer Networks and Communication Department 1.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
OPERATING SYSTEMS - I. What is an Operating System OS is a program that manages the computer hardware It provides a basis for application programs and.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
CPSC 171 Introduction to Computer Science System Software and Virtual Machines.
7.1 7 Operating Systems Foundations of Computer Science  Cengage Learning.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 OS 1.
©Brooks/Cole, 2003 Chapter 7 Operating Systems 作業系統 ( 電腦的管家婆 )
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
Chapter 7 Operating Systems Foundations of Computer Science  Cengage Learning 1.
7.1 Operating Systems. 7.2 A computer is a system composed of two major components: hardware and software. Computer hardware is the physical equipment.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
©Brooks/Cole, 2003 Chapter 7 Operating Systems. ©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH (7) Operating System CPIT 201 Introduction.
Computer Architecture Chapter (8): Operating System Support
Chapter 7 Operating Systems.
Memory Management.
Processes and threads.
Chapter 2 Memory and process management
Understanding Operating Systems Seventh Edition
Chapter 8: Main Memory.
Process Management Process Concept Why only the global variables?
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
Virtual Memory Networks and Communication Department.
7 Operating system Foundations of Computer Science ã Cengage Learning.
Operating systems Lecture 3: we will explore the role of the operating system in a computer Networks and Communication Department.
Main Memory Management
Page Replacement.
Intro. To Operating Systems
Operating Systems.
Operating Systems.
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 3: Processes Process Concept Process Scheduling
Operating System Overview
COMP755 Advanced Operating Systems
Presentation transcript:

©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-1 Computer System Control access to hardware by user Use computer hardware to resolve problems

©Brooks/Cole, 2003 O.S. DEFINITION 7.1

©Brooks/Cole, 2003 Definition of Operating System An operating system is an interface between the hardware and programs or humans An operating system is a program that facilitates the execution of other programs. An operating system is a general manager supervising the activity of computer’s components. Operating System design goals Efficient use of hardware. Easy to use resources

©Brooks/Cole, 2003 O.S. EVOLUTION 7.2 Dr. Barnawi

©Brooks/Cole, Batch Systems Each program to be executed is called a job. A programmer sends a job request along with punched cards for the program and the data. Programmer had no interaction with the system. If the program was successful, the result was sent to the programmer, if not a printout of error was sent. Operating systems only ensured that all of the resources were transferred from one job to the next

©Brooks/Cole, Time Sharing Systems Multiprogramming was introduced to hold several jobs in memory. Multiprogramming system only assign resources to a job when it is available. Multiprogramming brought the idea of time sharing where resources are shared between different jobs. Multiprogramming requires a more complex OS. The OS has to do scheduling and decide which program should use the resources and when. Dr. Barnawi

©Brooks/Cole, Personal System Introduced for personal computers. Examples Disk Operating System (DOS)

©Brooks/Cole, Parallel System The need for more speed and effecincy has led to the design of parallel systems; multiple CPU in the same machine. Each CPU can be used to serve one program which means that many task can be accomplished in parallel. These OS are more complex than the ones with single CPU.

©Brooks/Cole, Distributed System Networking has created a new operating systems. In these system, jobs that was previously done in one computer can be shared between computers that are physically separated. In these OS, resources can be distributed. Dr. Barnawi

©Brooks/Cole, 2003 COMPONENTSCOMPONENTS 7.3

Figure 7-2 Components of an operating system

©Brooks/Cole, 2003 Memory Manager Memory allocation must be managed to prevent the “running out of memory ” syndrome. Operating systems can be divided into two broad categories of memory management: 1.Monoprogramming 2.Multiprogramming.

©Brooks/Cole, 2003 Figure 7-3 Monoprogramming Not used anymore. Most of the memory is dedicated to one single program with only a small part used to hold the operating system. When a program finishes running, it is replaced by another program Dr. Barnawi

©Brooks/Cole, 2003 Problems with monoprogramming The program cant run if the size of the program is greater than the size of the memory. When the program runs, no other program can be executed.

©Brooks/Cole, 2003 Figure 7-4 Multiprogramming More than one program are in the memory and can be executed concurrently. CPU switches between the programs

©Brooks/Cole, 2003 Figure 7-5 Categories of multiprogramming Programs stay in memory during execution Programs can swap between memory and disk during execution Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-6 Partitioning Memory is divided into sections. Each holds a program CPU switches between programs. It starts with one program and execute some instructions until either encounters I/O operation or time for program run out. The CPU will save the address of last instruction and move to the next program. CPU will get back to the first program after all programs are served

©Brooks/Cole, 2003 Partitioning (Issues) Memory manager determines the partition size  If partition sizes are small, programs cannot be loaded in the memory.  If partition sizes are large, there might be some holes (unused locations) in the memory. When there are many holes, memory manager removes the holes and create new partitions, this would create extra overhead on the system. Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-7 Paging Memory is divided into equal sized sections (frames) Program is divided into pages The size of the page and frame are the same and equal to the size of the block used to retrieve data from Disk. The page is loaded to the memory. The program doesn’t have to be contiguous

©Brooks/Cole, 2003 Paging (issues) Advantage of paging that it doesn’t need OS to partition the memory as the size of programs changes. Paging improves efficiency but the whole program needs to be in memory before being executed

©Brooks/Cole, 2003 Demand Paging Paging require the entire program to be in memory. However demand paging, pages can be loaded one by one, executed and then replaced by new pages. Memory can hold one page from multiple programs at the same time.

©Brooks/Cole, 2003 Demand Segmentation A program is usually made of a main program and subprograms. In Demand Segmentation, the program is divided into segments (modules) that match the programmer’s view. Modules are loaded into the memory, executed and replaced by another module from the same or different program.

©Brooks/Cole, 2003 Demand Paging and segmentation A segment (module) may be too large to fit any space in memory. In this case, module is divided into pages and each page is loaded into memory and executed one by one.

©Brooks/Cole, 2003 Figure 7-8 Virtual memory (swapping)- Example 6 MB 24 MB 6 programs each 4 MB At one time, 1 MB of each program is in the memory and 3 MB are in the Disk. Program #1 #2 #3 #4 #5 #6 Frame (1 MB) Page (1 MB) Dr. Barnawi

©Brooks/Cole, 2003 Process Manager Operating system uses three terms; Program; A non active set of instruction that stored in the disk. Job; is a program that is picked by the CPU for execution. Process; is a program in execution.

©Brooks/Cole, 2003 Figure 7-9 State diagram with the boundaries between a program, a job, and a process

©Brooks/Cole, 2003 Figure 7-10 Job scheduler Job scheduler is responsible for creating a process from job and terminating a process.

©Brooks/Cole, 2003 Figure 7-11 Process scheduler Process scheduler moves a process from one state to another. Dr. Barnawi

©Brooks/Cole, 2003 Queuing There are many jobs and processes and process competing with each other for computer resources. To handle multiple processes and jobs, the process manager uses queues. Job control block stores information about jobs. Process control block stores information about processes.

©Brooks/Cole, 2003 Figure 7-12 Queues for process management Process manager has different priority polices for selecting the next job or process; FIFO, short first…

©Brooks/Cole, 2003 Process Synchronization The whole idea of process management is to synchronize different processes with different resources. Whenever resources are shared, two different situations are created: –Deadlock –Starvation Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-13 Deadlock

©Brooks/Cole, 2003 Figure 7-14 Deadlock Deadlock occurs if all of the following conditions are met: 1.Mutual Exclusion; only one process can hold resources at a time. 2.Resource holding; process holds the resource until other resource is released. 3.No pre-emption; the O. S. cant temporarily reallocate resources. 4.Circular waiting; all processes and resources form a loop.

©Brooks/Cole, 2003 Figure 7-15.a Starvation Starvation happens when OS puts too many restriction on resources

©Brooks/Cole, 2003 Figure 7-15.b Starvation Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-15.c Starvation Dr. Barnawi

©Brooks/Cole, 2003 Figure 7-16 Dining philosophers-Dijkstra

©Brooks/Cole, 2003 Device Manager accessing I/O devices The device manager; Monitors every input/output device constantly to assure it is functioning properly. Maintains a queue of each I/O devices or one or more queues for similar I/O devices. Controls the different polices for accessing I/O devices.

©Brooks/Cole, 2003 File Manager accessing the files The file manager Controls access file; access is permitted only to those allowed, and the type of access can vary. Supervises the creation, deletion… of files Controls, naming. Manages where, how… files are stored. Responsible for archiving and backups.

©Brooks/Cole, 2003 User Interface User interface accepts requests from users and interpret them to the rest of the O.S. User interface in Windows series is a Graphical User Interface (GUI) Dr. Barnawi

©Brooks/Cole, 2003 POPULAROPERATINGSYSTEMSPOPULAROPERATINGSYSTEMS 7.4