Chapter 1 (Part 2) Introduction to Operating System

Similar documents
Understanding IO patterns of SSDs

Chapter 1: Introduction

ICP Enablon User Manual Factory ICP Enablon 用户手册 工厂 Version th Jul 2012 版本 年 7 月 16 日. Content 内容

Operating Systems Fundamentals. What is an Operating System? Focus. Computer System Components. Chapter 1: Introduction

PCU50 的整盘备份. 本文只针对操作系统为 Windows XP 版本的 PCU50 PCU50 启动硬件自检完后, 出现下面文字时, 按向下光标键 光标条停在 SINUMERIK 下方的空白处, 如下图, 按回车键 PCU50 会进入到服务画面, 如下图

Logitech G302 Daedalus Prime Setup Guide 设置指南

AvalonMiner Raspberry Pi Configuration Guide. AvalonMiner 树莓派配置教程 AvalonMiner Raspberry Pi Configuration Guide

如何查看 Cache Engine 缓存中有哪些网站 /URL

Module 1: Introduction

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Previous on Computer Networks Class 18. ICMP: Internet Control Message Protocol IP Protocol Actually a IP packet

实验三十三 DEIGRP 的配置 一 实验目的 二 应用环境 三 实验设备 四 实验拓扑 五 实验要求 六 实验步骤 1. 掌握 DEIGRP 的配置方法 2. 理解 DEIGRP 协议的工作过程

Introduction. What is an Operating System? A Modern Computer System. Computer System Components. What is an Operating System?

操作系统原理与设计. 第 13 章 IO Systems(IO 管理 ) 陈香兰 2009 年 09 月 01 日 中国科学技术大学计算机学院

计算机组成原理第二讲 第二章 : 运算方法和运算器 数据与文字的表示方法 (1) 整数的表示方法. 授课老师 : 王浩宇

Triangle - Delaunay Triangulator

Operating Systems. Chapter 4 Threads. Lei Duan

Build a Key Value Flash Disk Based Storage System. Flash Memory Summit 2017 Santa Clara, CA 1

Chapter 11 SHANDONG UNIVERSITY 1

Apache Kafka 源码编译 Spark 大数据博客 -

三 依赖注入 (dependency injection) 的学习

Operating System: an Overview. Lucia Dwi Krisnawati, MA

Oracle 一体化创新云技术 助力智慧政府信息化战略. Copyright* *2014*Oracle*and/or*its*affiliates.*All*rights*reserved.** *

ECE397A Operating Systems. Chapter 1: Introduction

Supplementary Materials on Semaphores

Multiprotocol Label Switching The future of IP Backbone Technology

OpenCascade 的曲面.

上汽通用汽车供应商门户网站项目 (SGMSP) User Guide 用户手册 上汽通用汽车有限公司 2014 上汽通用汽车有限公司未经授权, 不得以任何形式使用本文档所包括的任何部分

VAS 5054A FAQ ( 所有 5054A 整合, 中英对照 )

Command Dictionary -- DAMSTAB

Spark Standalone 模式应用程序开发 Spark 大数据博客 -

武汉大学 学年度第 1 学期 多核架构及编程技术 试卷(A)

组播路由 - MSDP 和 PIM 通过走

IPC 的 Proxy-Stub 设计模式 ( c)

OPERATING SYSTEMS UNIT - 1

: Operating System 计算机原理与设计

Microsemi - Leading Innovation for China s Hyperscale Data Centers

Congestion Control Mechanisms for Ad-hoc Social Networks 自组织社会网络中的拥塞控制机制

Command Dictionary CUSTOM

密级 : 博士学位论文. 论文题目基于 ScratchPad Memory 的嵌入式系统优化研究

第二小题 : 逻辑隔离 (10 分 ) OpenFlow Switch1 (PC-A/Netfpga) OpenFlow Switch2 (PC-B/Netfpga) ServerB PC-2. Switching Hub

Ganglia 是 UC Berkeley 发起的一个开源集群监视项目, 主要是用来监控系统性能, 如 :cpu mem 硬盘利用率, I/O 负载 网络流量情况等, 通过曲线很容易见到每个节点的工作状态, 对合理调整 分配系统资源, 提高系统整体性能起到重要作用

