Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.

Slides:



Advertisements
Similar presentations
Processes Management.
Advertisements

7 Operating Systems Foundations of Computer Science ã Cengage Learning.
Chapter 10 Operating Systems.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Operating Systems: Software in the Background
Operating System Support Focus on Architecture
Chapter 10 Operating Systems. 2 Chapter Goals Describe the two main responsibilities of an operating system Define memory and process management Explain.
©Brooks/Cole, 2003 Chapter 7 Operating Systems. ©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components.
Chapter 11 Operating Systems
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
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 3  Manage the computer’s resources ◦ CPU ◦ Memory ◦ Disk drives ◦ Printers  Establish a user interface  Execute and provide services for applications.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 3 Memory Management: Virtual Memory
Operating systems CHAPTER 7.
Chapter 10 Operating Systems *. 2 Chapter Goals Describe the main responsibilities of an operating system Define memory and process management Explain.
 Introduction to Operating System Introduction to Operating System  Types Of An Operating System Types Of An Operating System  Single User Single User.
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.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 10 Operating Systems.
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.
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.
1 Sec (3.2) Operating System Architecture OS. 2 Software dividing into two categories: 1. Application software 2. System Software  Operating System 
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.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
7.1 7 Operating Systems Foundations of Computer Science  Cengage Learning.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
©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.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
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.
©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
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Chapter 7 Operating Systems.
Memory Management.
Chapter 2 Memory and process management
Applied Operating System Concepts -
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
Introduction to Operating System (OS)
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
Operating System Architecture OS
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.
COMP755 Advanced Operating Systems
Presentation transcript:

Chapter 7 Operating Systems

Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the concept of deadlock and starvation. After reading this chapter, the reader should be able to: O BJECTIVES List some of the characteristics of popular operating systems such as Windows 2000, UNIX, and Linux.

Computer System Application programs – use the computer hardware to solve users ’ problems. Operating systems – control the access of hardware by users.

DEFINITIONDEFINITION 7.1

An operating system is an interface between the hardware of a computer and the user (program or human) that facilitates the execution of the other programs and the access to hardware and software resources. Note:

Goals of An operating system 1. Efficient use of hardware 2. Easy to use resources. Note:

EVOLUTIONEVOLUTION 7.2

Batch systems Card-reader + line-printer + tape-drive Job – a program to be executed.

Time-sharing systems Multiprogramming  Hold several jobs in memory  Only assign a resource to a job that needs it on the condition that the resource is available. Time-sharing – Resources can be shared between different jobs. Each job can be allocated a portion of time to use the resource.

Time-sharing systems Scheduling – allocating the resources to different programs and deciding which program should use which resource when. A job is a program to be run. A process is a program that is in memory and waiting for resources. programjobprocess

Personal systems Personal computer Single-user operating systems.

Parallel systems Multiple CPUs on the same machine. Each CPU can be used to serve one program or a part of a program. Many tasks can be accomplished in parallel instead of serially.

Distributed systems A program can be run partially on one computer and partially on another computer if they are connected through an internetwork such as the Internet. Resources can distributed.

COMPONENTSCOMPONENTS 7.3

Components of an operating system User Interface (Shell) is responsible for communication outside the OS.

Memory Manager Memory management  Monoprogramming  Multiprogramming Memory allocation must be managed to prevent the “running out of memory” syndrome.

Monoprogramming Most of the memory capacity is dedicated to one single program. The whole program is in memory for execution. When the program finishes running, it is replaced by another program.

Monoprogramming Memory manager  Load the program into memory  Run it  Replace it with the next program Problems of Monoprogramming  The program must fit in memory.  When the I/O operations are being carried out, the CPU is idle.

Multiprogramming More than one program is in memory at the same time, and they are executed concurrently. The CPU switches between the programs.

Categories of multiprogramming Nonswapping – the program remains in memory during execution. Swapping – the program can be swapped between memory and disk one or more times during execution.

Partitioning Memory is divided into variable length sections. Each program is entirely in memory and occupying contiguous locations. The CPU switches between programs. It executes some instructions until it either  encounters an I/O operation or  the allocated time has expired. Fragmentation  internal fragmentation – memory space that is internal to a partition, but is not being used.  external fragmentation – Enough memory space exists but not contiguous.

Partitioning

Paging Memory is divided into equally sized sections called frames. The program is divided into equally sized sections called pages. The program does not have to be contiguous in memory. The whole program still needs to be in memory before being executed. Fragmentation  internal fragmentation – the last frame.  No external fragmentation – Allows non-contiguous allocation.

Paging

Demand Paging & Demand Segmentation Demand Paging - The pages can be loaded into memory one by one on demand. Demand Segmentation – The program is divided into segments that match the programmer’s view (modules). Demand Paging and Segmentation

Virtual memory Demand Paging & Demand Segmentation – Part of the program is in main memory and part is on the disk. A physical memory size of 10MB can execute 10 programs, each of size 3MB. → A virtual memory size of 30MB.

Process manager Program – a nonactive set of instructions stored on disk. Job – a program becomes a job from the moment it is selected for executed until it has finished running and becomes a program again.  May be Residing on disk (Hold) In memory waiting for an I/O event (Waiting) In memory waiting for execution (Ready) In memory while being executed by CPU (Running) Has finished executing and becomes a program again (Terminated) Process - a program in execution - a job in memory

State diagram A process in the running state, one of three tings can happen:  exhausts its allocated slot of time  execute until it needs I/O  terminated

Process manager uses two schedulers to move a job/process from one state to another:  Job scheduler – create a process from a job terminate a process  Process scheduler – move a process from one state to another.

Job scheduler

Process scheduler

Queuing (waiting list)  Process manager uses queues to handle multiple processes/jobs Waiting for CPU (Ready queue) Waiting for memory (Job queue) Waiting for I/O device (I/O queue) JCB/PCB (Job control block/Process control block) – store information about that job/process Process manager stores the JCB/PCB in the queues instead of the job/process itself. Process manager can have different policies for selecting next job/process from a queue.  FIFO(First In First Out)  Shortest length first  Priority

Queues for process management

Process management – synchronize different processes with different resources. Deadlock – occurs if OS  allows a process to start running without first checking to see if the required resources are ready and  allows the process to hold it as long as it want. Process Synchronization

Four necessary conditions for deadlock:  Mutual exclusion – only one process can hold a resource  Resource holding – a process holds a resource even though it cannot use it until other resources are available.  No preemption – OS cannot temporarily reallocate a resource  Circular wait – all processes and resources involved form a loop Don’t allow anyone to happen. Deadlock

Deadlock on a bridge

Deadlock occurs when OS does not put resource restrictions on processes. Note:

Dining philosophers

Starvation Starvation – It can happen when OS puts too many resource restrictions on a process. [ex.] OS specifies possession of all the required resources before a process can be run

Starvation

Figure 7-15.c Starvation

I/O manager – is responsible for access to I/O devices.  Assure that the devices are functioning properly.  Maintain queues  Control scheduling policies Device manager

controls access to the files. Creation/deletion/modification Naming Storage of files Archiving and backup Archive – copy files to a long-term storage medium for backup. File manager

POPULAROPERATINGSYSTEMSPOPULAROPERATINGSYSTEMS 7.4

Windows 2000  GUI  Virtual memory  Multiprogramming UNIX  Portable OS (written mostly in C)  A powerful set of utilities (commands)  Device independent (include device drivers in OS itself) Linux  Based on UNIX  Make UNIX more efficient when run on an Intel microprocessor Popular Operating Systems