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

Slides:



Advertisements
Similar presentations
Interactive lesson about operating system
Advertisements

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.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Course: Operating Systems Instructor: Umar Kalim NUST Institute of Information Technology, Pakistan Operating Systems.
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:
Chapter 1: Introduction
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.
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
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Operating Systems CSCI 411.
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.
Operating System Principles And Multitasking
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.
Chapter 1: Introduction
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:

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

2 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

3 Course Info  Textbook  Silberschatz, Galvin, Gagne, Operating System Concepts, 7th edition, (We will refer to it as OSC)  Grading  Assignments: 30% (problem sets and programming projects)  Midterm exam: 25%  Class participation: 5%  Final exam: 40%  Web page

4 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)

5 Chapter 1: Introduction

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

7 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 the system resources are used to solve the computing problems of the users Word processors, compilers, web browsers, database systems, video games  Users People, machines, other computers

8 Four Components of a Computer System

9 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

10 Operating System Goals  Make the computer system convenient to use  Execute user programs and make solving user problems easier  Use the computer hardware in an efficient manner  Note:  The one program running at all times on the computer” is the kernel  Everything else is either a system program (ships with the operating system) or an application program

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

12 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

13 Interrupt Handling  OS preserves state of CPU by storing registers and the program counter.  Determines which type of interrupt has occurred:  polling  vectored interrupt system (common)  The corresponding interrupt handler is called to process the interrupt

14 Storage Systems: Hierarchy Cost Speed  Storage systems  Speed  Cost  Volatility

15 Comparison of Storage Systems

16 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 the cache (fast)  If not, data copied to cache and used there

17 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, not matter where it is in the storage hierarchy  Cache consistency

18 Operating System Operations  OS is interrupt 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 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  Some instructions designated as privileged, only executable in kernel mode  Why dual mode?  To enable OS to protect itself from users codes, and protect users from each other

19 Transition from User to Kernel Mode

20 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

21 Multiprogramming in OS  Multiprogramming  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

22 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