Operating System Concepts Part II Department of Computer Science Southern Illinois University Edwardsville Spring, 2009 Dr. Hiroshi Fujinoki

Slides:



Advertisements
Similar presentations
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Advertisements

Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
UNIX System Administration OS Kernal Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept Kernel or MicroKernel Concept: An OS architecture-design.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
CS 1308 Computer Literacy and the Internet. Introduction  Von Neumann computer  “Naked machine”  Hardware without any helpful user-oriented features.
Section 3.1: Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random.
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
Chapter 1 Introduction 1.1 What is an operating system
April 2000Dr Milan Simic1 Network Operating Systems Windows NT.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
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  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki IPC1.PPT/001 Inter-Process.
Processes Introduction to Operating Systems: Module 3.
Lecture 8: 9/19/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
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.
Chapter 1 (PART 1) Introduction to OS (concept, evolution, some keywords) Department of Computer Science Southern Illinois University Edwardsville Summer,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Overview of Operating Systems Introduction to Operating Systems: Module 0.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Chapter 1 (PART 2) Operating System Concepts Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki.
Welcome to CS314 Operating Systems A Quick Tour for Introduction to OS Department of Computer Science Southern Illinois University Edwardsville Spring,
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
File System Department of Computer Science Southern Illinois University Edwardsville Spring, 2016 Dr. Hiroshi Fujinoki CS 314.
OS Boot Sequence and File System (implication to “Boot Sector Viruses”) Department of Computer Science Southern Illinois University Edwardsville Spring,
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
Process Management Process Concept Why only the global variables?
Operating Systems: A Modern Perspective, Chapter 6
Operating System Structure
CS 286 Computer Organization and Architecture
Chapter 2: System Structures
Chapter 1 Introduction to Operating System Part 5
Lecture Topics: 11/1 General Operating System Concepts Processes
Introduction to Operating Systems
Operating Systems Lecture 3.
Operating System Introduction.
CS149D Elements of Computer Science
Introduction to OS (concept, evolution, some keywords)
System calls….. C-program->POSIX call
Chapter 2 Operating System Overview
Welcome to CS314 Operating Systems A Quick Tour for Introduction to OS
Introduction to OS (concept, evolution, some keywords)
Department of Computer Science
Department of Computer Science
Welcome to CS314 Operating Systems A Quick Tour for Introduction to OS
OS Boot Sequence and File System
Department of Computer Science
Operating System Concepts
Operating System Concepts
OS Boot Sequence and File System
Light-Weight Process (Threads)
Presentation transcript:

Operating System Concepts Part II Department of Computer Science Southern Illinois University Edwardsville Spring, 2009 Dr. Hiroshi Fujinoki CS 514 Operating Systems Intro_II/001

Operating System Concepts This PPT presentation covers Section 1.5 of the textbook. (1) Process (2) Deadlock avoidance in I/O resource management (3) Files and file descriptor (4) Special Files CS 514 Operating Systems Intro_II/002

Subjects covered about “process” What is “process”? How is it different from “program”? What we can do by “processes”? A: “Process” is a program in execution. HDD “program” is an executable file stored in a disk program Stored as a file Q: What is “process”? Solutions CS 514 Operating Systems Intro_II/003

Then how a “program” can become “process”? HDD program Stored as a file Memory CPU A program becomes a process when one is loaded into the memory for execution by CPU Load CS 514 Operating Systems Intro_II/004

Things needed for a program to be executed in memory Memory HDD  Program Code  Stack Memory  Heap Memory Address Space Program X Program Z CPU PCB-Z PCB-A PCB-X PCB = Process Control Block PCB is a data structure for the CPU to keep track of each process Process Program CS 514 Operating Systems Intro_II/005

Example of “program” and “process” Program Process Static object, usually exists as an executable file Program in execution This is a program This is a process (program in execution) CS 514 Operating Systems Intro_II/006

Intermediate summary of “process” It is a program in execution A process consists of the contents in process address space and PCB Process address space consists of:  Program Code  Stack Memory Space  Heap Memory Space Collection of assembly instructions CPU runs Stack data structure for sub-routine calls Other data structure (local/global variables) Questions  Where are PCBs located?  What information does PCB hold? CS 514 Operating Systems Intro_II/007

Things needed for a program to be executed in memory Memory Program XProgram Z CPU PCB-Z PCB-A PCB-X Program Y OS  Where are PCBs located? In the operating system CS 514 Operating Systems Intro_II/008

Deadlock Deadlock avoidance in I/O resource management What is “deadlock”? More than one process wait for resource for each other for forever Example Resources Printer HDD Assume that there are two processes Each of the two processes requires printer and HDD at the same time Without the printer and HDD, neither can finish its tasks Process A Process B Assigned wait (Circular-wait) CS 514 Operating Systems Intro_II/009

Concept of files and file descriptor Logical data storages in computer systems What is a file? What is “file descriptor”? Logical identification for each file being used in a computer system. HDD file OS user  open  read  load  use  close CS 514 Operating Systems Intro_II/010

Concept of files and file descriptor (continued) ABXY File Names “A.txt” User HDD OS Location on disk Sectors Track Platters Open “A.txt” Find/Access Load File Descriptor Read (FD) Write (FD) Append (FD) File NamesSector Locations File Allocation Table A.txt 1E  23  CD  CS 514 Operating Systems Intro_II/011

