1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
© 2004, D. J. Foreman 1 O/S Organization. © 2004, D. J. Foreman 2 Topics  Basic functions of an OS ■ Dev mgmt ■ Process & resource mgmt ■ Memory mgmt.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Operating System Design. Today’s Lectures I/O subsystem and device drivers Interrupts and traps Protection, system calls and operating mode OS structure.
Introduction to Operating Systems What is an operating system? Examples How do many programs run at the same time, with one processor?
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Figure 1.1 Interaction between applications and the operating system.
OS Spring’04 Introduction Operating Systems Spring 2004.
Operating System Organization
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
hardware and operating systems basics.
Protection and the Kernel: Mode, Space, and Context.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
 Create an abstract machine environment  A nicer environment than bare hardware  Consists of multiple, autonomous abstract components  Components.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
What is an Operating System? The OS is a program – Permit easy access, control hardware, communicate between user and software, user and hardware, software.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
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.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Processes Introduction to Operating Systems: Module 3.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
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.
UNIX Unit 1- Architecture of Unix - By Pratima.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Exceptional Control Flow
Kernel Design & Implementation
Operating System Structure
An Introduction to Operating Systems
Chapter Objectives In this chapter, you will learn:
KERNEL ARCHITECTURE.
OS Organization.
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Operating Systems: A Modern Perspective, Chapter 3
CSE 451: Operating Systems Winter 2007 Module 2 Architectural Support for Operating Systems Brian Bershad 562 Allen Center 1.
OS Organization.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Outline Operating System Organization Operating System Examples
System Calls System calls are the user API to the OS
Review Hardware Support for OS What happens on
Operating Systems Structure
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

1 OS Structure, Processes & Process Management

2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider  File system, device handler, … Questions:  How can the OS perform these functions?  How is an OS invoked?  What is the structure of the OS?

3 An Operating System in Action CPU loads boot program from ROM (e.g. BIOS in PC’s) Boot program:  Examines/checks machine configuration (number of CPU’s, how much memory, number & type of hardware devices, etc.)  Builds a configuration structure describing the hardware  Loads the operating system, and gives it the configuration structure Operating system initialization:  Initialize kernel data structures  Initialize the state of all hardware devices  Creates a number of processes to start operation (e.g. getty in UNIX, the Windowing system in NT, e.g.)

4 O.S. in Action (Cont’d) After basic processes have started, the OS runs user programs, if available, otherwise enters the idle loop In the idle loop:  OS executes an infinite loop (UNIX)  OS performs some system management & profiling  OS halts the processor and enter in low-power mode (notebooks) OS wakes up on:  Interrupts from hardware devices  Exceptions from user programs  System calls from user programs Two modes of execution  User mode: Restricted execution mode (applications)  Supervisor mode: Unrestricted access to everything (OS)

5 Control Flow in an OS Operating System Modules Idle Loop From boot Initialization RTI Interrupt System call main() Exception Supervisor Mode Return to user mode Return to user mode

6 On Interrupts Hardware calls the operating system at a pre-specified location Operating system saves state of the user program Operating system identifies the device and cause of interrupt Responds to the interrupt Operating system restores state of the user program (if applicable) or some other user program Execute an RTI instruction to return to the user program User program continues exactly at the same point it was interrupted. Key Fact: None of this is visible to the user program

7 On Exceptions Hardware calls the operating system at a pre-specified location Operating system identifies the cause of the exception (e.g. divide by 0) If user program has exception handling specified, then OS adjust the user program state so that it calls its handler Execute an RTI instruction to return to the user program If user program did not have a specified handler, then OS kills it and runs some other user program, as available Key Fact: Effects of exceptions are visible to user programs and cause abnormal execution flow

8 On System Calls User program executes a trap instruction (system call) Hardware calls the operating system at a pre-specified location Operating system identifies the required service and parameters (e.g. open(filename, O_RDONLY)) Operating system executes the required service Operating system sets a register to contain the result of call Execute an RTI instruction to return to the user program User program receives the result and continues Key Fact: To the user program, it appears as a function call executed under program control

9 Operating System (process/device/memory management, file systems, interprocess communication, …) Operating System Today High-level software architecture Memory Instruction Execution & Interrupt Processing User Applications Window System Command Interpreter I/O Devices “Middleware”

10 Operating System Structures Monolithic OS (e.g., Unix)Micro-kernel OS (e.g., Mach, Exokernel, …) Memory Management CPU Scheduling Process Management Hardware Network Support Security File System Command Interpreter Device Management Network Support Network Support Memory Mgmt. Memory Mgmt. Window Server Window Server File Server File Server... Hardware CPU Scheduling CPU Scheduling Device Drivers Device Drivers Interrupt Handler Interrupt Handler Boot and Init. Boot and Init. Message Passing … … API

11 Summary An OS is just a program:  It has a main() function, which gets called only once (during boot)  Like any program, it consumes resources (such as memory), can do silly things (like generating an exception), etc. But it is a very strange program:  It is “entered” from different locations in response to external events  It does not have a single thread of control, it can be invoked simultaneously by two different events (e.g. system call & an interrupt)  It is not supposed to terminate  It can execute any instruction in the machine