Module 1: Introduction. Operating System Concepts. Terminology. What is an Operating System? Where are OSs found? Distributed Real-Time Systems

Similar documents
Chapter 1: Introduction. What is an Operating System?

Types Of Operating Systems

Contents. Chapter 1. Introduction

Overview and History of Operating Systems

3 - Introduction to Operating Systems

Components of a Computing System. What is an Operating System? Resources. Abstract Resources. Goals of an OS. System Software

Operating Systems 4 th Class

Introduction. System Calls

Chapter 2: OS Overview

Operating System Tutorial

How To Understand And Understand An Operating System In C Programming

How To Understand The Principles Of Operating Systems

Overview of Operating Systems Instructor: Dr. Tongping Liu

Chapter 3. Operating Systems

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Operating system Dr. Shroouq J.

Operating Systems Introduction

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

CHAPTER 15: Operating Systems: An Overview

Operating Systems Prof. Ashok K Agrawala

This tutorial will take you through step by step approach while learning Operating System concepts.

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Computers: Tools for an Information Age

OPERATING SYSTEM OVERVIEW

Operating Systems. Rafael Ramirez (T, S)

How To Understand The History Of An Operating System

Virtual machine interface. Operating system. Physical machine interface

Operating Systems Overview

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

1 Organization of Operating Systems

Components of a Computer System

CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

Client/Server Computing Distributed Processing, Client/Server, and Clusters

Computer-System Architecture

Operating Systems: Basic Concepts and History

Principles of Operating Systems CS 446/646

Computer Science 4302 Operating Systems. Student Learning Outcomes

Introduction. What is an Operating System?

Chapter 1 Computer System Overview

Chapter 5: System Software: Operating Systems and Utility Programs

Operating Systems. III. Scheduling.

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

EECS 678: Introduction to Operating Systems

Operating System Structures

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

CPU Scheduling. Core Definitions

Star System Deitel & Associates, Inc. All rights reserved.

Chap-02, Hardware and Software. Hardware Model

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 1 FUNDAMENTALS OF OPERATING SYSTEM

Tools Page 1 of 13 ON PROGRAM TRANSLATION. A priori, we have two translation mechanisms available:

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Chapter 3: Operating-System Structures. Common System Components

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

Operating Systems OS Architecture Models

Operating Systems PART -A

Operating Systems for Parallel Processing Assistent Lecturer Alecu Felician Economic Informatics Department Academy of Economic Studies Bucharest

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

OPERATING SYSTEM INDEX

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

Chapter 5 Process Scheduling

Networking Operating Systems (CO32010)

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Operating System Components

ICS Principles of Operating Systems

Outline: Operating Systems

CS550. Distributed Operating Systems (Advanced Operating Systems) Instructor: Xian-He Sun

Lecture 1 Operating System Overview

evm Virtualization Platform for Windows

CPU Scheduling. CPU Scheduling

theguard! ApplicationManager System Windows Data Collector

Software: Systems and Application Software

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Operating System Software

Linux Process Scheduling Policy

Multi-core architectures. Jernej Barbic , Spring 2007 May 3, 2007

Chapter 3 Operating-System Structures

Introduction. General Course Information. Perspectives of the Computer. General Course Information (cont.) Operating Systems 1/12/2005

Processor Scheduling. Queues Recall OS maintains various queues

A Comparative Study of CPU Scheduling Algorithms

Design and Implementation of the Heterogeneous Multikernel Operating System

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

Network operating systems typically are used to run computers that act as servers. They provide the capabilities required for network operation.

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

OPERATING SYSTEM SERVICES

Chapter 2 System Structures

Programming for GCSE Topic H: Operating Systems

Chapter 1: Introduction. Chapter 1: Introduction. Operating System Concepts, 7th Edition. Objectives

Real-Time Operating Systems for MPSoCs

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Functions of NOS Overview of NOS Characteristics Differences Between PC and a NOS Multiuser, Multitasking, and Multiprocessor Systems NOS Server

Transcription:

