Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.

Slides:



Advertisements
Similar presentations
Interactive lesson about operating system
Advertisements

CMSC 421: Principles of Operating Systems Section 0202 Instructor: Dipanjan Chakraborty Office: ITE 374
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Chapter 1: Introduction
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction  What is an Operating System  What Operating Systems Do  How is it filling our life 1-1 Lecture 1.
Modified from Silberschatz, Galvin and Gagne ©2009 CS 446/646 Principles of Operating Systems Lecture 1 Chapter 1: Introduction.
1.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Instructor:
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
1/16/2008CSCI 315 Operating Systems Design1 Introduction Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1/18/2008CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
Chapter 1: Introduction
Objectives To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 1: Introduction.
CS212: OPERATING SYSTEM Lecture 1: Introduction 1.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction n What is an Operating System? n Mainframe Systems.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Four Components of a Computer System. Computer System Components Users (people, machines, other computers) Applications programs – define the ways in.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 1 Introduction Read:
Operating Systems (CS 340 D)
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2 Computer-System Structures n Computer System Operation n I/O Structure.
2: Computer-System Structures
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Operating Systems CSCI 411.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do (previous.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do Computer-System.
1.1 Operating System Concepts Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  What Operating Systems Do  Computer-System Organization  Computer-System Architecture  Operating-System Structure.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
1.1 Sandeep TayalCSE Department MAIT 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming Batched Systems Time-Sharing Systems.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edit9on Chapter 1: Introduction.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
OPERATING SYSTEM CONCEPT AND PRACTISE
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Operating Systems (CS 340 D)
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Computer-System Architecture
Chapter 1: Introduction
Subject Name: Operating System Concepts Subject Number:
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Presentation transcript:

Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department

(Chapter-1) Introduction

Chapter 1 Introduction 1.What Operating Systems Do 2.Computer-System Organization 3.Computer-System Architecture 4.Operating-System Structure 3

OBJECTIVES :  To describe the basic organization of computer systems.  To provide a grand tour of the major components of operating systems.  To give an overview of the many types of computing environments. 4

5 What is an Operating System?

 A program that acts as an intermediary between a user of a computer and the computer hardware  Operating system goals:  Execute user programs and make solving user problems easier  Use the computer hardware in an efficient manner 6

Operating System Functions 7  Process Management  Memory Management  File Management  Device Management  Command Interpretation  Security

Computer System Structure  Consists of four components 1. Hardware : provides basic computing resources (CPU, memory, I/O devices) 2. Operating system: Controls and coordinates (use, hardware, applications) 3. Application programs : “ define the ways in which the system resources are used to solve the computing problems of the users” ex: (Word processors, compilers, web browsers, database systems, video games) 4. Users : People, machines, other computers 8

Four Components of a Computer System 9

The operating system’s Role 1- User View: 10 category exampleOS is designed to Single Userpersonal computerease of use Multiple User’smainframe l minicomputer maximize resource utilization Workstations usersconnected to networks or servers compromise between individual usability and resource utilization. Handheld computersSingle user & may connected to networks individual usability and performance per unit of battery life is important as well. Embedded computers If the computers have little or no user view run without user intervention (minimize usability)

The operating system’s Role (cont.) 2- System View: 11 OS is a resource allocatorOS is a control program Manages all resources (e.g. CPU time, memory space, file-storage space, I/O devices…etc) Decides between conflicting requests of many users access the same mainframe or minicomputer Controls execution of programs to prevent errors It is especially concerned with the operation and control of I/O devices.

Operating System Definition  Operating System Definition:  It is a software that manage the computer hardware and provide an environment for application programs to run  “The one program running at all times on the computer” is the kernel.  Everything else is either a  system program  application program 12

13 Computer-System Organization

1.Computer-System Operation 2.Storage Structure 3.I/O Structure 14

Computer System Organization  Computer-system operation  A general-purpose computer system consists of  One or more CPU  Multiple device controllers that are connected through a common bus  RAM connecting to CPU and device controllers through common bus  Each device controller is responsible of a specific type of device (e.g. disk drives, audio devices, and video displays).  The CPU and the device controllers can execute concurrently, competing for memory cycles. So, a memory controller is provided whose function is to synchronize access to the memory.

Computer-system operation

Computer Startup:  bootstrap program is loaded at power-up or reboot  Typically stored in ROM, generally known as firmware  Initializes all aspects of system  Loads operating system kernel and starts execution ROM : read-only memory,  Once data has been written onto a ROM chip, it cannot be removed and can only be read. Firmware: Firmware is software that is embedded in a piece of hardware. You can think of firmware simply as "software for hardware.“ Typical examples of devices containing firmware are embedded systems (such as traffic lights, consumer appliances, and digital cameras ) The firmware contained in these devices provides the control program for the device. Firmware is held in non-volatile memory 17 Computer System Organization 1-Computer-system operation(cont..)

Interrupt:  It generated from either the hardware or the software  Hardware  sending a signal to the CPU through system bus.  Software  by executing a special operation called a system call.  A trap is a software-generated interrupt caused either by an error or a user request The interrupt is signal that gets the attention of the CPU and is Usually generated when I/O is required. For example: hardware interrupts are generated when a key is pressed or when the mouse is moved. Software interrupts are generated by a program when I/O is required. 18 Computer System Organization 1-Computer-system operation(cont..)

 Main memory – only large storage media that the CPU can access directly  Secondary storage – extension of main memory that provides large nonvolatile storage capacity  Magnetic disks – rigid metal or glass platters covered with magnetic recording material  Disk surface is logically divided into tracks, which are subdivided into sectors  The disk controller determines the logical interaction between the device and the computer 19 Computer System Organization 2-Storage Structure

 All forms of memory provide an array of words. Each word has its own address.  Interaction is achieved through a sequence of load or store instructions to specific memory addresses.  The load instruction>>> moves a word from RAM to CPU’s register  The store instruction>>> moves the content of a CPU’s register to RAM  CPU automatically loads instructions from main memory for execution. 20 Computer System Organization 2-Storage Structure(cont..)

Storage Structure (cont.)  Typical instruction-execution cycle : 1. Fetches an instruction from memory and stores that instruction in the instruction register. 2. The instruction is decoded and may cause operands to be fetched from memory and stored in some internal register. 3. the instruction on the operands is executed 4. the result may be stored back in memory. 21

Storage Structure (cont.)  Storing programs and data in RAM permanently is impossible because:  RAM is too small to store all needed programs and data permanently.  RAM is volatile storage device that loses its contents when power is turned off. 22

Storage Hierarchy  Storage systems organized in hierarchy  Speed  Cost  size  Volatility  Caching  It is copying information into faster storage system.  Caches can be installed to improve performance where a large access-time or transfer-rate disparity exists between two components.  The design of a complete memory system must balance all the factors just discussed:  It must use only as much expensive memory as necessary while providing as much inexpensive, nonvolatile memory as possible. 23

More expensive and faster volatile Non- volatile can be volatile or non volatile 24 Computer System Organization 2-Storage Structure (cont..)

 A large portion of OS code is dedicated to managing I/O, because of:  Its importance to the reliability and performance of a system  The varying nature of the devices. 25 Computer System Organization 3-I/O Structure

 A device controller maintains some local buffer storage and a set of special-purpose registers.  The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.  Operating systems have a device driver for each device controller. This device driver understands the device controller 26 Computer System Organization 3-I/O Structure(cont..)

I/O Structure (cont.)  Typical I/O operation: (method #1)  The device driver loads the appropriate registers within the device controller.  The device controller, examines the contents of these registers to determine what action to take (such as “read “a character from the keyboard”).  The controller starts the transfer of data from the device to its local buffer.  Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation.  The device driver then returns control to the operating system, possibly returning the data or a pointer to the data if the operation was a read.  This form of interrupt-driven I/O is fine for moving small amounts of data but can produce high overhead when used for bulk data movement such as disk I/O. 27

I/O Structure (cont.)  Direct memory access I/O operation: (method #2)  This method is used to solve the problem of moving bulk data without causing OS overhead >>>> (to improve performance)  What is direct memory access (DMA) ?  After setting up buffers, pointers, and counters for the I/O device, the device controller transfers an entire block of data directly to or from its own buffer storage to memory, with no intervention by the CPU.  Only one interrupt is generated per block, to tell the device driver that the operation has completed, rather than the one interrupt per byte generated for low-speed devices.  While the device controller is performing these operations, the CPU is available to accomplish other work. 28

29 Computer-System Architecture

 Single-processor systems : one CPU 30  MULTIPROCESSOR SYSTEMS have two or more processors in close communication, sharing the computer bus and some times the clock, memory, and peripheral devices..

Computer-System Architecture  Single-processor systems  It has one CPU capable of executing a general-purpose instruction set, including instructions from user processes.  Most systems use a single processor (PDAs through mainframes)  Almost all systems have other special-purpose processors  The use of special-purpose microprocessors is common and does not turn a single-processor system into a multiprocessor. 31

Computer-System Architecture  About special-purpose processors :  They may come in the form of device-specific processors, such as disk, keyboard controllers  Special-purpose processors run a limited instruction set and do not run user processes. 32

Computer-System Architecture  MULTIPROCESSOR SYSTEMS  Also known as parallel systems, tightly-coupled systems  have two or more processors in close communication, sharing the computer bus and some times the clock, memory, and peripheral devices.  Advantages include: 1. Increased throughput  more work is performed 2. Economy of scale  Multiprocessor systems can cost less than equivalent multiple single-processor systems, because they can share peripherals, mass storage, and power supplies. 3. Increased reliability  the failure of one processor will not halt the system, only slow it down. 33

 MULTIPROCESSOR SYSTEMS TYPES – (CONT.): 34 Computer-System Architecture (cont..) Asymmetric Multiprocessing Symmetric Multiprocessing (SMP) o Each processor is assigned a specific task. o master-slave relationship o A master processor controls the system; It schedules and allocates work to the slave processors. o Each processor performs all tasks within the operating system. (peer =equal rank) o Each processor has its own set of registers & cache o All processors share physical memory.

Symmetric Multiprocessing Architecture 35

 SMP pros (++):  many processes can run simultaneously —N processes can run if there are N CPUs—  SMP Cons (--):  OS must carefully control I/O to ensure that the data reach the appropriate processor.  since the CPUs are separate, one may be sitting idle while another is overloaded, resulting in inefficiencies.  All modern operating systems—including Windows, Mac OS X, and Linux—now provide support for SMP. 36 Computer-System Architecture (cont..)

o Processors were originally developed with only one core. o The core : is the part of the processor that actually performs the reading and executing of the instruction. o Single-core processors can process only one instruction at a time  Multi-cores chips. o It is a recent trend in CPU design is to include multiple computing cores on a single chip. 37 Computer-System Architecture (cont..)

A Dual-Core Design l Dual-core processor contains two cores (Such as Intel Core Duo). l Multi-core systems are especially suited for server systems such as database and Web servers. 38 o Multi-cores chips can be more efficient than multiple chips with single cores because: 1. on-chip communication is faster than between-chip communication 2.one chip with multiple cores uses significantly less power than multiple single-core chips.

39 Operating System Structure

n Multiprogramming environment:  Single program cannot keep CPU and I/O devices busy at all times  Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute.  Multiprogramming idea is as follows:  The operating system keeps several jobs in memory simultaneously.  One job selected and run via job scheduling.  When it has to wait (for I/O for example), OS switches to another job  Eventually, the first job finishes waiting and gets the CPU back.  As long as at least one job needs to execute, the CPU is never idle. 40

Memory Layout for Multiprogrammed System  RAM is too small to accommodate all jobs, the jobs are kept initially on the disk in the job pool.  This pool consists of all processes residing on disk awaiting allocation of main memory. 41

Operating System Structure  Time sharing (or multitasking) system:  It is a logical extension of multiprogramming.  In time-sharing systems, the CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running.  The CPU time is shared by different processes, so it is called as “Time sharing Systems”.  Time slice is defined by the OS, for sharing CPU time between processes.  CPU is taken away from a running process when the allotted time slice expires.  Eg.: Unix, etc 42

Operating System Structure  A time-shared operating system allows many users to share the computer simultaneously. each user is given the impression that the entire computer system is dedicated to his use.  Each user has at least one separate program in memory.  A process : is a program loaded into memory and executing 43

Thank you End of Chapter 1 44

Some Helpful Notes  Some terminologies :  Usability = ease of use  Utilization= efficiency  Performance= speed  Synchronize = manage the timing  System overhead = more work must be performed by the system (e.g. more load) 45

Some Helpful Notes (cont.)  Load & store operations between RAM & CPU is different from Load & store operations between RAM & storage devices  Between RAM & CPU :  The load instruction>>> moves a word from RAM to CPU’s register  The store instruction>>> moves the content of a CPU’s register to RAM  Between RAM & Storage Devices :  The load instruction>>> moves a word from storage device to RAM.  The store instruction>>> moves a word from RAM to storage device. 46