© Janice Regan, CMPT 300, May 2007 0 CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

CSC 360- Instructor: K. Wu Overview of Operating Systems.
Operating System.
Operating Systems Manage system resources –CPU scheduling –Process management –Memory management –Input/Output device management –Storage device management.
Chapter 3 Process Description and Control
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Winter 2005 CMPE 151: Network Administration Lecture 2.
UNIX Chapter 01 Overview of Operating Systems Mr. Mohammad A. Smirat.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
Operating Systems - Introduction S H Srinivasan
Figure 1.1 Interaction between applications and the operating system.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Operating System Overview
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Operating System Overview Dr. Sunny Jeong & Mr. M.H. Park Operating Systems: Internals and Design Principles, 6/E William Stallings.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Operating System. Architecture of Computer System Hardware Operating System (OS) Programming Language (e.g. PASCAL) Application Programs (e.g. WORD, EXCEL)
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 1 Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Processes Introduction to Operating Systems: Module 3.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
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.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Faculty of Sciences and Social Sciences HOPE Chapter 2 Operating System Overview Stewart Blakeway FML
Chapter 1 Introduction  What is an operating system  History of operating systems  The operating system zoo  Computer hardware review  Operating system.
What is a Process ? A program in execution.
Security Architecture and Design Chapter 4 Part 2 Pages 319 to 357.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
CT101: Computing Systems Introduction to Operating Systems.
CSCE451/851 Introduction to Operating Systems
Introduction to Operating Systems Concepts
Computer System Structures
Operating System Structure
Processes and threads.
Operating System.
Evolution of Operating Systems
Where are being used the OS?
More examples How many processes does this piece of code create?
Lecture Topics: 11/1 General Operating System Concepts Processes
Operating Systems Lecture 3.
Chapter 2 Operating System Overview
Presentation transcript:

© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)

© Janice Regan, CMPT 300, May Time sharing: Scheduling, fair sharing  Once multiple jobs can share the CPU (sequentially, not at the same time) it becomes necessary to determine how time is shared between the processes  The simplest approach to time sharing(taken by CTSS and some later OS’s)  Each process is given N seconds of CPU, after N seconds the next processes takes its turn  There are many complexities to this simple process and other variants of sharing, some of which we will discuss later.

© Janice Regan, CMPT 300, May Program 2 Instruction P+1 Simple time sharing operation Instruction P Instruction P+2 InstructionP+3 Instruction P+5 Instruction P+7 Instruction P+8 Instruction P+9.:.: ISR4 (timer interrupt service routine) Timer Timer for program 1’s allowed time expires Send Interrupt Save registers and state program1 Restore registers and state program2 Instruction N Instruction N+1 Instruction N+2 Instruction N+3 Instruction N+5 Instruction N+6 Instruction N+8 Instruction N+7.:.: Program 1 Save registers and state program2 Restore registers and state program1 Note: program1 has been selected by the scheduler as the next program to run Timer for program 1’s allowed time expires Send interrupt

Time sharing and scheduling  In the previous example the simplest case (only two programs) was considered  In a real system there will be many programs running.  Each time an ISR runs, at the end of the interrupt servicing the scheduler must run to determine which program to give the CPU to next, and what to set the timer to © Janice Regan, CMPT 300, May

© Janice Regan, CMPT 300, May Time sharing (CTSS)  For efficiency Monitor JOB 1 free Monitor JOB 2 free Monitor JOB 3 free Monitor JOB 4 free Monitor JOB 1 free JOB2 JOB 4

© Janice Regan, CMPT 300, May Minicomputers  Near the end of this generation ( ) small, less expensive machines came into common use (for example the DEC PDP and VAX series)  Costs were reduced from millions to 100’s of thousands (about a factor of 20).  Memory counted in Kbytes, small words  Used to develop UNIX operating system (mult-user)  Problems as mini computers proliferated, each vendor had their own flavour of UNIX (BSD, system 5, POSIX …) or their own proprietary OS (VMS … ), compatability was not a given  Mainframes and supercomputers were still necessary for computationally intensive applications.

© Janice Regan, CMPT 300, May The next generation(1980- now)  Use LSI (large scale integrated circuits) to build microcomputers  Reduced price (thousands not 100’s of thousands)  First used early operating systems like CP/M (control program for microcomputers) or DOS (disk operating system)  First uses of user friendly GUIs  Have now evolved to Windows, Linux, MAC/OS  Single user multitasking operating systems

Commonly used OSs  Versions of commonly used OSs like windows, Unix, Linux are available for different types of platforms (PCs, Handhelds, Embedded systems)  Specialized OSs for purposes such as real time programming and optimizing servers © Janice Regan, CMPT 300, May

8 CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 3 Processes

© Janice Regan, CMPT 300, May What is a process?  A program in execution  An instance of a program running on a computer  An entity that can be assigned to and executed on a computer

© Janice Regan, CMPT 300, May What is a process?  A process (active entity) is a program (static entity) in execution, and includes  An address space, an area in memory (memory location x to y) containing List of instructions Any required data The stack for the program  Registers  Other information (includes resources used)

Building the image: C  Write code for your application (1 or more files)  Use a preprocessor to add critical components to your code  Prototypes of functions in libraries  Control for conditional compilation  Use a compiler to translate your preprocessed code to machine language creating an object file for each code file you compiled  Use the linker to combine your object files and the object files for libraries used by your code and create an executable file © Janice Regan, CMPT 300, May