Operating System Concepts Module 1: INTRODUCTION Andrzej Bednarski, Ph.D. student Department of Computer and Information Science Linköping University, Sweden Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming Batched Systems Time-Sharing Systems Personal-Computer Systems Parallel Systems Distributed Systems Real -Time Systems E-mail: andbe@ida.liu.se URL: http://www.ida.liu.se/~andbe The lecture notes are mainly based on Silberschatz s, Galvin s and Gagne s book ( Operating System Concepts, 6th ed., Addison-Wesley, 2002). No part of the lecture notes may be reproduced in any form, due to the copyrights reserved by Addison-Wesley. These lecture notes should only be used for internal teaching purposes at the Linköping University. TDDB63 Operating System Concepts 1.2 TDDB63 Operating System Concepts A. Bednarski 1.3 Terminology What is an Operating System? Job = program Process = Job kept in memory, i.e. program in execution Job = Process A program that acts as an intermediary between an application (or a user of a computer) and the computer hardware. Operating system goals: Execute user programs and make solving user problems easier. Make the computer system convenient to use. + E.g., consider assembler programming as opposed to modern programming Use the computer hardware in an efficient manner + E.g., consider multiprocessor systems An operating system provides an environment within which other programs can do useful work; the OS does not perform any useful function itself. TDDB63 Operating System Concepts A. Bednarski 1.4 TDDB63 Operating System Concepts A. Bednarski 1.5 Distributed Real-Time Systems Where are OSs found? General purpose systems Embedded systems Microprocessor market shares in 1999 99% 1% T Safety critical applications (e.g. Drive-by-Wire): T time constraints, T data and control dependencies. T Communication protocols: Time Triggered Protocol (TTP), Controller Area Network (CAN). TDDB63 Operating System Concepts A. Bednarski 1.9 TDDB63 Operating System Concepts A. Bednarski 1.10 1

Operating Systems Computer System Components General purpose operating systems Windows 95/98/2000/NT/XP Linux Sun Solaris HP-UX MacOS Application specific operating systems, e.g. real-time OSE-Delta VxWorks Chorus RT-Linux, RED-Linux EPOC, RT-Mach etc. 1. Hardware provides basic computing resources (CPU, memory, I/O devices). 2. Operating system controls and coordinates the use of the hardware among the various application programs for the various users. 3. Applications programs define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs). 4. Users (people, machines, other computers). TDDB63 Operating System Concepts A. Bednarski 1.11 TDDB63 Operating System Concepts A. Bednarski 1.12 Abstract View of System Components Different Views on Operating Systems (and their Definition) (i) OS as a User/Computer Interface Program creation Program execution + Load instructions, initialize files Access to I/O devices + Clean interface to filter details for the programmer Controlled access to files + Concept of file (formats etc), protection mechanism System access Error detection and response + Hardware errors, software errors... Accounting TDDB63 Operating System Concepts A. Bednarski 1.13 TDDB63 Operating System Concepts A. Bednarski 1.14 Different Views on Operating Systems (and their Definition) Different Views on Operating Systems (and their Definition) (ii) Resource allocator manages and allocates resources. Processing Elements, CPUs Memory + Volatile vs. non-volatile memory Devices Data resources (iii) Control program controls the execution of user programs and operations of I/O devices. Unusual control mechanism + Control program functions in the same way as ordinary computer software (executed by the CPU) + The OS frequently relinquishes control and must depend on the processor to regain control (iv) Kernel the one program running at all times (all else being application programs, which includes system utilities). TDDB63 Operating System Concepts A. Bednarski 1.15 TDDB63 Operating System Concepts A. Bednarski 1.16 2

