Operating Systems (CS 340 D)

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Interactive lesson about operating system
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
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 2: Computer-System Structures Computer System Operation I/O Structure Storage.
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:
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
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.
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.
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  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 1 Introduction Read:
Operating Systems (CS 340 D)
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.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do Computer-System.
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.
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.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
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. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives To provide a grand tour of the major operating.
OPERATING SYSTEM CONCEPT AND PRACTISE
Applied Operating System Concepts
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Chapter 1: Introduction Lecture 1 Part 1
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Computer-System Architecture
Module 2: Computer-System Structures
Operating System Concepts
Chapter 1: Introduction
Chapter 1 Introduction to Operating System
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Chapter 1: Introduction Lecture 1 Part 1
Subject Name: Operating System Concepts Subject Number:
Module 2: Computer-System Structures
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Operating System Concepts
Chapter 1: Introduction
Presentation transcript:

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

(Chapter-1) Introduction

Chapter 1 Introduction What Operating Systems Do Computer-System Organization Computer-System Architecture Operating-System Structure Dr. Abeer Mahmoud

To describe the basic organization of computer systems. 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. Dr. Abeer Mahmoud

What is an Operating System? Dr. Abeer Mahmoud

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 Dr. Abeer Mahmoud

Operating System Functions Process Management Memory Management File Management Device Management Command Interpretation Security Dr. Abeer Mahmoud

Computer System Structure Consists of four components Hardware : provides basic computing resources (CPU, memory, I/O devices) Operating system: Controls and coordinates (use, hardware, applications) 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) Users : People, machines, other computers Dr. Abeer Mahmoud

Four Components of a Computer System Dr. Abeer Mahmoud

The operating system’s Role 1- User View: category example OS is designed to Single User personal computer ease of use Multiple User’s mainframe l minicomputer maximize resource utilization Workstations users connected to networks or servers compromise between individual usability and resource utilization. Handheld computers Single 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) Dr. Abeer Mahmoud

The operating system’s Role (cont.) 2- System View: OS is a resource allocator OS 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. Dr. Abeer Mahmoud

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 Dr. Abeer Mahmoud

Computer-System Organization Dr. Abeer Mahmoud

Computer-System Organization Computer-System Operation Storage Structure I/O Structure Dr. Abeer Mahmoud

Computer System Organization 1-Computer-system operation A general-purpose computer system consists of three main components 2- Multiple device controllers: connected through a common bus 1-One or more CPU 3- RAM: connecting to CPU and device controllers through common bus Dr. Abeer Mahmoud

Computer System Organization 1-Computer-system operation(cont..) 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. Dr. Abeer Mahmoud

Computer System Organization 1-Computer-system operation(cont..) Computer Startup: bootstrap program is loaded at power-up or reboot Typically stored in ROM or EEPROM, 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. EEPROM: electrically erasable programmable read-only memory. EEPROM is a special type of PROM that can be erased by exposing it to an electrical charge. Dr. Abeer Mahmoud

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 send through a system call. 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. Dr. Abeer Mahmoud

Operating-System Operations Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user

Transition from User to Kernel Mode

Computer System Organization 2-Storage Structure 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 Dr. Abeer Mahmoud

Computer System Organization 2-Storage Structure(cont..) 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. Dr. Abeer Mahmoud

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

Computer System Organization 3-I/O Structure 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. Dr. Abeer Mahmoud

Computer System Organization 3-I/O Structure(cont..) 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 Dr. Abeer Mahmoud

Computer System Organization 3-I/O Structure(cont..) DC : Responsible for moving data between Device Controller (DC) Peripherals devices that it controls eg: keyboard Local buffer storage Set of special purpose registers + Understand how? Device Driver (DD) OS Dr. Abeer Mahmoud

Computer System Organization 3-I/O Structure(cont..) (Algorithm #1) DD loads the appropriate registers within the DC DC, examines the contents of these registers to determine what action to take (such as “read “a character from the keyboard”). DC transfers data from the device to its local buffer. When finish informs DD via an interrupt DD returns control to OS, This form of interrupt-driven I/O is fine for moving small amounts of data otherwise produce high overhead Dr. Abeer Mahmoud

Computer System Organization 3-I/O Structure(cont..) (Algorithm #2 moving large data without overhead) What is direct memory access (DMA) ? After setting up buffers, pointers, and counters for the I/O device, DC 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. Dr. Abeer Mahmoud

Computer-System Architecture Dr. Abeer Mahmoud

Computer-System Architecture Single-processor systems : one CPU 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: Increased throughput : more work is performed Economy of scale : cost less Increased reliability : the failure of one processor will not halt the system, only slow it down. Dr. Abeer Mahmoud

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

Symmetric Multiprocessing Architecture Dr. Abeer Mahmoud

Computer-System Architecture (cont..) 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. Dr. Abeer Mahmoud

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

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

Operating System Structure Dr. Abeer Mahmoud

Operating System Structure 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. Dr. Abeer Mahmoud

Operating System Structure Multiprogramming environment 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. Dr. Abeer Mahmoud

Operating System Structure Time sharing (or multitasking) system: Multiple jobs are executed by switching the CPU between them. frequently that the users can interact with each program while it is running. In this, 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. ex: Unix, etc. Dr. Abeer Mahmoud

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. Dr. Abeer Mahmoud

Thank you End of Chapter 1 Dr. Abeer Mahmoud