The executable file  You executable file will contain  A list of instructions in machine language  Reserved space for your local variables  Your executable file will be stored on disk  Any time you wish to execute your program you will  instruct the OS to add the program (the job) to its long term queue waiting to be placed in memory and run (by clicking on the executable or entering a command line instruction)  Your job will be loaded into memory by the OS and will begin to run when the OS allows it to. When your job (your program) is loaded and starts to run it becomes a process © Janice Regan, CMPT 300, May

© Janice Regan, CMPT 300, May Operating system  The operating system is not one process  It creates and manages and terminates processes for users  It may create processes to control and share resources within the computer (printers …), manage those processes and even terminate those processes  It handles system calls from user processes  Remember only one process can execute in the CPU at any one time  That process may be a user program or one of the OS controlled processes

© Janice Regan, CMPT 300, May The operating system  Topics that are important to understand advances in operating systems include  Memory management  File system management  Scheduling, resource management  Providing user interfaces to access “kernel” functions (such as input and output)  Advances in hardware (structure of system)  Security and protection of information

© Janice Regan, CMPT 300, May Processes  Processes are restricted to their own areas of assigned memory  Processes may run in “privileged” or “kernel” mode. These processes have full direct access to all resources and instructions in the system.  Usually reserved for the OS and processes owned by the OS  Processes may run in “user” or “protected” mode. Such processes have access to a limited set of instructions. The limitations generally relate to direct access to hardware of the system critical management functions.  Usually the only mode available to user processes

© Janice Regan, CMPT 300, May Process context  The context of a process must be preserved, It includes  The values of the registers  Any other information necessary to restore the process after it has been saved.  Saving or restoring the context of a process is called context switching  One context switch is required to save the currently running program. The scheduler runs to determine the next process to run. Then another context switch occurs to restore the context of the next program

Process management  The OS keeps track of all processes. Usually a process descriptor block is used to record all properties of a particular process. A process table is used to manage the process descriptor blocks.  A process can run in “user” or “kernel” mode.  What happens if a “user” mode process wants to do output (use a “kernel” mode instruction to access the hardware) ? © Janice Regan, CMPT 300, May

System Calls  Encapsulates commonly used functions of the OS so they are easily available to “user” processes written in various languages  System calls are accessed  Using system function calls (C read() …)  Using command line instructions or GUI tools (mkdir …) © Janice Regan, CMPT 300, May

© Janice Regan, CMPT 300, May How system calls work (UNIX)  System calls run partially in system mode  A system call is made by a “user” process, when the system subroutine starts executing the process is still in “user” mode  Within the system call instructions execute a context switch from “user” mode controlled by the “user” process to “kernel” mode controlled by the OS The OS executes the required “kernel” mode operations Instructions execute another context switch back to the “user” mode before the system call returns to the “user” process

© Janice Regan, CMPT 300, May System Calls: An example  To read or print a system call will be made  The system call will  Switch context to “kernel” mode  set up the operation, start the hardware  pass the CPU to a program to execute until the I/0 operation is complete (in system mode).  The hardware will send an interrupt when it is done. The interrupt will pass the CPU back to the system call  The system call will do any clean up or additional work needed to complete the I/O operation then switch context to “user” mode and pass control back to the users program

Services provided by system calls  Creating and managing processes  File management (Input and Output)  Directory/File management  Using timers and other system hardware  Be sure to read the excellent summary in your text (chapter 1.6) © Janice Regan, CMPT 300, May

© Janice Regan, CMPT 300, May Virtual memory/Memory management  Another innovation in more modern OSs  Similar process to that used by cache  Pages of memory are moved between the disks and the memory to effectively extend the amount of available memory.  Processes use pages of memory (more later), first we need to understand processes

OS architectures  An OS can be built based on one or more of the following architectures (Read chapter 1.7)  Monolithic  Layered  Microkernel  Client Server  Virtual machine  Exokernel © Janice Regan, CMPT 300, May

Monolithic  Entire OS runs as a single program in kernel mode  Many procedures for different purposes  Complex: any procedure can call any other  Some structure: system calls all execute the same way  Structure of OS  Main program to invoke other processes  A set of service procedures to execute system calls  A set of utility procedures to support the service procedures © Janice Regan, CMPT 300, May

Layered  Generalize the layers observed in the monolithic structure  Further separate the functions of the OS  Make a layer for each of the groups of functions  Note that only adjacent layers should communicate directly © Janice Regan, CMPT 300, May

Microkernel  In a monolithic system errors can make the system fail (e.g. an error in a driver added to the system)  Split the OS into smaller modules.  One module runs in “kernel” mode and manages the whole OS  Other modules run in user mode each as a separate process (an error in a driver only breaks the module for that driver not the whole OS) © Janice Regan, CMPT 300, May

Example Microkernel (MINIX) © Janice Regan, CMPT 300, May MICROKERNEL Interrupts, communication between processes, scheduling, timers, DEVICE DRIVERS (1 module each type of driver) SERVICES (file server, process manager, …) User tools and processes (shell …)

Virtual machines  Started as a way to allow interactive use of batch processing machines  Now can have many “hosts” that appear to be individual machines all running on the same server. The virtual machines can even run different operating systems © Janice Regan, CMPT 300, May