OS Objectives and Functions Ease of Evolution of an Operating System Convenience + An OS makes (or at least should) a computer more convenient to use Efficiency + An OS allows the computer system resources to be used in an efficient manner Abilitiy to evolve + An OS should be constructed in such a way as to permit the effective development, testing, and introduction of new system functions without at the same time interfering with service Functionality and features vary from OS to OS + No universal definition + E.g., IBM AIX provided database support Major operating systems will evolve over time for a number of reasons Hardware upgrades (issue of flexibility) + E.g., Faster processors, hardware memory management support, new types of storage media New hardware platforms (issue of portability) New services (issue of extensibility) + E.g., window management system + E.g., multimedia requirements calling for real-time performance Fixes + bug handling TDDB63 Operating System Concepts A. Bednarski 1.17 TDDB63 Operating System Concepts A. Bednarski 1.18 Simple Batch Systems Simple Batch Systems Input devices + Card readers + Tape drives Output devices + Line printers + Tape drives + Card punches Input: Program on cards Output of program: result and/or memory dumps (including registers) No interaction between the user and the job while the job is executing Hire an operator User operator Add a card reader Reduce setup time by batching similar jobs Automatic job sequencing automatically transfers control from one job to another. First rudimentary operating system. OS always resident in main memory Resident monitor + initial control in monitor + control transfers to job + when job completes control transfers back to monitor Memory Layout for a Simple Batch System TDDB63 Operating System Concepts A. Bednarski 1.19 TDDB63 Operating System Concepts A. Bednarski 1.20 Simple Batch Systems cont d Disadvantages Monitor Schedules the jobs Controls the sequence of events -> must always be available -> resident in main-memory Desirable hardware features + Memory protection - user programs should not alter memory containing monitor code - if so, interrupt and transfer control to monitor + Timer - avoid a single job monopolizing the CPU - if timer expires, interrupt and transfer control to monitor + Privileged instructions + Interrupts - flexibility in relinquishing to/ regaining control from user programs Only sequential execution (first-come first-served) No interaction between user and the job while the job is executed. Programs must be debugged off-line (from snapshot dumps). Turnaround time long, i.e., time between job submission and job completion. CPU is often idle (due to the slow mechanical I/O devices) E.g., consider reading 20 cards/sec to >1000 CPU instructions/sec TDDB63 Operating System Concepts A. Bednarski 1.21 TDDB63 Operating System Concepts A. Bednarski 1.22 3

Spooling Utilization Example Spooling = Simultaneous Peripheral Operation On-Line Overlap I/O of one job with computation of another job. While executing one job, the OS: + Reads next job from card reader into a storage area on the disk (job queue). + Outputs printout of previous job from disk to printer. Used for processing data at remote sites (just need notification when processing is complete) A program processes a file of records and performs on average 100 machine instructions per record. Time for reading one record Execute 100 instructions Time for writing one record CPU Utilization = 0.0001 / 0.0031 = 3.2% 0.0015 seconds 0.0001 seconds 0.0015 seconds > 96% is spent on I/O (i.e., the CPU is idle a lot) Job pool data structure that allows the OS to select which job to run next in order to increase CPU utilization. TDDB63 Operating System Concepts A. Bednarski 1.26 TDDB63 Operating System Concepts A. Bednarski 1.27 Uniprogramming Multi-programmed Batch Systems Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them. Process execution time: CPU: 10 + 10 time units I/O: 100 + 100 time units I.e., I/O intensive (200/220 = 90.9%) TDDB63 Operating System Concepts A. Bednarski 1.28 TDDB63 Operating System Concepts A. Bednarski 1.29 Multiprogramming with two programs Multiprogramming with three programs A A (printer) B B (disk) C (network) combined TDDB63 Operating System Concepts A. Bednarski 1.30 TDDB63 Operating System Concepts A. Bednarski 1.31 4

