OPERATING SYSTEMS PRINCIPLES Instructor: Xiangluo Wang Office: Yifu A404 Office Hours: 16:00-18:00,or.

Slides:



Advertisements
Similar presentations
Chapter 2 Operating System Overview Operating Systems: Internals and Design Principles, 6/E William Stallings.
Advertisements

WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Computer System Overview
Chap 2 System Structures.
Operating System Structure
Operating-System Structures
CS 345 Computer System Overview
3: OS Structures 1 OPERATING SYSTEM STRUCTURES PROCESS MANAGEMENT A process is a program in execution: (A program is passive, a process active.) A process.
CMSC 421: Principles of Operating Systems Section 0202 Instructor: Dipanjan Chakraborty Office: ITE 374
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
1/21/2008CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
1: Operating Systems Overview
Operating Systems Concepts Professor Rick Han Department of Computer Science University of Colorado at Boulder.
OS Spring’03 Introduction Operating Systems Spring 2003.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Chapter 1 and 2 Computer System and Operating System Overview
1 Introduction Chapter What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5.
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Silberschatz, Galvin and Gagne  Operating System Concepts Bare Machine (early 1950s) Structure  Large machines run from console  Single user.
1/16/2008CSCI 315 Operating Systems Design1 Introduction Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Computer System Architectures Computer System Software
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
9/14/2015B.Ramamurthy1 Operating Systems : Overview Bina Ramamurthy CSE421/521.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
B.Ramamurthy9/19/20151 Operating Systems u Bina Ramamurthy CS421.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
◦ What is an Operating System? What is an Operating System? ◦ Operating System Objectives Operating System Objectives ◦ Services Provided by the Operating.
Understanding Operating Systems Flynn & McHoes
Chapter 3 Process Description and Control
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems Principles Lecture 1: Introduction 主講人:虞台文.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1.1 Operating System Concepts Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Silberschatz and Galvin  Operating System Concepts Module 1: Introduction What is an operating system? Simple Batch Systems Multiprogramming.
Processes Introduction to Operating Systems: Module 3.
INFORMATION SYSTEM-SOFTWARE Topic: OPERATING SYSTEM CONCEPTS.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CIS250 OPERATING SYSTEMS Chapter One Introduction.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
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.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered System Real.
CompSci 143A1 1. Introduction 1.1 The Role of Operating Systems - Bridge the “Semantic Gap” between Hardware and Application - Three Views of Operating.
Introduction to Operating Systems Concepts
Introduction to Operating System (OS)
Chapter 1: Introduction
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
CS510 Operating System Foundations
Operating Systems Principles Lecture 1: Introduction
Operating System Overview
Presentation transcript:

OPERATING SYSTEMS PRINCIPLES Instructor: Xiangluo Wang Office: Yifu A404 Office Hours: 16:00-18:00,or by appointment

Preface GOALS  Devoting to traditional topics  Extending & Integrating them with basic ideas in distributed computing  Emphasizing language application CONTENTS  Process Management and Coordination  Memory Management  File and I/O Management  Protection and Security

Preface EXERCISES  Analytical contents  Constructive contents  Discussion or speculative analysis APPROACH & PHILOSOPHY  In-depth coverage of standard topics  Integrating centralized and distributed OS issues in each chapter  Introducing various cases of existing os throughout the course

CHAPTER 1  THE ROLE OF OPERATING SYSTEMS THE ROLE OF OPERATING SYSTEMS  ORGANIZATION OF OPERATING SYSTEMS ORGANIZATION OF OPERATING SYSTEMS  OPERATING SYSTEM EVOLUTION AND CONCEPTS INDEX:

THE ROLE OF OPERATING SYSTEMS Bridging the Hardware/Application Gap As Extended Machines As Virtual Machines As Resource Managers

Fetch the instruction pointed to by the program counter Increment the program counter Decode the current instruction Fetch any operands referenced by the instruction Execute the instruction FIGURE 1-1 Basic hardware cycle

Main memory CPUCommunication devices Secondary storage User Network FIGURE 1-2 Main components of a computer system Main memory CPU Communication devices Secondary storage FIGURE 1-3 Shared-memory multiprocessor

Main memory CPU Communication devices Secondary storage Main memory FIGURE1-4 Distributed-memory multiprocessor Main memory CPU Communication devices Secondary storage Main memory Secondary storage Communication devices Network FIGURE 1-5 Multicomputer

LARGE DIVIDE BETWEEN HARDWARE AND APPLICATION:  Machine instructions Read or write a value High-level data structures Perform arithmetic/logical operation----- Complex control flows  Main memory A linear sequence of simple cells------programs, modules, and data structures  Secondary storage Tracks, blocks------file  Hardware interface and I/O device Registers messages

Three Views of operating systems Abstraction: Being applied to handle complexity Virtualization: resource sharing Resource management: The problem of efficiency KEY CONCEPTS:

