Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.

Slides:



Advertisements
Similar presentations
Interactive lesson about operating system
Advertisements

CSC 360- Instructor: K. Wu Overview of Operating Systems.
Processes Management.
Operating System Structures
Chapter 2 Operating System Overview Operating Systems: Internals and Design Principles, 6/E William Stallings.
Operating System Structure
CS 345 Computer System Overview
Lecture 1: History of Operating System
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
OS Spring’03 Introduction Operating Systems Spring 2003.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Chapter 11 Operating Systems
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Common System Components
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
A. Frank - P. Weisberg Operating Systems Evolution of Operating Systems.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
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.
Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
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 A program that controls the execution of application programs An interface between applications and hardware 1.
Operating Systems Lecture 3 Computer Systems Review
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
SYSTEM SOFTWARE Prepared by: Mrs. Careene McCallum-Rodney.
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.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Operating Systems CSCI 411.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
BIT213,CISY Operating Systems 1
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
1 Operating System Overview Chapter 2. 2 Operating System A program that controls the execution of application programs An interface between applications.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
Introduction to Operating System. 1.1 What is Operating System? An operating system is a program that manages the computer hardware. It also provides.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
System Components Operating System Services System Calls.
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.
Module 3: Operating-System Structures
Operating System Overview
Evolution of Operating Systems
Chapter 1: Introduction
Operating System Structure
Chapter 1: Introduction
Chapter 3: Operating-System Structures
Computer-System Architecture
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Module 2: Computer-System Structures
Operating Systems Structure
Presentation transcript:

Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2

Outline u I/O review  Direct Memory Access u Operating System as a Computer Interface u Operating System as a Resource Manager u Evolution of Operating Systems u Layout of an Operating System u Operating System Components u Case studies  Unix  Windows

Methods of I/O u Polling  Calling program repeatedly asks: “Are you done yet?” u Interrupt driven  Device alerts CPU: “I’m done!” u Direct memory access (DMA)  CPU tells DMA: “You handle this.”

Burst DMA u CPU issues DMA request  separate DMA module  DMA part of I/O module u DMA module transfers a block of data directly to memory  Data is moved one word at a time  The CPU executes no-ops while data is transferred u An interrupt is sent when the task is complete u The CPU is only involved at the start and end of the transfer CPUDMA Block request. Move 1 word. Move 1 word. Raise interrupt. IH calls ISR. ISR resumes program. Continue.

DMA with cycle stealing u CPU makes DMA request u With each subsequent instruction  The DMA module uses memory cycles which the instruction does not use. u When data transfer is complete DMA module raises an interrupt CPUDMA Block request. Move 1 word. Use bus. Move 1 word. Use bus. Raise interrupt. IH calls ISR. ISR resumes program. Continue.

OS as a Computer Interface u Applications: The only visible component to the user u Libraries provide the programming interface to services provided by the OS. u The Operating System hides the details of the hardware. It provides services that allow applications to:  create and run other programs  access I/O devices and files  communicate with other programs  request resources such as memory  controlled access to shared resources such as memory, files, I/O devices Libraries Application Operating System Hardware User

Libraries Application Operating System Hardware User Libraries u OS services provided through a set of system calls, which are protected procedures and are accessed through a TRAP instruction u TRAP instructions are architecture dependent. A system call requires:  Placing parameters in specific places, such as the stack or CPU registers  Issuing a trap instruction u Libraries hide the details of the TRAP instruction  They make system calls look like ordinary function calls System call using TRAP instruction

OS as a Resource Manager u Users usually run several applications concurrently u The OS is in charge of assigning, protecting and controlling system resources among concurrent applications u Different resources are shared in different ways  CPU, disk and network resources are shared by having applications take short turns at using the resources  Memory is shared by splitting the memory space among multiple applications  Printers can only be used by a single application until it has finished using it

Evolution of an Operating System u Must adapt to hardware upgrades and new types of hardware. Examples:  Character vs. graphic terminals  Introduction of paging hardware u Must offer new services  distributed system support  multimedia support u The need to change the OS on a regular basis imposes requirements on its design  modular construction with clean interfaces  object oriented methodology