Advantages of Multi-programming OS Features Needed for Multi-Programming Decreased elapsed time + Sequential execution: 660 time units + Multiprogramming: 240 time units Shorter turn-around time + Sequential execution: A: 220 B: 440 C: 660 Avg: 440 + Multiprogramming: A: 220 B: 230 C: 240 Avg: 230 Better average response time + Sequential execution: (0+220+440) / 3 = 220 time units + Multiprogramming (0 + 10 + 20) / 3 = 10 time units Increased throughput Multiprogramming = The ability of having multiple programs organized in order to increase CPU utilization. I/O routine supplied by the OS. Memory management the OS must allocate the memory to several jobs. Job scheduling the OS must choose which jobs that should be loaded into main memory, assuming that not all jobs can fit there. CPU scheduling the OS must choose among several jobs ready to run, that is, jobs that are already in main-memory. Allocation of devices. TDDB63 Operating System Concepts A. Bednarski 1.32 TDDB63 Operating System Concepts A. Bednarski 1.33 Time Sharing Systems Interactive Computing Requirements of Time Sharing and Multi-Programming Time sharing = multi-tasking + An extension to multi-programming. + Frequency of job switching is high, enabling the users to interact with each program while it is running. The CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory). A job is swapped in and out of memory to the disk. On-line communication between the user and the system is provided; when the operating system finishes the execution of one command, it seeks the next control statement not from a card reader, but rather from the user s keyboard. On-line system must be available for users to access data and code. Memory management + E.g, swapping, virtual memory Memory protection On-line file system + E.g., disk management system Job and CPU scheduling (performed by OS) controlling concurrent execution + Job synchronization and process communication TDDB63 Operating System Concepts A. Bednarski 1.34 TDDB63 Operating System Concepts A. Bednarski 1.35 Multi-Programming vs Time Sharing Personal Computer Systems Multi-Programming Time Sharing Personal computers computer system dedicated to a single user. + E.g., Sun, HP, and IBM Workstation, PC, Mac etc. Principal objective Maximize CPU use Minimize response time I/O devices keyboards, mice, display screens, small printers. User convenience and responsiveness. Source of instructions to OS Job control language provided with the job Commands entered at the terminal Can adopt technology developed for larger operating systems Often individuals have sole use of computer and do not need advanced CPU utilization of protection features. (However, consider multi-tasking) TDDB63 Operating System Concepts A. Bednarski 1.36 TDDB63 Operating System Concepts A. Bednarski 1.37 5

Migration of Operating-System Concepts and Features Parallel Systems Multiprocessor systems with more than one CPU in close communication. Tightly coupled system processors share memory and a clock; communication usually takes place through the shared memory. Advantages of parallel system: + Increased throughput + Economical Scalability of performance Multiprocessor system vs multiple single-processor system (reduction of hardware such as disks, controllers etc) + Increased reliability graceful degradation (fault tolerance, ) fail-soft systems (replication, ) TDDB63 Operating System Concepts A. Bednarski 1.38 TDDB63 Operating System Concepts A. Bednarski 1.39 Parallel Systems (Cont.) Symmetric Multiprocessor Architecture Symmetric multiprocessing (SMP) + Each processor runs an identical copy of the operating system. + Many processes can run at once without performance deterioration. + Most modern operating systems support SMP Asymmetric multiprocessing + Each processor is assigned a specific task; master processor schedules and allocates work to slave processors. + More common in extremely large systems Observation: the notion of processor is relative, e.g., a PC are normally considered to only have one CPU, but it normally has a graphic processor, a communication processor etc, and these are not considered to be multi-processing systems. TDDB63 Operating System Concepts A. Bednarski 1.40 TDDB63 Operating System Concepts A. Bednarski 1.41 Distributed Systems Distributed Systems (Cont.) Distribute the computation among several physical processors. Loosely coupled system each processor has its own local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines (LAN, WAN, MAN, Bluetooth, ). Advantages of distributed systems. + Resource sharing + Computation speed up load sharing (migration of jobs) + Reliability + Communications Network Operating System + provides file sharing, e.g., NFS - Network File Systems + provides communication scheme + runs independently from other computers on the network Distributed Operating System + less autonomy between computers + gives the impression there is a single operating system controlling the network. The network is the computer - Scott McNealy TDDB63 Operating System Concepts A. Bednarski 1.42 TDDB63 Operating System Concepts A. Bednarski 1.43 6

Real-Time Systems Summary Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems. Well-defined and fixed time constraints. Hard real-time system. + Secondary storage limited or absent, data stored in short-term memory, or read-only memory (ROM) + Conflicts with time-sharing systems, not supported by general-purpose operating systems. Soft real-time system + Limited utility in industrial control or robotics + Useful in applications (multimedia, virtual reality) requiring advanced operating system features. Purpose of operating systems Different types of operating systems and their complexities Uniprocessor, multi-processor vs distributed systems Multi-tasking vs multi-programming Resource management + Job vs. CPU scheduling + Memory etc. TDDB63 Operating System Concepts A. Bednarski 1.44 TDDB63 Operating System Concepts A. Bednarski 1.48 Recommended Reading and Exercises Reading: + Chapter 1 Exercises: + All TDDB63 Operating System Concepts A. Bednarski 1.49 7