Computer Architecture and OS. EECS678 Lecture 2

Similar documents
EECS 678: Introduction to Operating Systems. Heechul Yun

Operating System Structure

Operating System Structure

Architecture and OS. To do. q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure

CS370 Operating Systems

CS370 Operating Systems

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Architectural Support for Operating Systems

CSE Opera+ng System Principles

Introduction to Computer Systems and Operating Systems

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

Lecture 2: September 9

Lecture 1 Introduction (Chapter 1 of Textbook)

CS420: Operating Systems

Part I Overview Chapter 1: Introduction

Four Components of a Computer System

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

7/20/2008. What Operating Systems Do Computer-System Organization

OS And Hardware. Computer Hardware Review PROCESSORS. CPU Registers. CPU Registers 02/04/2013

Even coarse architectural trends impact tremendously the design of systems

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Chapter 1: Introduction

CSC501 Operating Systems Principles. OS Structure

Computer System Overview

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Operating Systemss and Multicore Programming (1DT089)

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

CS3600 SYSTEMS AND NETWORKS

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

Lecture 17 Introduction to Memory Hierarchies" Why it s important " Fundamental lesson(s)" Suggested reading:" (HP Chapter

CSC 2405: Computer Systems II

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

Chapter 1: Introduction. Operating System Concepts 8 th Edition,

Chapter 1: Introduction. Chapter 1: Introduction

Common Computer-System and OS Structures

Operating system Dr. Shroouq J.

Chapter 1: Introduction Dr. Ali Fanian. Operating System Concepts 9 th Edit9on

Introduction to Operating Systems (Part II)

Chapter 1: Introduction. Operating System Concepts 8th Edition,

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

Even coarse architectural trends impact tremendously the design of systems

CS420: Operating Systems

Even coarse architectural trends impact tremendously the design of systems. Even coarse architectural trends impact tremendously the design of systems

Lecture 4: Memory Management & The Programming Interface

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

CS 333 Introduction to Operating Systems Class 2 OS-Related Hardware & Software The Process Concept

QUIZ Ch.6. The EAT for a two-level memory is given by:

Computer-System Organization (cont.)

Four Components of a Computer System. Operating System Concepts 7 th Edition, Jan 12, 2005

ECE Lab 8. Logic Design for a Direct-Mapped Cache. To understand the function and design of a direct-mapped memory cache.

The Lesson Plan of OS. The syllabus of OS. Access the lesson plan and syllabus at

CISC 662 Graduate Computer Architecture Lecture 16 - Cache and virtual memory review

What s the difference between threads/processes. Operating Systems

Operating System Review

Chapter 1: Introduction

CSE 451: Operating Systems Winter Module 2 Architectural Support for Operating Systems

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

Chapter 1: Introduction

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

CS61C : Machine Structures

Computational Optimization ISE 407. Lecture1. Dr. Ted Ralphs

CS399 New Beginnings. Jonathan Walpole

The Memory Hierarchy 10/25/16

Computers: Inside and Out

CS 31: Intro to Systems Storage and Memory. Kevin Webb Swarthmore College March 17, 2015

Lecture 2: Memory Systems

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

Chapter 1 Computer System Overview

Basic Computer Hardware

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

CSC 4320 Test 1 Spring 2017

Overview of Operating Systems

Question?! Processor comparison!

Lecture 2: Architectural Support for OSes

CS 333 Introduction to Operating Systems. Class 2 OS-Related Hardware & Software The Process Concept

Cycle Time for Non-pipelined & Pipelined processors

Part I Introduction Hardware and OS Review

Computer Organization

Operating Systems Lecture 5: Memory Management I

FYS Data acquisition & control. Introduction. Spring 2018 Lecture #1. Reading: RWI (Real World Instrumentation) Chapter 1.

Multiprocessor Systems. Chapter 8, 8.1

Chapter 5: Computer Systems Organization

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

Concurrent programming: Introduction I

Multiple Processor Systems. Lecture 15 Multiple Processor Systems. Multiprocessor Hardware (1) Multiprocessors. Multiprocessor Hardware (2)

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Lecture-14 (Memory Hierarchy) CS422-Spring

Jan 20, 2005 Lecture 2: Multiprogramming OS

CIT 668: System Architecture. Computer Systems Architecture

Computer-System Structures

Operating System Services

Chapter 5 B. Large and Fast: Exploiting Memory Hierarchy

CS 31: Intro to Systems Threading & Parallel Applications. Kevin Webb Swarthmore College November 27, 2018

Transcription:

Computer Architecture and OS EECS678 Lecture 2 1

Recap What is an OS? An intermediary between users and hardware A program that is always running A resource manager Manage resources efficiently and fairly A easy to use virtual machine providing APIs and services 2

Agenda Computer architecture and OS CPU, memory, disk Architecture trends and their impact to OS Architectural support for OS 3

Computer Architecture and OS OS talks to hardware OS needs to know the hardware features OS drives new hardware features Applications Operating System Computer Hardware 4

Simplified Computer Architecture A von Neumann architecture 5

A Computer System Essentials: CPU, Memory, Disk Others: graphic, USB, keyboard, mouse, 6

Central Processing Unit (CPU) The brain of a computer Fetch instruction from memory Decode and execute Store results on memory/registers Moore s law Transistors double every 1~2yr 5.56 billion in a 18-core Intel Xeon Haswell-E5 7

H Sutter, The Free Lunch Is Over, Dr. Dobb's Journal, 2009 8

Single-core CPU Processor Core Registers Cache Memory Time sharing When to schedule which task? 9

Multicore CPU Processor Core Registers Cache Core Registers Cache Shared Cache Memory Parallel processing Which tasks to which cores? May have performance implication due to cache contention contention-aware scheduling 10

Multiprocessors Core Register s Cache Processor Core Register s Cache Core Register s Cache Processor Core Register s Cache Shared Cache Shared Cache Memory Memory Non-uniform memory access (NUMA) architecture Memory access cost varies significantly: local vs. remote Which tasks to which processors? 11

Memory Hierarchy Main memory DRAM Fast, volatile, expensive CPU has direct access Disk Hard disks, solid-state disks Slow, non-volatile, inexpensive CPU doesn t have direct access. 12

Memory Hierarchy Fast, Expensive Slow, Inexpensive 13

Storage Performance Performance of various levels of storage depends on distance from the CPU, size, and process technology used Movement between levels of storage hierarchy can be explicit or implicit 14

Caching A very important principle applied in all layers of hardware, OS, and software Put frequently accessed data in a small amount of faster memory Fast, most of the time (hit) Copy from slower memory to the cache (miss) 15

Architectural Support for OS Interrupts and exceptions Protected modes (kernel/user modes) Memory protection and virtual memory Synchronization instructions 16

Interrupt What is an interrupt? A signal to the processor telling do something now! Hardware interrupts Devices (timer, disk, keyboard, ) to CPU Software interrupts (exceptions) Divide by zero, special instructions (e.g., int 0x80) 17

Interrupt Handling save CPU states (registers) execute the associated interrupt service routine (ISR) restore the CPU states return to the interrupted program 18

Timesharing Multiple tasks share the CPU at the same time But there is only one CPU (assume single-core) Want to schedule different task at a regular interval of 10 ms, for example. Timer and OS scheduler tick The OS programs a timer to generate an interrupt at every 10 ms. 19

Dual (User/Kernel) Mode Some operations must be restricted to the OS accessing registers in the disk controller updating memory management unit states User/Kernel mode Hardware support to distinguish app/kernel Privileged instructions are only for kernel mode Applications can enter into kernel mode only via pre-defined system calls 20

User/Kernel Mode Transition System calls Programs ask OS services (privileged) via system calls Software interrupt. int <num> in Intel x86 21

Memory Protection How to protect memory among apps/kernel? Applications shouldn t be allowed to access kernel s memory An app shouldn t be able to access another app s memory 22

Virtual Memory How to overcome memory space limitation? Multiple apps must share limited memory space But they want to use memory as if each has dedicated and big memory space E.g.,) 1GB physical memory and 10 programs, each of which wants to have a linear 4GB address space 23

Virtual Memory Process A Process B Process C MMU Physical Memory 24

MMU Hardware unit that translates virtual address to physical address Defines the boundaries of kernel/apps Enable efficient use of physical memory Virtual address Physical address CPU MMU Memory 25

Synchronization Synchronization problem with threads Deposit(account, amount) { { account->balance += amount; } Thread 1: Deposiit(acc, 10) LOAD R1, account->balance ADD R1, amount STORE R1, account->balance Thread 2: : Deposiit(acc, 10) LOAD R1, account->balance ADD R1, amount STORE R1, account->balance 26

Synchronization Instructions Hardware support for synchronization TestAndSet, CompareAndSwap instructions Atomic load and store Used to implement lock primitives New TSX instruction hardware transaction Another methods to implement locks in single-core systems Disabling interrupts 27

Summary OS needs to understand architecture Hardware (CPU, memory, disk) trends and their implications in OS designs Architecture needs to support OS Interrupts and timer User/kernel mode and privileged instructions MMU Synchronization instructions 28

OS Abstractions Reality A single computer Limited RAM capacity Mechanical disk Insecure and unreliable networks Abstraction Multiple computers Infinite capacity File system Reliable and secure 29