Module 1: Introduction

Microsoft RemoteFX: USB 和设备重定向 姓名 : 张天民 职务 : 高级讲师 公司 : 东方瑞通 ( 北京 ) 咨询服务有限公司

SNMP Web Manager. User s Manual

CHINA VISA APPLICATION CONCIERGE SERVICE*

Chapter 1: Introduction

Autodesk Backburner 2011 安装手册

Skill-building Courses Business Analysis Lesson 3 Problem Solving

Module 1: Introduction. What is an Operating System?

Outline. Motivations (1/3) Distributed File Systems. Motivations (3/3) Motivations (2/3)

Wireless Presentation Pod

新一代 ODA X5-2 低调 奢华 有内涵

Part I Overview Chapter 1: Introduction

Safe Memory-Leak Fixing for C Programs

绝佳的并行处理 - FPGA 加速的根本基石

Color LaserJet Pro MFP M477 入门指南

测试基础架构 演进之路. 茹炳晟 (Robin Ru) ebay 中国研发中心

#MDCC Swift 链式语法应 用 陈乘

Windows Batch VS Linux Shell. Jason Zhu

nbns-list netbios-type network next-server option reset dhcp server conflict 1-34

OTAD Application Note

<properties> <jdk.version>1.8</jdk.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties>

武汉大学 学年度第 2 学期 多核架构及编程技术 试卷(A)

NetScreen 概念与范例. ScreenOS 参考指南 第 7 卷 : 虚拟系统. ScreenOS 编号 SC 修订本 E

计算机科学与技术专业本科培养计划. Undergraduate Program for Specialty in Computer Science & Technology

China Next Generation Internet (CNGI) project and its impact. MA Yan Beijing University of Posts and Telecommunications 2009/08/06.

Chapter2 Instruction Sets

2. Introduction to Digital Media Format

Apache OpenWhisk + Kubernetes:

Murrelektronik Connectivity Interface Part I Product range MSDD, cable entry panels MSDD 系列, 电缆穿线板

Computer Networks. Wenzhong Li. Nanjing University

Air Speaker. Getting started with Logitech UE Air Speaker. 快速入门罗技 UE Air Speaker. Wireless speaker with AirPlay. 无线音箱 (AirPlay 技术 )

A Benchmark For Stroke Extraction of Chinese Characters

DEV Office 客户端开发增强

IBM 开源技术微讲堂容器技术与微服务系列

XPS 8920 Setup and Specifications

CA Application Performance Management

Virtual Memory Management for Main-Memory KV Database Using Solid State Disk *

EqualLogic Best Practices for SQL Server Deployments

测试 SFTP 的 问题在归档配置页的 MediaSense

H3C CAS 虚拟机支持的操作系统列表. Copyright 2016 杭州华三通信技术有限公司版权所有, 保留一切权利 非经本公司书面许可, 任何单位和个人不得擅自摘抄 复制本文档内容的部分或全部, 并不得以任何形式传播 本文档中的信息可能变动, 恕不另行通知

Chapter 1: Introduction. What is an Operating System? Overview Course (contd.) How do I spend my time? Computer System Components

朱晔和你聊 Spring 系列 S1E2: SpringBoot 并不神秘

Chap1 Introduction. Outline. An Example System. 1.1 Overview. Computer organization and architecture. Computer organization and architecture

XML allows your content to be created in one workflow, at one cost, to reach all your readers XML 的优势 : 只需一次加工和投入, 到达所有读者的手中

Oriented Scene Text Detection Revisited. Xiang Bai Huazhong University of Science and Technology

Software Engineering. Zheng Li( 李征 ) Jing Wan( 万静 )

TBarCode OCX Microsoft ActiveX compliant Barcode Control

CloudStack 4.3 API 开发指南!

Presentation Title. By Author The MathWorks, Inc. 1

White Paper 3 System Level ESD Part II: Implementation of Effective ESD Robust Designs. Industry Council on ESD Target Levels

EBD EBD. end

