Introduction to Operating System (OS)

Slides:



Advertisements
Similar presentations
Operating System Structures
Advertisements

CS 345 Computer System Overview
CMSC 421: Principles of Operating Systems Section 0202 Instructor: Dipanjan Chakraborty Office: ITE 374
Chapter 1: Introduction
Lecture 1: History of Operating System
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Common System Components
Silberschatz, Galvin and Gagne  Operating System Concepts Bare Machine (early 1950s) Structure  Large machines run from console  Single user.
A. Frank - P. Weisberg Operating Systems Evolution of Operating Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Common System Components Process Management Main Memory Management File Management.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
1/16/2008CSCI 315 Operating Systems Design1 Introduction Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
General Information Class time (NC 441)
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is an Operating System? A program that acts as an intermediary.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Lecture By : Rupinder Kaur Lect. IT SRS Govt. Polytechnic college Ludhiana Topic : Overview of Operating System.
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
1 5/25/2016 操作系统课件 教材: 《操作系统概念(第六版 影印版)》 【原书名】 Operating System Concepts(Sixth Edition) [ 原书信息 ] Operating System Concepts(Sixth Edition) [ 原书信息 ] 【原出版社】
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction n What is an Operating System? n Mainframe Systems.
Introduction Operating Systems. No. 2 Contents Definition of an Operating System (OS) Role of an Operating System History of Operating Systems Classification.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 1 Introduction Read:
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Operating Systems CSCI 411.
 H.M.BILAL Operating System Concepts.  What is an Operating System?  Mainframe Systems  Desktop Systems  Multiprocessor Systems  Distributed Systems.
Operating System Concepts Chapter One: Introduction What is an operating system? Simple Batch Systems Multiprogramming Systems Time-Sharing Systems Personal-Computer.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
1.1 Operating System Concepts Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered.
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.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
Chapter 1: Introduction
Chapter 1. Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 12, 2005 Introduction Introduction What.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
1.1 Sandeep TayalCSE Department MAIT 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming Batched Systems Time-Sharing Systems.
CS4315A. Berrached:CMS:UHD1 Introduction to Operating Systems Chapter 1.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Multiprocessor Systems Distributed.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
Chapter 1: Introduction Narzu Tarannum(NAT) Reff: BIS.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
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.
Applied Operating System Concepts
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
חוברת שקפים להרצאות של ד"ר יאיר ויסמן מבוססת על אתר האינטרנט:
Operating System Concepts
Chapter 1: Introduction
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 1: Introduction
Chapter 2: Operating-System Structures
Operating System Concepts
Chapter 1: Introduction
Presentation transcript:

Introduction to Operating System (OS) Operating Systems Introduction to Operating System (OS)

Text books Charles Crowley “Operating System A Design Approach” TMH. “Operating Systems Concepts: Essentials” by Silberschatz, Galvin, Gagne William Stallings “Operating Systems-Internals and Design Principles Andrew S. Tanenbaum “Operating Systems Design and Implementation”, Third Edition, Prentice Hall Publications 2006 A.S. Tanenbaum, “Modern Operating Systems”, 2nd edition, Prentice Hall India.

What is an Operating System? An Operating System is a program that acts as an interface between a user of a computer and the computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs. The primary goal of an operating system is thus to make the computer system convenient to use. A secondary goal is to use the computer hardware in an efficient manner.

Why Study Operating Systems? Abstraction — how do you give the users the illusion of infinite resources (CPU time, memory, file space)? System design —tradeoffs between: performance and convenience of these abstractions performance and simplicity of OS functionality in hardware or software Primary intersection point — OS is the point where hardware, software, programming languages, data structures, and algorithms all come together “Operating systems are among the most complex pieces of software yet developed”, William Stallings, 1994

Levels in a computer system User

Abstract View of Computer System Components

Where does the OS fit in?

Dynamic View of System Components

User and System View of OS User perspective : ease of usage is the main consideration. System perspective : efficiency in usage of resources is the main consideration. As a provider of resources - OS must have a policy and a control program to regulate the allocation of resources

Two key OS functions Abstract Machine Resource Manager Hides complex details of the underlying hardware Provides common API to applications and services Simplifies application writing Resource Manager Controls (scheduling, multiplexing, transforming etc.) accesses to shared resources CPU, memory, disks, network, ... Allows for global policies to be implemented Better utilization of computer hardware

Operating System Definitions Resource allocator – manages and allocates resources Control program – controls the execution of user programs and operations of I/O devices Kernel – lies between software and hardware. The one program running at all times (all else being application programs)

Providing abstraction via system calls Application System Calls: read(), open(), write(), mkdir(), kill() ... Operating System Process Mgmt Device Mgmt File System Network Comm. Protection Security CPU Memory Network Video Card Monitor Disk Printer

O.S. Components Process management Main memory management File management I/O system management Secondary storage management Networking Protection system Command interpreter system

Process Management A process is a program in execution. Needs (CPU time, memory, files, and I/O devices). Tasks of Process Management of an OS Create, load, execute, suspend, resume, and terminate processes Process scheduling :Switch system among multiple processes in main memory Provides communication mechanisms so that processes can send (or receive) data to (or from) each other. Process synchronization Control concurrent access to shared data to keep shared data consistent. Allocate/de-allocate resources properly to prevent or avoid deadlock situation

Main-Memory Management Processes must be loaded into main memory to be executed. Tasks of Main Memory Management of OS Keep track of which memory area is used by whom. Decide which processes to load when memory space becomes available. Allocate and de-allocate memory space as needed.

File Management A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. Tasks of File Management File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage media.

I/O System Management The I/O system consists of: A buffer-caching system A general device-driver interface Drivers for specific hardware devices