Concept of Special Files Ordinary File user OS HDD file Can not be seen by human user user OS HDD Special Files Keyboard printer Users can I/O to many devices as if they were a file Modem Internet Request Request (1) Response (4) Internet Request Network Special Files CS 514 Operating Systems Intro_II/012

Special Files A concept in OS where a user can handle many I/O devices using the same interface (APIs) that is used for actual files. When you open (reserve) a resource, OS gives you “descriptor” Some special files are read-only and some others may be write-only Read-OnlyRead/Write Write-Only - Disks - Keyboard - Printer - Network - Mouse - CRT Monitor (with touch-pen support) - CD-ROM - CRT Monitor CS 514 Operating Systems Intro_II/013

Operating System Structure  Monolithic Structure  Layered Structure  VM (Virtual Machine)  Micro-Kernel Windows uses these concepts This PPT presentation covers Section 1.7 of the textbook. CS 514 Operating Systems Intro_II/014

Monolithic Structure OS Operating systems are essentially a collection of procedures. Monolithic Structure OS No structure in a collection of procedures (Any procedure or a user application can call any other procedure) OS Procedures Disk I/O Process Mgmt.Memory Mgmt.Printer Spooler IPC KB I/O user Program Big mess But fast (no overhead) CS 514 Operating Systems Intro_II/015

How is a Monolithic-Structured OS implemented? OS Procedures Disk I/O Process Mgmt. Memory Mgmt. Printer Spooler IPC KB I/O Disk I/O Memory Mgmt. Process Mgmt. IPC KB I/O Printer Spooler Source code modules Concatenate into one source code file Compile OS Operating system as an executable program CS 514 Operating Systems Intro_II/016

“OS” in a broader definition How is a Monolithic-Structured OS implemented? OS Operating system as an executable program awk grep sort Disk I/O Memory Mgmt. Process Mgmt. IPC KB I/O Printer Spooler Program System calls External Commands user execute exec (); “OS Kernel” CS 514 Operating Systems Intro_II/017

Layered Structure Operating Systems “Layers”Layers of priorities User Programs I/O Management Process Communication Memory Management Process Management CS 514 Operating Systems Intro_II/018

Virtual Machine (VM) Without VM HardwareOperating System App1App N    user OS 1 Virtual Machine SupportOS 2 OS 3    A virtual machine UNIX Windows 2000 Application programs Hardware With VM MS-DOS Extra layer on top of hardware CS 514 Operating Systems Intro_II/019

Hardware OS 1 Virtual Machine Support OS 2 OS 3    Hardware 1 OS 2 OS 3    OS 1    Hardware 2 Hardware 3 Concept of VM For each application program, it looks like they are being executed by the dedicated hardware CS 514 Operating Systems Intro_II/020

Without VM Memory Process X Process Y Process Z OS With VM Memory OS 1 OS 3 OS 2 Process X Process Y VMS VM 1 VM 2 VM 3 Process Manage Process Manage Process M Process N Process Manage Process A Process B Process Manage VM Manage Implementation of of VM CS 514 Operating Systems Intro_II/021

Win32 Virtual Machine Support MS-DOS Hardware Windows-9x VM All Win-32 applications are execute in Win-32 kernel Each MS-DOS application will be executed within its VM MS-DOS VM CS 514 Operating Systems Intro_II/022

Summary of Virtual Machine (VM) VM A virtual computer where computer hardware is software-emulated by VMS (Virtual Machine Support) Provide virtual dedicated machine (= hardware) to each OS Multiple operating systems (and its applications) at once (Q: What’s the difference from “multiple boot”?) - For flexibility - For robustness One VM crashes, others still survive (EG: Windows-NT) CS 514 Operating Systems Intro_II/023

“OS” in a broader definition OS awk grep sort Disk I/O Memory Mgmt. Process Mgmt. IPC KB I/O Printer Spooler External Commands “OS Kernel” Micro-Kernel Architecture CS 514 Operating Systems Intro_II/024

“OS” in a broader definition awk grep sort Disk I/O IPC KB I/O Memory Mgmt. Process Mgmt. Printer Spooler External Commands OS “OS Kernel” Micro-Kernel Architecture (continued) Memory Mgmt. Process Mgmt. Printer Spooler CS 514 Operating Systems Intro_II/025

Micro-Kernel Architecture (continued) Computer Hardware Operating System User Program User-Mode Kernel-Mode In ordinary OS (not Micro-Kernel OS), OS has to provide all the user services in Kernel-mode services OS kernel tends to be huge System Call OS Procedure (in the OS kernel) CS 514 Operating Systems Intro_II/026

Micro-Kernel Architecture (continued) Computer HardwareOperating System User Program User-Mode Kernel-Mode Spooler Micro-Kernel Architecture is based on Client-Server Model ClientServer Micro-kernel Architecture Make the OS kernel as small as possible Operating System becomes a service broker CS 514 Operating Systems Intro_II/027

Micro-Kernel Architecture (continued) What is it good for? MS Windows uses micro-kernel architecture for this reason (1) Each OS function becomes a module A bug in OS can be fixed by replacing a module (what we should do if “monolithic structure kernel”?) (2) Better robustness OS functions may be executed in user-mode (a bug in a module will not crash the kernel) CS 514 Operating Systems Intro_II/028