学习沉淀成长分享 EIGRP. 红茶三杯 ( 朱 SIR) 微博 : Latest update:

IEEE 成立于 1884 年, 是全球最大的技术行业协会, 凭借其多样化的出版物 会议 教育论坛和开发标准, 在激励未来几代人进行技术创新方面做出了巨大的贡献, 其数据库产品 IEL(IEEE/IET Electronic Library)

Smart Services Lucy Huo (Senior Consultant, UNITY Business Consulting) April 27, 2016

IBM 开源技术微讲堂容器技术与微服务系列

TW5.0 如何使用 SSL 认证. 先使用 openssl 工具 1 生成 CA 私钥和自签名根证书 (1) 生成 CA 私钥 openssl genrsa -out ca-key.pem 1024

TDS - 3. Battery Compartment. LCD Screen. Power Button. Hold Button. Body. Sensor. HM Digital, Inc.

Transcription:

Chapter 1 (Part 2) Introduction to Operating System 张竞慧办公室 : 计算机楼 366 室电邮 :jhzhang@seu.edu.cn 主页 :http://cse.seu.edu.cn/personalpage/zjh/ 电话 :025-52091017 1.1

Computer System Components 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 (compilers, database systems, video games, business programs) are used to solve user problems. 4. Users (people, machines, other computers). 1.2

Abstract View of Computer System Components 1.3

OS from User View(1/2) Layer between applications and hardware Makes hardware useful to the programmer Provides abstractions for applications Manages and hides details of hardware Accesses hardware through low/level interfaces unavailable to applications Provides protection Prevents one process/user from clobbering another 1.4

OS from User View(2/2) PC Users: an operating system is a program that provides an easy-to-use interface for using the hardware Mainframe/Minicomputer Users: an operating system is a program that helps maximize the system resource utilization Workstation Users: an operating system is a program designed to compromise between individual usability and resource utilization 1.5

What is an Operating System? A program that acts as an intermediary between the application programs and the computer hardware. Execute user programs and make solving user problems easier. Make the computer system convenient to use. Use the computer hardware in an efficient manner. From the computer s point of view: A resource allocator, a control program, a kernel 1.6

OS from System View(1/2) A Resource allocator: the operating system allocates and reclaims the system hardware resources to and from user programs A Control Program: the operating system controls the execution of user programs to prevent errors and improper use of the computer 1.7

OS from System View(2/2) There is no universal definition of what is an operating system. A common definition is that the operating system is the one program running at all times on the computer (i.e., the kernel). All other programs are application programs 1.8

The Goals of an Operating System Primary Goal: efficient operation of the computer system. In some systems, it is convenience. In the past, efficiency is far more important than convenience. 1.9

Evolution of Operating Systems It may be easier to understand the key requirements of an OS by considering the evolution of Operating Systems Simple Batch Systems Multiprogrammed batch systems Time Sharing Systems 1.10

Simple batch system Early computers were extremely expensive Important to maximize processor utilization Monitor Software that controls the sequence of events Batch jobs together Program returns control to monitor when finished 1.11

Monitor s perspective Resident Monitor is software always in memory Monitor controls the sequence of events Monitor reads in job and gives control Job returns control to monitor 1.12

Desirable Hardware Features Memory protection for monitor Jobs cannot overwrite or alter Timer Prevent a job from monopolizing system Privileged instructions Only executed by the monitor 1.13

Modes of Operation User Mode User program executes in user mode Certain areas of memory protected from user access Certain instructions may not be executed Kernel Mode Monitor executes in kernel mode Privileged instructions may be executed, all memory accessible 1.14

CPU is often idle Multiprogrammed Batch Systems Even with automatic job sequencing. I/O devices are slow compared to processor 1.15

Uniprogramming Processor must wait for I/O instruction to complete before preceding 1.16

Multiprogramming When one job needs to wait for I/O, the processor can switch to the other job 1.17

Multiprogramming 1.18

Multiprogrammed Batch Systems Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them. Keeps serval jobs in memory simultaneously Picks and begins to execute one If that job needs to wait, CPU is switched to another one 1.19 It s the first instance where the operating system must make decisions for the users

