Operating System Concepts

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.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
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.
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.
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.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
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.
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.
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,
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.
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.
Chapter 1 (PART 1) Introduction to OS (concept, evolution, some keywords) Department of Computer Science Southern Illinois University Edwardsville Summer,
Operating System Concepts Part II Department of Computer Science Southern Illinois University Edwardsville Spring, 2009 Dr. Hiroshi Fujinoki
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.
Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Introduction to Operating Systems Concepts
Computer System Structures
Kernel Design & Implementation
Operating System Structure
Chapter 2: Operating-System Structures
Chapter 12: File System Implementation
Avani R.Vasant V.V.P. Engineering College
Operating Systems: A Modern Perspective, Chapter 6
CS 286 Computer Organization and Architecture
CS703 - Advanced Operating Systems
OS Virtualization.
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
Threads Chapter 4.
Introduction to Operating Systems
Operating Systems Lecture 3.
Operating Systems: A Modern Perspective, Chapter 3
Operating System Introduction.
CS 286 Computer Organization and Architecture
Introduction to OS (concept, evolution, some keywords)
System calls….. C-program->POSIX call
Chapter 2 Operating System Overview
Operating Systems Structure
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
Threads: Light-Weight Processes
Operating System Concepts
OS Boot Sequence and File System
Light-Weight Process (Threads)
Presentation transcript:

Operating System Concepts CS 314 Operating Systems Chapter 1 (PART 2) Operating System Concepts Department of Computer Science Southern Illinois University Edwardsville Spring, 2019 Dr. Hiroshi Fujinoki E-mail: hfujino@siue.edu Chapter_One_2/001

CS 314 Operating Systems 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 Chapter_One/002

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

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

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

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

CS 314 Operating Systems 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 Collection of assembly instructions CPU runs  Stack Memory Space Stack data structure for sub-routine calls  Heap Memory Space Other data structure (local/global variables) Questions  Where are PCBs located?  What information does PCB hold? Chapter_One/007

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

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

CS 314 Operating Systems 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) user Program OS Procedures Big mess Memory Mgmt. But fast (no overhead) Disk I/O Printer Spooler Process Mgmt. IPC KB I/O Chapter_One/010

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

CS 314 Operating Systems Ever-increasing minimum memory footprint Chapter_One/009

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

CS 314 Operating Systems Virtual Machine (VM) Without VM App1 App N user Without VM App1 App N    Operating System Hardware Hardware With VM Application programs A virtual machine          Extra layer on top of hardware OS1 OS2 OS3 UNIX MS-DOS Windows 2000 Virtual Machine Support Chapter_One/013

CS 314 Operating Systems Concept of VM Hardware OS1 Virtual Machine Support OS2 OS3    For each application program, it looks like they are being executed by the dedicated hardware Hardware1 OS2 OS3    OS1 Hardware2 Hardware3 Chapter_One/014

CS 314 Operating Systems Implementation of of VM With VM Without VM Memory VM1 Without VM Process X Process Y Process Manage Memory OS1 OS3 OS2 Process X Process Y Process Z VM Manage Process Manage VM2 Process M Process N Process Manage VM3 Process A Process B Process Manage OS VMS Chapter_One/015

CS 314 Operating Systems 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 - For flexibility - For robustness Multiple operating systems (and its applications) at once (Q: What’s the difference from “multiple boot”?) One VM crashes, others still survive (EG: Windows-NT) Chapter_One/016

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

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

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

CS 314 Operating Systems Micro-Kernel Architecture (continued) Make the OS kernel as small as possible Client Server User-Mode User Program Spooler Operating System Kernel-Mode Computer Hardware Micro-Kernel Architecture is based on Client-Server Model Operating System becomes a service broker Chapter_One/020

CS 314 Operating Systems Micro-Kernel Architecture (continued) What is it good for? (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”?) MS Windows uses micro-kernel architecture for this reason (2) Better robustness OS functions may be executed in user-mode (a bug in a module will not crash the kernel) Chapter_One/021

CS 314 Operating Systems Deadlock avoidance in I/O resource management What is “deadlock”? More than one process wait for resource for each other for forever Example 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 Resources Printer HDD Process A Process B Deadlock wait Assigned (Circular-wait) Assigned wait Chapter_One/022

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

CS 314 Operating Systems Concept of files and file descriptor (continued) User HDD OS Open “A.txt” A Load Y Find/Access B File Names Sector Locations File Allocation Table X File Descriptor File Names “A.txt” Location on disk Sectors Track Platters A.txt 1E23CD Read (FD) Write (FD) Append (FD) Chapter_One/024

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

CS 314 Operating Systems Concept of Special Files Can not be seen by human user HDD fd = open (my_text, READ_WRITE); write (fd, out_buffer); read (fd, in_buffer); close (fd); file OS user Keyboard (KB) fd = open (LPT, WRITE); write (fd, out_buffer); close (fd); file Printer (LPT) fd = open (KB, READ); read (fd, in_buffer); close (fd); Chapter_One/026

CS 314 Operating Systems Special Files A concept in OS where a user can handle many different 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-Only Read/Write Write-Only - Disks - Keyboard - Printer - Network - Mouse - CRT Monitor - CD-ROM CRT Monitor (with touch-pen support) Chapter_One/027