Simple Batch Systems u The first operating systems (mid-50s) u The user submits a job (written on card or tape) to a computer operator u The computer operator places a batch of several jobs on an input device u A special program, the monitor, manages the execution of each program in the batch  always in main memory and available for execution u Monitor utilities are loaded when needed

Multiprogrammed Batch Systems u I/O operations are exceedingly slow (compared to instruction execution) u A program containing even a very small number of I/O ops, will spend most of its time waiting for them u Hence: poor CPU usage when only one program is present in memory

Multiprogrammed Batch Systems u If memory can hold several programs, then CPU can switch to another one whenever a program is awaiting for an I/O to complete u This is multiprogramming

Time Sharing Systems u Batch multiprogramming does not support interaction with users u TSS extends multiprogramming to handle multiple interactive jobs u Processor’s time is shared among multiple users u Multiple users simultaneously access the system The file system must be protected  multiple users  multiple processes (tasks) per user

Time Sharing Systems (TSS) u Because of slow human reaction time, a typical user needs 2 seconds (or less) of processing time per minute u Hence approximately 30 users should be able to share the same system without noticeable delay in the computer reaction time

Layout of an Operating System u The OS (or part of it) runs within the currently executing process u The part of the OS called the kernel is mapped into each process' memory u There is only one instance of the kernel in memory Application 1 OS App1 code Shared Libraries App1 Stack App1 data Not used Application 2 OS App2 code Shared Libraries App2 Stack App2 data Not used OS App1 data App2 Stack App1 code Not used App1 Stack Shared Libraries App2 code App2 data Not used Main Memory

Virtual Memory u Virtual memory a main topic in OS and will be covered in detail later in the course. u Each process has its own view of the memory called its address space Application 1 OS App1 code Shared Libraries App1 Stack App1 data Not used Application 2 OS App2 code Shared Libraries App2 Stack App2 data Not used OS App1 data App2 Stack App1 code Not used App1 Stack Shared Libraries App2 code App2 data Not used Main Memory

Virtual Memory u The components of each application’s address space are mapped somewhere in physical memory u Each address in a program’s address space is mapped into a physical address, they need not be the same. u Each program thinks it has the entire memory to itself Application 1 OS App1 code Shared Libraries App1 Stack App1 data Not used Application 2 OS App2 code Shared Libraries App2 Stack App2 data Not used OS App1 data App2 Stack App1 code Not used App1 Stack Shared Libraries App2 code App2 data Not used Main Memory

Operating System Components u Process management u Memory management u Secondary-storage management u I/O system management u File management u Protection/Security system u Networking u User interface

Process Management u A process is a program in execution. It needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its tasks. u The operating system is responsible for:  process creation and deletion  process suspension and resumption  process synchronization  process communication

Main-Memory Management u A single memory space is allocated to (possibly) many processes u The management of memory should be transparent to the processes u The operating system is responsible for:  Allocating, de-allocating memory  Decide which processes to load when memory space becomes available  Allocate and de-allocate memory space as needed

Secondary-Storage Management u Disk devices, used to store data between sessions, have their capacity divided into blocks  Each file on the disk is made of 1 or more blocks  The used portion of the disk is also divided into blocks u Free space management u Storage allocation

File Management u File creation and deletion u Directory creation and deletion u Support of primitives for manipulating files and directories u Mapping files onto secondary storage u File backup on nonvolatile storage media

Protection System u Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. u The protection mechanism must:  distinguish between authorized and unauthorized usage by recognized system entities  This is not the same as security, which is the policy for access to system resources  specify the controls to be imposed  provide a means of enforcement

How protection breaks down u User process directly accessing another user process' storage u User process taking over part of the OS and using this to overwrite other processes or even modify the OS itself  MS-DOS allowed this u Prevent the OS up from accessing the CPU with an infinite loop

Basic protection mechanisms: hardware u Two CPU modes  user mode (your code runs here)  supervisor mode (the kernel runs here) u Privileged instructions  only executable is supervisor mode  trap to OS generated if execution attempted in user mode u Memory protection  addresses are transformed by memory mapping  It is impossible to access another processes memory space without OS intervention

Basic protection mechanisms: software u Authentication  From passwords to retina scans, the system should provide a method of identifying users u File (or other resource) attributes  Provide a means to specify which users have access, and what type of access is granted u Encryption  Used to protect data from unauthorized access during transit through non-secured domains