例 : 有两道程序 A B, 按下图以多道程序方式运行, 要求在右图画出它们的运行轨迹, 并计算在 60ms 内,CPU 的利用率, 假设起始时首先运行 B, 并允许忽略监督程序切换 A B 的时间 1.20

运行 15ms 运行 10ms A B I/O 20ms I/O 10ms B I/O A I/O A B 10ms 60ms t 1.21

解 : A B I/O I/O P CPU 10 20 25 30 35 40 45 50 60 t 60 (45 35) 100% 60 50 60 100% 83.3% 1.22

为了说明多道程序的优点, 不妨参考 R Turner 提出的例子 : 某计算机系统, 有 256KB 的主存 ( 不包含操作系统 ), 一个磁盘, 一个终端和一台打印机 同时提交的三个作业分别命名为 JOB1 JOB2 JOB3 各作业运行时间分别为 5min 15min 和 10min 它们对资源的使用情况如下表所示 : 1.23

三个作业的执行要求 作业名 JOB1 JOB2 JOB3 作业类型 CPU 型 I/O 型 I/O 型 所需主存 /KB 50 100 80 所需磁盘 不用 不用 需要 所需终端 不用 需要 不用 所需打印机 不用 不用 需要 运行时间 /min 5 15 10 1.24

假定 JOB1 主要使用 CPU 处理数据, JOB2 主要使用终端进行作业的输入,JOB3 运行时主要使用磁盘和打印机, 后两作业都只需要较少的 CPU 时间 对于简单批处理情况, 这些作业将按顺序执行 JOB1 运行 5min 完成,JOB2 在等待 5min 后, 运行 15min 完成,JOB3 在等待 20min 后开始执行 三个作业全部完成需要 30min( 这三个作业是一批 ) 1.25

采用多道程序设计技术, 可让这三个作业并行运行 由于它们运行中几乎不同时使用同一资源, 所以三个作业可同时运行 JOB1 在进行数据处理的同时,JOB2 在终端上进行作业输入,JOB3 在使用磁盘和打印机 因此,JOB1 只需 5min 完成,JOB2 需 15min 完成,JOB3 需 10min 完成 这样三个作业全部完成的时间只需 15min, 显然系 统处理效率明显提高 1.26

多道程序与单道程序的平均资源利用率 单道多道 ( 三道作业 ) CPU 利用率主存利用率磁盘利用率打印机利用率全部作业完成时间 /min 吞吐量 /( 作业 h 1 ) 平均周转时间 /min 1.27

Utilization Histograms 1.28

Advantages and disadvantages of multiprogramming: CPU 利用率大大提高 用户无控制权, 无交互性, 延迟大 引入多道程序设计技术的根本目的 : 提高 CPU 的利用率, 充分发挥并行性, 这包括 : 程序之间 ; 设备之间 ; 设备与 CPU 之间均并行工作 1.29

OS Features Needed for Multiprogramming Memory management the system must allocate the memory to several jobs. CPU scheduling the system must choose among several jobs ready to run. Job scheduling the system must choose among jobs ready to be brought into memory I/O routine supplied by the system. Allocation of devices. 1.30

Time Sharing Systems Using multiprogramming to handle multiple interactive jobs Processor s time is shared among multiple users Multiple users simultaneously access the system through terminals 1.31

Time-Sharing Systems Interactive Computing(1/2) Interactive computer system provides direct communication between user and the system The user gives instructions to the system directly, waits for immediately results. Response time should be short. when the operating system finishes the execution of one command, it seeks the next control statement from the user s keyboard. Time-sharing operating system allows many users to share the computer simulataneously Switches rapidly from one user to the next Gives users the impression: the entire computer system is dedicated for my use. 1.32

Time-Sharing Systems Interactive Computing(2/2) The CPU is multiplexed among several jobs that are kept in memory and on disk To obtain a reasonable response time, a job needs to be swapped in and out of memory to the disk (virtual memory). Disk management must be provided Job synchronization mechanisms are needed It may ensure that jobs do not get stuck in a deadlock 1.33