OS as Extended Machines Abstraction: package sequences of lower-level instructions into functions that can be invoked as single higher-level operations Making use of abstraction at many levels

OS as Virtual Machines CPU 1 CPU 2 CPU Virtual memory 1 Virtual memory 2 Main memory Printer 1 Printer 2 Printer Application1 Time sharing Memory management Spooling OS Hardware Principles of virtualization

Task’s VM space in Linux User kernel CS DS BSS HEAP STACK HOLE 3GB 1GB

OS as Resource Managers Difference between devices’ performance Parallelism opportunities Scheduling policies

ORGANIZATION OF OS Structural Organization (functional) Internal structure (static)  Hardware Interface  Programming Interface  User Interface Runtime Organization

Structural Organization Applications (system and user) OS kernel System libraries Hardware User Library calls Kernel calls Machine instructions

Hardware Interface Interrupts, Singularities, and Traps  External interrupts (Hardware)  Internal interrupts Soft interrupts Self traps Singularities Modes of Instruction Execution X86:Ring 0—Ring 3

Example Clock interrupt in Linux Several hardware clock interrupts contribute one “tick”; One “tick” causes the change of execution mode. Task schedule& switch Occurring in Ring 0 User mode& kernel mode Linux: Ring0& Ring3; OS2: Ring0---Ring3

The Programming Interface The difference between kernel and library functions Sys-calls provided by OSs

Application issues call To lib_func(params) Body of Lib_func() Push params on stack Branch to lib_func() body Perform service Return from function Pop stack pointer Nonprivileged library service

Application issues call To kern_func(params) Body of kern_func() Push params on stack Branch to kern_func() body Set up regs for SVC SVC Pop stack pointer Nonprivileged library service Return from function Kernel code Perform service Set nonprivileged mode Return from SVC

Sys-calls Process management --create/destroy, suspend/activate process --send signal or message to process --wait for event or signal Memory management --allocate/deallocate region of memory --increase/decrease size of allocated region

Sys-calls File management --create/destroy, open/close, move, rename file --append data to file or concatenate files --display content of file or directory --display/change file attributes

Sys-calls Input/Output --read/write character or block of data from a file or device --control/check status of a device Miscellaneous services --get current date and time --schedule an alarm to occur --generate various system diagnostics

The User Interface The top-level user interface remains available at all times so that users can launch, use, monitor, and manage applications and files –Text-based interface (shell) –Graphics-based interface (GUI)

The Shell Execute and manage programs ar: create, edit,modify source files as: compiler ld: GNU linker gdb: GNU DeBug Manipulate files mkdir, rm, mv, rmdir, cat Obtain system information who, pwd,du, ls

The Shell Shell scripts local variables iterative statements conditionals arithmetic and logical operators Wildcards connectors

Runtime Organization User process Library or kernel call Service routine return Service as a subroutine Process’ address space User process (client) Return results Send request Service routine Process1’s address space Process2’s address space System process (server) Service as a process

Benefits of the C/S approach Being suitable for a distributed system Being convenient for different types of services Having a greater degree of fault tolerance Enforcing a strict segregation of functionalities

OS EVOLUTION&CONCEPTS Early systems Batch OSs Multiprogramming Systems Interactive OSs PC and Workstation OSs Real-Time OSs Distributed OSs

Early Systems Users interact with computations One at a time At the lowest machine level A standard operating procedure Loader  assembler  source program  loader  exe machine code Initial startup (bootstrapping)

Batch OSs Automating the standard load/translate/load/execute sequence Job-to-job transitions automatically Submitting multiple jobs at the same time I/O processor (I/O channel)

Multiprogramming Systems A simultaneous manner Virtual parallelism (concurrence) Protection Process synchronization and communication Dynamic memory management

Job ACPU IO Job B Sequential execution Job A IO A CPU A CPU B IO B Job B multiprogramming CPU and I/O overlap

Interactive OSs The ability to simultaneously share a machine’s resources Acceptable response time to each user Serve processes cyclically by assigning a small portion or quantum of CPU time

PC and Workstation OSs The development of GUIs Manually switching Implicit multiprogramming (multitasking) Being transparent to the interactive user but not to applications Preemptive multiprogramming Being transparent not only to users but to applications

Real-Time OSs Timing constraints (deterministic deadlines) Concurrency (asynchronous, simultaneous) Strict fault tolerance and reliability requirements Difficult to test and certify

Distributed OSs Loosely coupled Communicates at a lower level (e.g., over a WAN) Tightly coupled higher-level communication on top of message passing (RPC) Clocks must be synchronized, accurate, and monotomic increasing

EXERCISES Give examples of semantic gaps that must be bridged by software,including OSs at the following levels: CPU (instruction) level, main memory level, secondary storage level, I/O device level. What do traps and interrupts have in common? How are they different? Give an example of each.

EXERCISES What do multiprogramming and time- sharing have in common? How are they different? Is multiprogramming possible without interrupts? Is time-sharing possible without interrupts?