CMPT 300: Operating Systems I Dr. Mohamed Hefeeda

Slides:



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

Interactive lesson about operating system
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
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.
Course: Operating Systems Instructor: Umar Kalim NUST Institute of Information Technology, Pakistan Operating Systems.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 1: Introduction.
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
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:
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is an Operating System? A program that acts as an intermediary.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edit9on Chapter 1: Introduction.
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.
Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do Computer-System Organization.
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 system Structure and Operation by Dr. Amin Danial Asham.
2.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 2: Computer-System Structures Computer System Operation I/O Structure.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
2: Computer-System Structures
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Operating Systems CSCI 411.
Chapter 1: Introduction Adapted to COP4610 by Robert van Engelen.
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 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.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 1: Introduction What Operating Systems Do Computer-System.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
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.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 1. Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 12, 2005 Introduction Introduction What.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 1: Introduction Narzu Tarannum(NAT) Reff: BIS.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edit9on Chapter 1: Introduction.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives To provide a grand tour of the major operating.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Applied Operating System Concepts
Chapter 2: Computer-System Structures
Chapter 1: Introduction Lecture 1 Part 1
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: Intro (excerpt)
What is an Operating System?
Computer-System Architecture
Chapter 1: Introduction Lecture 1 Part 1
Chapter 1: Introduction
Introduction to Operating Systems
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Presentation transcript:

CMPT 300: Operating Systems I Dr. Mohamed Hefeeda School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda

Course Objective Understand the basic principles of designing and implementing operating systems Why study OS? Be better developer (system and application levels) Be better computer user Use OS concepts in many different CS areas and courses

Course Info Textbook Grading Web page Silberschatz, Galvin, Gagne, Operating System Concepts, (We will refer to it as OSC) Grading Assignments: 25% (problem sets and programming projects) Midterm exam: 25% Final exam: 50% Web page http://www.cs.sfu.ca/~mhefeeda/

Topics Operating System Structures Processes and Threads CPU Scheduling and Process Coordination Memory Management Storage Management and File Systems I/O Systems Security and Protection (time permits)

Chapter 1: Introduction

Objectives To provide coverage of basic computer system organization To provide a grand tour of the major operating system components

Computer System Structure Computer system has four components Hardware – provides basic computing resources CPU, memory, I/O devices Operating system Controls and coordinates use of hardware among various applications and users Application programs – define the ways in which system resources are used to solve computing problems Word processors, compilers, web browsers, database systems, video games Users People, machines, other computers

Computer System Components

Operating System Definition OS is a program that acts as an intermediary between users and computer hardware OS is a resource allocator Manages all resources Decides between conflicting requests for efficient and fair resource use OS is a control program Controls execution of programs to prevent errors and improper use of the computer OS performs no useful function by itself; It provides environment for programs to do useful work Can you give an example entity from real life? Well, the government!

Operating System Goals Make the computer system convenient to use Execute user programs and make solving user problems easier Emphasized in PCs, handheld devices Use computer hardware in efficient manner Emphasized in large-scale computers with many users and expensive hardware (e.g., airline reservation system) Note: The OS kernel: is a program running at all times Everything else is either a system program (ships with the operating system) or an application program

Computer System Organization One or more CPUs, device controllers connect through common bus to a shared memory

Computer System Operation I/O devices and CPU can execute concurrently Each device controller is in charge of a particular device type has a local buffer I/O is performed from device to local buffer CPU moves data between main memory and local buffers Device controller informs CPU that it has finished its operation by causing an interrupt

Interrupt Handling OS preserves state of CPU by storing registers and the program counter The corresponding interrupt handler is called to process the interrupt How would OS locate the correct handler? In many systems (Windows, Linux), an interrupt vector is stored in the lowest memory locations Each entry contains the address of a handler routine in the memory Each interrupt number is mapped to an entry in the interrupt vector

Storage Systems: Hierarchy Speed Cost Volatility Cost Speed

Comparison of Storage Systems

Caching Caching Information is copied from slower to faster storage performed at many levels in a computer (HW, OS, SW) Faster storage (cache) checked first to determine if information is there If it is, information used directly from cache (fast) If not, data copied to cache and used there

Caching Example: Migration of Integer A from Disk to Register Movement between levels of storage hierarchy can be explicit or implicit Multitasking environments must be careful to use most recent value, no matter where it is in the storage hierarchy Cache consistency

Operating System Operations OS is interrupt (event) driven: sits idle till something happens Interrupts are generated by hardware devices Traps (or exceptions) are software-generated interrupts due to software errors, e.g., divide by zero, illegal memory access Request for operating system services (system calls) OS operates in two modes User mode and kernel mode Mode bit provided by hardware to indicate current mode

Operating System Operations (cont’d) Privileged Instructions Subset of instructions that may harm the system Can only be executed in kernel mode E.g., I/O control, timer management, interrupt management Why dual mode? To enable OS to protect the hardware and itself from users’ codes (which may be buggy and/or malicious), and to protect users from each other If privileged instructions can only be executed in kernel mode, how can users’ codes use them? Using System Calls (interrupts generated by software)

Transition from User to Kernel Mode User’s code issues a system call Mode is changed to kernel mode OS first checks that everything (e.g., parameter values) is in order and legal Then, OS executes system call which may contain multiple privileged instructions mode is set again to user mode

More Protection: Timer Timer to prevent program from holding resources (CPU) for too long, e.g., infinite loop How it works Before giving control to a user program, OS sets a timer to a specific value After period expires, an interrupt is issued and OS regains control OS then decides whether to grant more time for the program or terminate it

Multiprogramming in OS Multiple jobs are kept in memory so that CPU always has something to execute needed for efficiency, a single job may not keep CPU and I/O devices busy at all times One job is selected to run via CPU scheduler When the job has to wait (for I/O for example), OS switches to another job Timesharing (multitasking) CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing

Summary OS is a layer between user and hardware to make life easier for user and use hardware efficiently Computer organization CPU(s), memory, and I/O devices connect to a common bus Devices request CPU attention through interrupts Storage hierarchy: speed, cost, volatility Caching: copy frequently-used data to faster storage Multiprogramming: multiple jobs in memory  efficiency Timesharing: frequently switch between jobs  interactive Dual mode operation: user and kernel modes Protect OS and users from each other Privileged instructions executed only in kernel mode Timer to prevent processes from holding resources forever