I/O. Disclaimer: some slides are adopted from book authors slides with permission 1

Similar documents
Quiz: Address Translation

Roadmap. CPU management. Memory management. Disk management. Other topics. Process, thread, synchronization, scheduling. Virtual memory, demand paging

2 nd Half. Memory management Disk management Network and Security Virtual machine

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Filesystem. Disclaimer: some slides are adopted from book authors slides with permission 1

Operating Systems. V. Input / Output. Eurecom

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

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

Mass-Storage Systems

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

COS 318: Operating Systems. Storage Devices. Vivek Pai Computer Science Department Princeton University

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane

Mass-Storage Structure

Operating Systems. V. Input / Output

Input / Output. Kevin Webb Swarthmore College April 12, 2018

Moneta: A High-performance Storage Array Architecture for Nextgeneration, Micro 2010

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Fall 2017

[537] I/O Devices/Disks. Tyler Harter

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

CSE 451: Operating Systems Spring Module 12 Secondary Storage

Input/Output. Chapter 5: I/O Systems. How fast is I/O hardware? Device controllers. Memory-mapped I/O. How is memory-mapped I/O done?

CIS Operating Systems I/O Systems & Secondary Storage. Professor Qiang Zeng Spring 2018

The Requirements of I/O. In a Picture. OS Basics: I/O. CS162 Operating Systems and Systems Programming Lecture 16. General I/O. So far in this course:

CSE 153 Design of Operating Systems

I/O Systems. Jo, Heeseung

CSE 451: Operating Systems Spring Module 12 Secondary Storage. Steve Gribble

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

CMPT 300 Introduction to Operating Systems

Operating Systems 2010/2011

V. Mass Storage Systems

Mass-Storage. ICS332 - Fall 2017 Operating Systems. Henri Casanova

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware

Outline. Operating Systems: Devices and I/O p. 1/18

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

Input/Output Systems

CSCI-GA Database Systems Lecture 8: Physical Schema: Storage

I/O 1. Devices and I/O. key concepts device registers, device drivers, program-controlled I/O, DMA, polling, disk drives, disk head scheduling

I/O Devices & SSD. Dongkun Shin, SKKU

Hard Disk Drives. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau)

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

u Covered: l Management of CPU & concurrency l Management of main memory & virtual memory u Currently --- Management of I/O devices

Mass-Storage Systems. Mass-Storage Systems. Disk Attachment. Disk Attachment

Hard Disk Drives (HDDs)

CS370 Operating Systems

CS370 Operating Systems

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

CSCI-GA Operating Systems I/O. Hubertus Franke

CS370 Operating Systems

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

Disks and RAID. CS 4410 Operating Systems. [R. Agarwal, L. Alvisi, A. Bracy, E. Sirer, R. Van Renesse]

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

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder

Input/Output. Today. Next. Principles of I/O hardware & software I/O software layers Disks. Protection & Security

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

I/O. CS 416: Operating Systems Design Department of Computer Science Rutgers University

CSE 153 Design of Operating Systems Fall 2018

Operating Systems (CS1022) Input/Output. Yagiz Özbek Evren

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Key Points. Rotational delay vs seek delay Disks are slow. Techniques for making disks faster. Flash and SSDs

Chapter 10: Mass-Storage Systems

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

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

Storage Systems. Storage Systems

High Performance Solid State Storage Under Linux

CS162 Operating Systems and Systems Programming Lecture 16. I/O Systems. Page 1

Disk Scheduling COMPSCI 386

COS 318: Operating Systems. Storage Devices. Jaswinder Pal Singh Computer Science Department Princeton University

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

Why? Storage: HDD, SSD and RAID. Computer architecture. Computer architecture. 10 µs - 10 ms. Johan Montelius

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Computer Organization

The personal computer system uses the following hardware device types -

Devices and Device Controllers. secondary storage (disks, tape) and storage controllers

Bus Architecture Example

CS370 Operating Systems

Mass-Storage. ICS332 Operating Systems

EECS 482 Introduction to Operating Systems

Answer to exercises chap 13.2

I/O & Storage. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University

Computer Science 61C Spring Friedland and Weaver. Input/Output

Anne Bracy CS 3410 Computer Science Cornell University

Advanced Parallel Architecture Lesson 4 bis. Annalisa Massini /2015

CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Oct 27, 29, 31. Winter Session 2014, Term 1

Storage: HDD, SSD and RAID

CS429: Computer Organization and Architecture

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

CS429: Computer Organization and Architecture

Chapter 10: Mass-Storage Systems

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices

October 26 th, 2015 Prof. John Kubiatowicz

Chapter 10: Mass-Storage Systems. Operating System Concepts 9 th Edition

CS 261 Fall Mike Lam, Professor. Memory

Storage. CS 3410 Computer System Organization & Programming

Virtual Memory. Reading. Sections 5.4, 5.5, 5.6, 5.8, 5.10 (2) Lecture notes from MKP and S. Yalamanchili

Transcription:

I/O Disclaimer: some slides are adopted from book authors slides with permission 1

Thrashing Recap A processes is busy swapping pages in and out Memory-mapped I/O map a file on disk onto the memory space Copy-on-Write (COW) Copy pages on updates Kernel memory allocator Buddy allocator algorithm 2