Batch Multiprogramming vs. Time Sharing 1.34

Early Example: CTSS Compatible Time-Sharing System (CTSS) Developed at MIT as project MAC Time Slicing: When control was passed to a user User program and data loaded Clock generates interrupts about every 0.2 sec At each interrupt OS gained control and could assign processor to another user 1.35

CTSS Operation Job is always loaded at address 5000 to simplify monitor and memory management To reduce disk io, job memory is only written back to disk when memory remained is not enough for incoming job 1.36

Problems and Issues Multiple jobs in memory must be protected from each other s data File system must be protected so that only authorised users can access Contention for resources must be handled Printers, storage etc 1.37

作业 : 从技术发展的角度, 简要介绍批处理系统 多道程序系统和分时系统各自的技术特性 ( 在该技术出现以前系统存在哪些问题, 该技术是如何解决这些问题的 ) 1.38

Desktop Systems(1/2) Personal computers computer system dedicated to a single user. I/O devices keyboards, mouse, display screens, small printers. User convenience and responsiveness. 1.39

Desktop Systems(2/2) Can adopt technology developed for larger operating system individuals have sole use of computer and do not need advanced CPU utilization of protection features. May run several different types of operating systems (Windows, MacOS, UNIX, Linux) 1.40

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. 1.41

Parallel Systems (Cont.) Advantages of parallel system: Increased throughput: Gets more jobs done Economy of scale: Because of resource sharing, multiprocessor systems is cheaper than multiple single processor systems Increased reliability: the failure of one processor will not halt the whole system graceful degradation Fault-tolerant systems 1.42

Parallel Systems (Cont.) Symmetric multiprocessing (SMP) Each processor runs an identical copy of the operating system. Many processes can run at once without performance deterioration. Must carefully control I/O to ensure that the data reach the appropriate processor May result in inefficiencies Most modern operating systems support SMP We Have Example! On SEU HPC Cluster: cat /proc/cpuinfo 1.43

Symmetric Multiprocessing Architecture 1.44

Parallel Systems (Cont.) Asymmetric multiprocessing Each processor is assigned a specific task. A master processor controls the system. The other processors either look to the master for instructions or have predefined tasks. Thus, this defines a master-slave relationship master processor schedules and allocated work to slave processors. More common in extremely large systems 1.45

Distributed Systems 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. 1.46

Distributed Systems (cont) A distributed system is a collection of physically separate, possible heterogeneous computer systems that are networked to provide the users with access to the various resources that the system maintains Advantages of distributed systems. Resources Sharing Computation speed up load sharing Reliability Communications 1.47

Distributed Systems (cont) Requires networking infrastructure. Local area networks (LAN) or Wide area networks (WAN) May be either client-server or peer-topeer systems. 1.48

General Structure of Client-Server 1.49

Clustered Systems A clustered system has two or more individual systems shared storage and closely linked via LAN networking The key of clustered system is high availability. Asymmetric Clustering: One machine is in hot-standby mode while others are running applications. The hot-standby machine (i.e., does nothing but) monitors other machines and becomes active if one server fails. Symmetric Clustering: Two or more hosts are running applications and monitor each other. This is more efficient as it uses all available hardware 1.50

Clustered Systems We Have Example! On SEU HPC Cluster: bsub q seu_cse I hostname 1.51

Real-Time Systems 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. 1.52

Real-Time Systems (Cont.) A real-time operating system has well-defined, fixed time constraints. Processing must be done within the defined constraints, or the system will fail. Real-Time systems may be either hard or soft realtime. Hard Real-Time Systems guarantee that critical tasks be completed on time. Soft Real-Time Systems prioritize critical tasks. That is, a critical task get priority over other tasks, and retains that priority until it completes. Embedded systems almost always run real-time operating systems 1.53

Handheld Systems Personal Digital Assistants (PDAs) Cellular telephones Issues: Limited memory Slow processors Small display screens. 1.54

Migration of Operating-System Concepts and Features 1.55

Computing Environments Traditional computing Web-Based Computing Embedded Computing Pervasive Computing Cloud Computing 1.56