Secondary-Storage Management Almost everything is stored in the secondary storage. Therefore, secondary storage accesses must be efficient and convenient Tasks of Storage Management Free space management Storage allocation Disk scheduling

Networking (Distributed Systems) A distributed system is a collection of processors that do not share memory or a clock. Each processor has its own local memory. The processors in the system are connected through a communication network. Communication takes place using a protocol. Access to a shared resource allows: Computation speed-up Increased data availability Enhanced reliability

Protection System Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must: distinguish between authorized and unauthorized usage. specify the controls to be imposed. provide a means of enforcement.

Command-Interpreter System Many commands are given to the operating system by control statements which deal with: process creation and management I/O handling secondary-storage management main-memory management file-system access protection Networking The program that reads and interprets control statements is called variously: command-line interpreter shell (in UNIX)

System Calls Process control File manipulation Device manipulation end/abort this program load/execute another program create/terminate a process get/set attributes wait specified time wait for event, signal event File manipulation create/open/read/write/close/delete file Device manipulation request/read/write/release device Information get/set time/date

Evolution of Operating Systems Early Systems (1950) Simple Batch Systems (1960) Multiprogrammed Batch Systems (1970) Time-Sharing and Real-Time Systems (1970) Personal/Desktop Computers (1980) Multiprocessor Systems (1980) Networked/Distributed Systems (1980) Web-based Systems (1990)

Example of an early computer system Eniac filled an entire room. Weighed eighty tones and consumed 200 KW of power

Simple Batch System The user submit the job on cards or tapes to a program operator, who batches the jobs together sequentially and places the entire batch on an input device, for use by the monitor (program)

Operation of Simple Batch Systems The user submits a job (written on cards or tape) to a computer operator. The computer operator place a batch of several jobs on an input device. A special program, the monitor, manages the execution of each program in the batch.

Idea of Simple Batch Systems Reduce setup time by batching similar jobs. Use Automatic Job Sequencing – automatically transfer control from one job when it finishes to another one.

Spooling (1) Problem: Solution: Spooling - Card reader, Line printer and Tape drives slow (compared to Disk). I/O and CPU could not overlap. Solution: Spooling - Overlap I/O of one job with the computation of another job (using double buffering, DMA, etc). Technique is called SPOOLing: Simultaneous Peripheral Operation On Line.

We assumed Uniprogramming until now I/O operations are exceedingly slow (compared to instruction execution). A program containing even a very small number of I/O operations, will spend most of its time waiting for them. Hence: poor CPU usage when only one program is present in memory. A. Frank - P. Weisberg

Memory Layout for Uniprogramming

Memory Layout for Batch Multiprogramming Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

Multiprogramming (2) A. Frank - P. Weisberg

Why Multiprogramming? Advantages Disadvantages Increases CPU utilization by organizing jobs so that the CPU always has one to execute. User feels that many programs are allotted CPU almost simultaneously. Disadvantages CPU scheduling is required. To accommodate many jobs in memory, memory management is required

Time-Sharing System Multiprogramming does not support interaction with users. Time-sharing extends Multiprogramming to handle multiple interactive jobs – it’s Interactive Multiprogramming. Multiple users simultaneously access the system through commands entered at terminals. Processor’s time is shared among multiple users.

Batch Multiprogramming vs. Time Sharing 35

Example: Embedded system use real time operating system Real-Time Systems Real-Time (RT) systems are dedicated systems that need to adhere to deadlines , i.e., time constraints. Correctness of the system depends not only on the logical result of computation, but also on the time at which the results are produced. Example: Embedded system use real time operating system An embedded system is a computer systemwith a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts

Hard Real-Time Systems Hard real-time system must meet its deadline. Often used as a control device in a dedicated application: Industrial control Robotics Secondary storage limited or absent, data/program is stored in short term memory, or Read-Only Memory (ROM).

Soft Real-Time Systems Deadlines desirable but not mandatory. Limited utility in industrial control or robotics. Useful in modern applications (multimedia, video conference, virtual reality) requiring advanced operating-system features.

Multiprocessor Systems System with several CPUs in close communication: processors share memory and a clock. communication usually takes place through the shared memory. Also known as parallel systems, tightly-coupled systems. Advantages: Increased throughput Economy Of Scale Increased reliability

Multiprogramming vs. Multiprocessing

Types of Multiprocessor Systems Asymmetric Multiprocessing master processor schedules and allocates work to slave processors.

Types of Multiprocessor Systems Symmetric Multiprocessing (SMP) Each processor performs all tasks within operating system. No Master slave relationship. Most modern operating systems support SMP.

Distributed Systems Distributed system is collection of loosely coupled processors interconnected by a communications network. Reasons for distributed systems: Resource sharing: sharing and printing files at remote sites. processing information in a distributed database. using remote specialized hardware devices. Computation speedup – load sharing. Reliability – detect and recover from site failure, function transfer, reintegrate failed site. Communication – message passing.

Distributed Systems A. Frank - P. Weisberg

Distributed Operating Systems (DOS) Gives the impression there is a single operating system controlling the network. Data Migration – transfer data by transferring entire file, or transferring only those portions of the file necessary for the immediate task. Computation Migration – transfer the computation, rather than the data, across the system. Process Migration – execute an entire process, or parts of it, at different sites.

Operating-System Operations Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user

Transition from User to Kernel Mode Timer to prevent infinite loop Set interrupt after specific period Operating system decrements counter When counter zero generate an interrupt

Multiplexing in Resource management Time multiplexing time-sharing scheduling a serially-reusable resource among several users Eg CPU or printer Space multiplexing space-sharing dividing a multiple-use resource up among several users Eg Memory, disk space

Time-multiplexing the processor

Space-multiplexing memory

Time-multiplexing I/O devices

Space-multiplexing the disk