Recap: Address Translation 8 bits 1 st level 8 bits 8 bits 2 nd level offset Virtual address format (24bits) 4 bits 3 Frame # Unused 1 V Page table entry (8bit) Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370 Paddr:??? Vaddr: 0x082370 Paddr:??? Page-table base address = 0x100 Addr +0 +1 +2 +3 +4 +5 +6 +7 +8 +A +B +C +D +E +F 0x000 31 0x010 0x020 41.. 0x100 00 01 01 00 01.. 0x200 3

Recap: Address Translation 8 bits 1 st level 8 bits 8 bits 2 nd level offset Virtual address format (24bits) 4 bits 3 Frame # Unused 1 V Page table entry (8bit) Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370 Paddr: 0x470 Vaddr: 0x082370 Paddr: invalid Page-table base address = 0x100 Addr +0 +1 +2 +3 +4 +5 +6 +7 +8 +A +B +C +D +E +F 0x000 31 0x010 0x020 41.. 0x100 00 01 01 00 01.. 0x200 4

Concepts to Learn I/O subsystems Blocking, non-blocking, asynchronous I/O Memory-mapped I/O Programmed I/O vs. DMA Disk 5

Input/output (I/O) Subsystems 6

I/O Subsystems: the Goal Provide easy to use standardized interfaces This code works for many different devices int fd = open( /dev/somedev, O_RDWR); char buf[80]; for (int i = 0; i < 10; i++) { } close(fd); sprintf(buf, i: %d\n, i); write(fd, buf, 80); Hide the details of each device to users 7

Block devices Standard Device Types E.g., disk, cd-rom, USB stick High speed, block (sector) level accesses Character devices E.g., keyboard, mouse, joystick Low speed, character level accesses Network devices E.g., ethernet, wifi, bluetooth Socket interface 8

Blocking I/O Types of I/O Operations Wait (i.e., the calling process is put to sleep) until the data is ready Non-blocking I/O Immediately return to the caller no matter what. I/O may not be completed Asynchronous I/O Notify later when the I/O is completed (via callback or interrupts) 9

How Does CPU Talk to Devices? CPU talks to device controllers Via I/O instructions or memory mapped I/O 10

Memory Mapped I/O USB, SD/MMC, Timer, DRAM Samsung Exynos 4412 (ARM) Processor Physical Address Map 11

Memory Mapped I/O Parts of physical memory space are mapped to hardware controllers Mapped to control registers and buffers Reading/writing from/to the memory mapped regions in device specific ways Device drivers job 12

Example #define CTRL_BASE_ADDR 0xCE000000 int *io_base = (int *)ioremap_nocache(crtl_base_addr, 4096); // initialize the device (by writing some values to h/w regs) *io_base = 0x1; *(io_base + 1) = 0x2; *(io_base + 2) = 0x3; // wait until the device is ready (bit31 = 0) while (*io_base & 0x80000000); // send data to the device for (i = 0; i < sizeof(buffer); i++) { *(io_base + 0x10) = buffer[i]; while (*io_base & 0x80000000); } Programmed I/O (PIO) Polling 13

Data Transfer Methods Programmed I/O Via CPU s load/store instructions Simple h/w, but high CPU load Direct Memory Access Controllers directly read/write from/to DRAM Interrupts the CPU on the completion of I/O ops. Complex h/w, but low CPU overhead 14

Direct Memory Access 15

Interrupt Driven I/O Cycle 16

Magnetic disks (HDD) Disk Still used as the main storage device on many computers Mechanical device (moving parts) Cheap but slow Solid-state disks (SSD) All smartphones and tables, many notebooks No moving parts, use NAND flash chips Still a bit expensive but faster 17

The First Commercial Disk Drive 1956 IBM RAMDAC computer included the IBM Model 350 disk storage system 5M (7 bit) characters 50 x 24 platters Access time = < 1 second 18

Magnetic Disk 19

Hard Disk Drive (HDD) read, write Host I/F (SATA, ) Microcontroller HDD Storage size ~ 3TB Performance B/W: ~1Gb/s Seek time: 3-12ms 20

Disk Scheduling Goal: minimize seek time FCFS, SSTF (shortest seek time first), SCAN SCAN scheduling 21

NAND Flash Memory Chip Figure source: Micron, TN-29-19: NAND Flash 101, 2010 22

Solid-State Disk (SSD) read, write read, program, erase Host I/F (SATA, ) Microcontroller NAND NAND NAND SSD Same I/f as HDD SATA. Flash Translation Layer (FTL) S/W running on the controller Provides disk abstraction Storage size ~1TB No seek time Bandwidth SATA (6Gbps) is the bottleneck Some use PCIe I/F 23

Summary I/O subsystems Standardized interfaces to access various i/o devices I/O device types Block, characters, network devices I/O mechanisms Memory-mapped I/O, I/O instructions Programmed I/O vs. DMA Disk HDD vs. SDD 24

Quiz Which of the following is true of a blocking system call? A) The application continues to execute its code when the call is issued. B) The call returns immediately without waiting for the I/O to complete. C) The execution of the application is suspended when the call is issued. D) Blocking application code is harder to understand than nonblocking application code 25