36. I/O Devices. Operating System: Three Easy Pieces 1

Size: px
Start display at page:

Download "36. I/O Devices. Operating System: Three Easy Pieces 1"

Transcription

1 36. I/O Devices Oerating System: Three Easy Pieces 1

2 I/O Devices I/O is critical to comuter system to interact with systems. Issue : w How should I/O be integrated into systems? w What are the general mechanisms? w How can we make the efficiently? AOS@UC 2

3 Structure of inut/outut (I/O) device CPU Memory Seed+ & Cost+ Grahics Memory Bus (rorietary) General I/O Bus (e.g., PCI) Periheral I/O Bus (e.g., SCSI, SATA, USB) Prototyical System Architecture CPU is attached to the main memory of the system via some kind of memory bus. Some devices are connected to the system via a general I/O bus. Why not a flat design? (like in the early days) AOS@UC 3

4 I/O Architecture Buses w Data aths that rovided to enable information between CPU(s), RAM, and I/O devices. I/O bus w Data ath that connects a CPU to an I/O device. w I/O bus is connected to I/O device by three hardware comonents: I/O orts, interfaces and device controllers. In current system (due to scalability limitations of the buses) some high-seed buses have migrated to oint-to-oint networks AOS@UC 4

5 Canonical Device Canonical Devices has two imortant comonents. w Hardware interface allows the system software to control its oeration. w Internals which is imlementation secific. Registers: Status Command Data interface Micro-controller(CPU) Memory (DRAM or SRAM or both) Other Hardware-secific Chis Internals (HW+SW) Canonical Device AOS@UC 5

6 Hardware interface of Canonical Device status register w See the current status of the device command register w Tell the device to erform a certain task data register w Pass data to the device, or get data from the device By reading and writing above three registers, the oerating system can control device behavior. AOS@UC 6

7 Hardware interface of Canonical Device (Cont.) Tyical interaction examle (Programmed I/O or PIO) while ( STATUS == BUSY) ; //wait until device is not busy write data to data register write command to command register Doing so starts the device and executes the command while ( STATUS == BUSY) ; //wait until device is done with your request AOS@UC 7

8 Polling Oerating system waits until the device is ready by reeatedly reading the status register. w Positive asect is simle and working. w However, it wastes CPU time just waiting for the device. Switching to another ready rocess is better utilizing the CPU. waiting IO 1 : task 1 P : olling CPU Disk Diagram of CPU utilization by olling AOS@UC 8

9 interruts Put the I/O request rocess to slee and context switch to another. When the device is finished, wake the rocess waiting for the I/O by interrut (via interrut handler or Interrut Service Routine ISR) w Positive asect is allow to CPU and the disk are roerly utilized. 1 : task 1 2 : task 2 CPU Disk Diagram of CPU utilization by interrut AOS@UC 9

10 Polling vs interruts However, interruts is not always the best solution w If, device erforms very quickly (for examle, at first oll the oeration is done), interrut will slow down the system. w Because context switch is exensive (switching to another rocess) If a device is fast à oll is best. If it is slow à interruts is better. Hybrid aroach w If oll too slow go to interruts Coalescing interruts AOS@UC 10

11 CPU is once again over-burdened CPU wastes a lot of time to coy the a large chunk of data from memory to the device. over-burdened 1 : task 1 2 : task 2 C : coy data from memory CPU C C C Disk Diagram of CPU utilization AOS@UC 11

12 DMA (Direct Memory Access) Coy data in memory by knowing where the data lives in memory, & how much data to coy Tell the DMA controller to do the hard-work When comleted, DMA raises an interrut, I/O begins on Disk. 1 : task 1 2 : task 2 C : coy data from memory CPU DMA C C C Disk Diagram of CPU utilization by DMA AOS@UC 12

13 Device interaction How the CPU communicates with the device? Aroaches w I/O instructions: a way for the OS to send data to secific device registers. Ex) in and out instructions on x86 Searate I/O and memory buses in early days w memory-maed I/O Device registers available as if they were memory locations. The OS load (to read) or store (to write) to the device instead of main memory. AOS@UC 13

14 Fitting Into The OS: The Device Driver How the OS interact with different secific interfaces? w Ex) We d like to build a file system that worked on to of SCSI disks, IDE disks, USB keychain drivers, and so on. Solution: Abstraction w Abstraction encasulate any secifics of device interaction. w Only the lowest level should be aware of the secifics: called Device driver AOS@UC 14

15 File system Abstraction File system secifics of which disk class it is using. w Ex) It issues block read and write request to the generic block layer. Alication user POSIX API [oen, read, write, close, etc] File System kernel Generic Block Interface [block read/write] Generic Block Layer Device Driver [SCSI, ATA, etc] Secific Block Interface [rotocol-secific read/write] The File System Stack AOS@UC 15

16 Problem of File system Abstraction If there is a device having many secial caabilities, these caabilities will go unused in the generic interface layer. w Ex) SCSI devices have a rich error reorting that are mostly unused in Linux because IDE/ATA had very limited caabilities Over 70% of OS code is found in device drivers. w Any device drivers are needed because you might lug it to your system. w They are rimary contributor to kernel crashes, making more bugs. w Device signing in current windows system has imroved its resiliency greatly AOS@UC 16

17 Case Study: A Simle IDE Disk Driver (xv6 uses QEMU IDE) Four tyes of register w Control, command block, status and error w Maed to I/O addresses w in and out I/O instruction Book code doesn't not match with current version AOS@UC 17

18 Control Register: Address 0x3F6 = 0x80 (0000 1RE0): R=reset, E=0 means "enable interrut Command Block Registers: Address 0x1F0 = Data Port Address 0x1F1 = Error Address 0x1F2 = Sector Count Address 0x1F3 = LBA low byte (Logical Block Address) Address 0x1F4 = LBA mid byte Address 0x1F5 = LBA hi byte Address 0x1F6 = 1B1D TOP4LBA: B=LBA, D=drive Address 0x1F7 = Command/status AOS@UC 18

19 Status Register (Address 0x1F7): BUSY READY FAULT SEEK DRQ CORR IDDEX ERROR Error Register (Address 0x1F1): (check when Status ERROR==1) BBK UNC MC IDNF MCR ABRT T0NF AMNF w w w w w w w w BBK = Bad Block UNC = Uncorrectable data error MC = Media Changed IDNF = ID mark Not Found MCR = Media Change Requested ABRT = Command aborted T0NF = Track 0 Not Found AMNF = Address Mark Not Found AOS@UC 19

20 Wait for drive to be ready. Read Status Register (0x1F7) until drive is not busy and READY. Write arameters to command registers. Write the sector count, logical block address (LBA) of the sectors to be accessed, and drive number (master=0x00 or slave=0x10, as IDE ermits just two drives) to command registers (0x1F2-0x1F6). Start the I/O. by issuing read/write to command register. Write READ WRITE command to command register (0x1F7). Data transfer (for writes): Wait until drive status is READY and DRQ (drive request for data); write data to data ort. Handle interruts. In the simlest case, handle an interrut for each sector transferred; more comlex aroaches allow batching and thus one final interrut when the entire transfer is comlete. Error handling. After each oeration, read the status register. If the ERROR bit is on, read the error register for details. 20

21 xv6: I/O buffer (node struct) struct buf { int flags; uint dev; uint sector; struct buf *rev; // LRU cache list struct buf *next; struct buf *qnext; // disk queue uchar data[512]; }; #define B_BUSY 0x1 // buffer is locked by some rocess #define B_VALID 0x2 // buffer has been read from disk #define B_DIRTY 0x4 // buffer needs to be written to disk AOS@UC 21

22 xv6 code: Queues request (if IDE not avail) or issue the req. void ide_rw(struct buf *b) { acquire(&ide_lock); for (struct buf ** = &ide_queue; *; =&(*)->qnext) ; // walk queue (beware 2 nd term) * = b; // add request to end if (ide_queue == b) // if q was emty (only has b) ide_start_request(b); // send req to disk while ((b->flags & (B_VALID B_DIRTY))!= B_VALID) slee(b, &ide_lock); // wait for comletion and rel. lock release(&ide_lock); } AOS@UC 22

23 xv6 code: intercedes with the driver static void ide_start_request(struct buf *b) { ide_wait_ready(); outb(0x3f6, 0); outb(0x1f2, 1); // generate interrut // how many sectors to read/write? outb(0x1f3, b->sector & 0xff); // LBA goes here... outb(0x1f4, (b->sector >> 8) & 0xff); //... and here outb(0x1f5, (b->sector >> 16) & 0xff); //... and here! outb(0x1f6, 0xe0 ((b->dev & 1)<<4) ((b->sector>>24) & 0x0f)); //M or S? if(b->flags & B_DIRTY){ outb(0x1f7, IDE_CMD_WRITE); outsl(0x1f0, b->data, 512/4); // this is a WRITE // transfer data too! } else { outb(0x1f7, IDE_CMD_READ); // this is a READ (no data) } } AOS@UC 23

24 xv6 code: just check the device is ready and not busy static int ide_wait_ready() { while (((int r = inb(0x1f7)) & IDE_BSY)!(r & IDE_DRDY)) ; // loo until drive isn t busy } Device should be initialized somewhere else (at boot) AOS@UC 24

25 xv6 code: interrut handler void ide_intr() { struct buf *b; acquire(&ide_lock); //take b as the first element in the ide_queue (not shown) if (!(b->flags & B_DIRTY) && ide_wait_ready(1) >= 0) insl(0x1f0, b->data, 512/4); // if READ: get data b->flags = B_VALID; b->flags &= B_DIRTY; wakeu(b); // wake waiting rocess (equivalent to signal) if ((ide_queue = b->qnext)!= 0) // start next request ide_start_request(ide_queue); // (if one exists) release(&ide_lock); } AOS@UC 25

26 Current xv6 code (kernel/ide.c) 26

27 27

28 Disclaimer: This lecture slide set has been used in AOS course at University of Cantabria by V.Puente. Was initially develoed for Oerating System course in Comuter Science Det. at Hanyang University. This lecture slide set is for OSTEP book written by Remzi and Andrea Araci-Dusseau (at University of Wisconsin) 28

Input/Output. q Principles of I/O hardware & software q Secondary storage q Next: File systems

Input/Output. q Principles of I/O hardware & software q Secondary storage q Next: File systems Input/Output q Principles of I/O hardware & software q Secondary storage q Next: File systems Operating systems and I/O Two key OS goals with respect to I/O Control I/O devices Provide a simple, easy-to-use,

More information

33. Event-based Concurrency

33. Event-based Concurrency 33. Event-based Concurrency Oerating System: Three Easy Pieces AOS@UC 1 Event-based Concurrency A different style of concurrent rogramming without threads w Used in GUI-based alications, some tyes of internet

More information

15. Address Translation

15. Address Translation 15. Address Translation Oerating System: Three Easy Pieces AOS@UC 1 Memory Virtualizing with Efficiency and Control Memory virtualizing takes a similar strategy known as limited direct execution(lde) for

More information

10. Multiprocessor Scheduling (Advanced)

10. Multiprocessor Scheduling (Advanced) 10. Multirocessor Scheduling (Advanced) Oerating System: Three Easy Pieces AOS@UC 1 Multirocessor Scheduling The rise of the multicore rocessor is the source of multirocessorscheduling roliferation. w

More information

6. Mechanism: Limited Direct Execution

6. Mechanism: Limited Direct Execution 6. Mechanism: Limited Direct Execution Oerating System: Three Easy Pieces AOS@UC 1 How to efficiently virtualize the CPU with control? The OS needs to share the hysical CPU by time sharing. Issue w Performance:

More information

42. Crash Consistency: FSCK and Journaling

42. Crash Consistency: FSCK and Journaling 42. Crash Consistency: FSCK and Journaling Oerating System: Three Easy Pieces AOS@UC 1 Crash Consistency AOS@UC 2 Crash Consistency Unlike most data structure, file system data structures must ersist w

More information

37. Hard Disk Drives. Operating System: Three Easy Pieces

37. Hard Disk Drives. Operating System: Three Easy Pieces 37. Hard Disk Drives Oerating System: Three Easy Pieces AOS@UC 1 Hard Disk Driver Hard disk driver have been the main form of ersistent data storage in comuter systems for decades ( and consequently file

More information

32. Common Concurrency Problems.

32. Common Concurrency Problems. 32. Common Concurrency Problems. Oerating System: Three Easy Pieces AOS@UC 1 Common Concurrency Problems More recent work focuses on studying other tyes of common concurrency bugs. w Take a brief look

More information

30. Condition Variables

30. Condition Variables 30. Condition Variables Oerating System: Three Easy Pieces AOS@UC 1 Condition Variables There are many cases where a thread wishes to check whether a condition is true before continuing its execution.

More information

2. Introduction to Operating Systems

2. Introduction to Operating Systems 2. Introduction to Oerating Systems Oerating System: Three Easy Pieces 1 What a haens when a rogram runs? A running rogram executes instructions. 1. The rocessor fetches an instruction from memory. 2.

More information

20. Paging: Smaller Tables

20. Paging: Smaller Tables 20. Paging: Smaller Tables Oerating System: Three Easy Pieces AOS@UC 1 Paging: Linear Tables We usually have one age table for every rocess in the system. w Assume that 32-bit address sace with 4KB ages

More information

22. Swaping: Policies

22. Swaping: Policies 22. Swaing: Policies Oerating System: Three Easy Pieces 1 Beyond Physical Memory: Policies Memory ressure forces the OS to start aging out ages to make room for actively-used ages. Deciding which age to

More information

28. Locks. Operating System: Three Easy Pieces

28. Locks. Operating System: Three Easy Pieces 28. Locks Oerating System: Three Easy Pieces AOS@UC 1 Locks: The Basic Idea Ensure that any critical section executes as if it were a single atomic instruction. w An examle: the canonical udate of a shared

More information

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

I/O Devices. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) I/O Devices Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) Hardware Support for I/O CPU RAM Network Card Graphics Card Memory Bus General I/O Bus (e.g., PCI) Canonical Device OS reads/writes

More information

43. Log-structured File Systems

43. Log-structured File Systems 43. Log-structured File Systems Oerating System: Three Easy Pieces AOS@UC 1 LFS: Log-structured File System Proosed by Stanford back in 91 Motivated by: w DRAM Memory sizes where growing. w Large ga between

More information

14. Memory API. Operating System: Three Easy Pieces

14. Memory API. Operating System: Three Easy Pieces 14. Memory API Oerating System: Three Easy Pieces 1 Memory API: malloc() #include void* malloc(size_t size) Allocate a memory region on the hea. w Argument size_t size : size of the memory block(in

More information

4. The Abstraction: The Process

4. The Abstraction: The Process 4. The Abstraction: The Process Operating System: Three Easy Pieces AOS@UC 1 How to provide the illusion of many CPUs? p CPU virtualizing w The OS can promote the illusion that many virtual CPUs exist.

More information

10 File System Mass Storage Structure Mass Storage Systems Mass Storage Structure Mass Storage Structure FILE SYSTEM 1

10 File System Mass Storage Structure Mass Storage Systems Mass Storage Structure Mass Storage Structure FILE SYSTEM 1 10 File System 1 We will examine this chater in three subtitles: Mass Storage Systems OERATING SYSTEMS FILE SYSTEM 1 File System Interface File System Imlementation 10.1.1 Mass Storage Structure 3 2 10.1

More information

39. File and Directories

39. File and Directories 39. File and Directories Oerating System: Three Easy Pieces AOS@UC 1 Persistent Storage Kee a data intact even if there is a ower loss. w Hard disk drive w Solid-state storage device Two key abstractions

More information

Chapter 6. Buffer cache. Code: Data structures

Chapter 6. Buffer cache. Code: Data structures DRAFT as of October 16, 2009: Copyright 2009 Cox, Kaashoek, Morris Chapter 6 Buffer cache One of an operating system s central roles is to enable safe cooperation between processes sharing a computer.

More information

Control plane and data plane. Computing systems now. Glacial process of innovation made worse by standards process. Computing systems once upon a time

Control plane and data plane. Computing systems now. Glacial process of innovation made worse by standards process. Computing systems once upon a time Classical work Architecture A A A Intro to SDN A A Oerating A Secialized Packet A A Oerating Secialized Packet A A A Oerating A Secialized Packet A A Oerating A Secialized Packet Oerating Secialized Packet

More information

Shuigeng Zhou. May 18, 2016 School of Computer Science Fudan University

Shuigeng Zhou. May 18, 2016 School of Computer Science Fudan University Query Processing Shuigeng Zhou May 18, 2016 School of Comuter Science Fudan University Overview Outline Measures of Query Cost Selection Oeration Sorting Join Oeration Other Oerations Evaluation of Exressions

More information

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

[537] I/O Devices/Disks. Tyler Harter [537] I/O Devices/Disks Tyler Harter I/O Devices Motivation What good is a computer without any I/O devices? - keyboard, display, disks! We want: - H/W that will let us plug in different devices - OS that

More information

Optimizing Dynamic Memory Management!

Optimizing Dynamic Memory Management! Otimizing Dynamic Memory Management! 1 Goals of this Lecture! Hel you learn about:" Details of K&R hea mgr" Hea mgr otimizations related to Assignment #6" Faster free() via doubly-linked list, redundant

More information

CS3210: File Systems Tim Andersen

CS3210: File Systems Tim Andersen CS3210: File Systems Tim Andersen 1 / 35 Lecture plan: File systems API -> disk layout dumpfs Buffer cache xv6 in action - code walk 2 / 35 Storage trend 3 / 35 Do SSDs solve the problem? http://www.makeuseof.com/tag/ram-drives-faster-ssds-5-things-mustknow/

More information

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

Input / Output. Kevin Webb Swarthmore College April 12, 2018 Input / Output Kevin Webb Swarthmore College April 12, 2018 xkcd #927 Fortunately, the charging one has been solved now that we've all standardized on mini-usb. Or is it micro-usb? Today s Goals Characterize

More information

1.5 Case Study. dynamic connectivity quick find quick union improvements applications

1.5 Case Study. dynamic connectivity quick find quick union improvements applications . Case Study dynamic connectivity quick find quick union imrovements alications Subtext of today s lecture (and this course) Stes to develoing a usable algorithm. Model the roblem. Find an algorithm to

More information

IEEE High Performance Serial Bus

IEEE High Performance Serial Bus IEEE 1394-1995 High Performance Serial Bus Michael D. Johas Teener Editor, P1394 Working Grou Plumbing Architect, Ale Comuter, Inc. One Infinite Loo, MS 35-OEM Cuertino, CA 95014 teener@ale.com Background

More information

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14 CS 134 Operating Systems April 8, 2013 Lecture 20 Input/Output Instructor: Neil Rhodes Hardware How hardware works Operating system layer What the kernel does API What the programmer does Overview 2 kinds

More information

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

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017 CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Review: Memory Accesses 2 Impact of Program Structure on Memory Performance o Consider an array named data with 128*128 elements o Each

More information

I/O Management Software. Chapter 5

I/O Management Software. Chapter 5 I/O Management Software Chapter 5 1 Learning Outcomes An understanding of the structure of I/O related software, including interrupt handers. An appreciation of the issues surrounding long running interrupt

More information

I/O Devices & SSD. Dongkun Shin, SKKU

I/O Devices & SSD. Dongkun Shin, SKKU I/O Devices & SSD 1 System Architecture Hierarchical approach Memory bus CPU and memory Fastest I/O bus e.g., PCI Graphics and higherperformance I/O devices Peripheral bus SCSI, SATA, or USB Connect many

More information

COSC 243. Input / Output. Lecture 13 Input/Output. COSC 243 (Computer Architecture)

COSC 243. Input / Output. Lecture 13 Input/Output. COSC 243 (Computer Architecture) COSC 243 Input / Output 1 Introduction This Lecture Source: Chapter 7 (10 th edition) Next Lecture (until end of semester) Zhiyi Huang on Operating Systems 2 Memory RAM Random Access Memory Read / write

More information

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture 168 420 Computer Architecture Chapter 6 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats All slower than CPU

More information

I/O Systems. Jo, Heeseung

I/O Systems. Jo, Heeseung I/O Systems Jo, Heeseung Today's Topics Device characteristics Block device vs. Character device Direct I/O vs. Memory-mapped I/O Polling vs. Interrupts Programmed I/O vs. DMA Blocking vs. Non-blocking

More information

A Study of Protocols for Low-Latency Video Transport over the Internet

A Study of Protocols for Low-Latency Video Transport over the Internet A Study of Protocols for Low-Latency Video Transort over the Internet Ciro A. Noronha, Ph.D. Cobalt Digital Santa Clara, CA ciro.noronha@cobaltdigital.com Juliana W. Noronha University of California, Davis

More information

The Device Driver Interface. Input/Output Devices. System Call Interface. Device Management Organization

The Device Driver Interface. Input/Output Devices. System Call Interface. Device Management Organization Input/Output s Slide 5-1 The Driver Interface Slide 5-2 write(); Interface Output Terminal Terminal Printer Printer Disk Disk Input or Terminal Terminal Printer Printer Disk Disk Management Organization

More information

Organisasi Sistem Komputer

Organisasi Sistem Komputer LOGO Organisasi Sistem Komputer OSK 5 Input Output 1 1 PT. Elektronika FT UNY Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In different formats

More information

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

Hard Disk Drives (HDDs) Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Hard Disk Drives (HDDs) Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Virtualization Virtual CPUs Virtual memory Concurrency Threads Synchronization

More information

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices.

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices. Input - Output Input-Output (I/O) operating system must control all I/O devices issue commands to devices catch interrupts handle errors provide interface between devices and rest of system main categories

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. How does a processor interact

More information

Hard Disk Drives (HDDs)

Hard Disk Drives (HDDs) Hard Disk Drives (HDDs) Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu EEE3052: Introduction to Operating Systems, Fall 2017, Jinkyu Jeong (jinkyu@skku.edu)

More information

Today: I/O Systems. Architecture of I/O Systems

Today: I/O Systems. Architecture of I/O Systems Today: I/O Systems How does I/O hardware influence the OS? What I/O services does the OS provide? How does the OS implement those services? How can the OS improve the performance of I/O? Lecture 20, page

More information

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

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13 I/O Handling ECE 650 Systems Programming & Engineering Duke University, Spring 2018 Based on Operating Systems Concepts, Silberschatz Chapter 13 Input/Output (I/O) Typical application flow consists of

More information

Recap: Consensus. CSE 486/586 Distributed Systems Mutual Exclusion. Why Mutual Exclusion? Why Mutual Exclusion? Mutexes. Mutual Exclusion C 1

Recap: Consensus. CSE 486/586 Distributed Systems Mutual Exclusion. Why Mutual Exclusion? Why Mutual Exclusion? Mutexes. Mutual Exclusion C 1 Reca: Consensus Distributed Systems Mutual Exclusion Steve Ko Comuter Sciences and Engineering University at Buffalo On a synchronous system There s an algorithm that works. On an asynchronous system It

More information

Storage. Hwansoo Han

Storage. Hwansoo Han Storage Hwansoo Han I/O Devices I/O devices can be characterized by Behavior: input, out, storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections 2 I/O System Characteristics

More information

The control of I/O devices is a major concern for OS designers

The control of I/O devices is a major concern for OS designers Lecture Overview I/O devices I/O hardware Interrupts Direct memory access Device dimensions Device drivers Kernel I/O subsystem Operating Systems - June 26, 2001 I/O Device Issues The control of I/O devices

More information

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

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara Operating Systems Christopher Kruegel Department of Computer Science http://www.cs.ucsb.edu/~chris/ Input and Output Input/Output Devices The OS is responsible for managing I/O devices Issue requests Manage

More information

Introduction I/O 1. I/O devices can be characterized by Behavior: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec

Introduction I/O 1. I/O devices can be characterized by Behavior: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec Introduction I/O 1 I/O devices can be characterized by Behavior: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections I/O Device Summary I/O 2 I/O System

More information

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

CPSC 213. Introduction to Computer Systems. I/O Devices, Interrupts and DMA. Unit 2a Oct 27, 29, 31. Winter Session 2014, Term 1 CPSC 213 Introduction to Computer Systems Winter Session 2014, Term 1 Unit 2a Oct 27, 29, 31 I/O Devices, Interrupts and DMA Overview Reading in Text 8.1, 8.2.1, 8.5.1-8.5.3 Learning Goals Explain what

More information

I/O Management Software. Chapter 5

I/O Management Software. Chapter 5 I/O Management Software Chapter 5 1 Learning Outcomes An understanding of the structure of I/O related software, including interrupt handers. An appreciation of the issues surrounding long running interrupt

More information

OPERATING SYSTEMS CS136

OPERATING SYSTEMS CS136 OPERATING SYSTEMS CS136 Jialiang LU Jialiang.lu@sjtu.edu.cn Based on Lecture Notes of Tanenbaum, Modern Operating Systems 3 e, 1 Chapter 5 INPUT/OUTPUT 2 Overview o OS controls I/O devices => o Issue commands,

More information

A GPU Heterogeneous Cluster Scheduling Model for Preventing Temperature Heat Island

A GPU Heterogeneous Cluster Scheduling Model for Preventing Temperature Heat Island A GPU Heterogeneous Cluster Scheduling Model for Preventing Temerature Heat Island Yun-Peng CAO 1,2,a and Hai-Feng WANG 1,2 1 School of Information Science and Engineering, Linyi University, Linyi Shandong,

More information

An Indexing Framework for Structured P2P Systems

An Indexing Framework for Structured P2P Systems An Indexing Framework for Structured P2P Systems Adina Crainiceanu Prakash Linga Ashwin Machanavajjhala Johannes Gehrke Carl Lagoze Jayavel Shanmugasundaram Deartment of Comuter Science, Cornell University

More information

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

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter , Lecture Topics Today: Computer System Overview (Stallings, chapter 1.1-1.8) Next: Operating System Overview (Stallings, chapter 2.1-2.4, 2.8-2.10) 1 Announcements Syllabus and calendar available Consulting

More information

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

Computer Organization ECE514. Chapter 5 Input/Output (9hrs) Computer Organization ECE514 Chapter 5 Input/Output (9hrs) Learning Outcomes Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge

More information

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

QUIZ Ch.6. The EAT for a two-level memory is given by: QUIZ Ch.6 The EAT for a two-level memory is given by: EAT = H Access C + (1-H) Access MM. Derive a similar formula for three-level memory: L1, L2 and RAM. Hint: Instead of H, we now have H 1 and H 2. Source:

More information

InnoDisk FiD 2.5 SATA20000-H

InnoDisk FiD 2.5 SATA20000-H InnoDisk FiD 2.5 SATA20000-H SLC Solution Datasheet Rev 0.3 1 Rev 0.3 Datasheet, February. 2010 Table of contents REVISION HISTORY... 4 LIST OF TABLES... 5 LIST OF FIGURES... 7 1. PRODUCT OVERVIEW... 8

More information

Object and Native Code Thread Mobility Among Heterogeneous Computers

Object and Native Code Thread Mobility Among Heterogeneous Computers Object and Native Code Thread Mobility Among Heterogeneous Comuters Bjarne Steensgaard Eric Jul Microsoft Research DIKU (Det. of Comuter Science) One Microsoft Way University of Coenhagen Redmond, WA 98052

More information

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

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture 1 Last class: Course administration OS definition, some history Today: Background on Computer Architecture 2 Canonical System Hardware CPU: Processor to perform computations Memory: Programs and data I/O

More information

Storage Allocation CSE 143. Pointers, Arrays, and Dynamic Storage Allocation. Pointer Variables. Pointers: Review. Pointers and Types

Storage Allocation CSE 143. Pointers, Arrays, and Dynamic Storage Allocation. Pointer Variables. Pointers: Review. Pointers and Types CSE 143 Pointers, Arrays, and Dynamic Storage Allocation [Chater 4,. 148-157, 172-177] Storage Allocation Storage (memory) is a linear array of cells (bytes) Objects of different tyes often reuire differing

More information

I/O. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 6.5-6

I/O. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter 6.5-6 I/O Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University See: P&H Chapter 6.5-6 Computer System = Input + Output + Memory + Datapath + Control Video Network Keyboard USB Computer System

More information

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

Secondary storage. CS 537 Lecture 11 Secondary Storage. Disk trends. Another trip down memory lane Secondary storage CS 537 Lecture 11 Secondary Storage Michael Swift Secondary storage typically: is anything that is outside of primary memory does not permit direct execution of instructions or data retrieval

More information

EE108B Lecture 17 I/O Buses and Interfacing to CPU. Christos Kozyrakis Stanford University

EE108B Lecture 17 I/O Buses and Interfacing to CPU. Christos Kozyrakis Stanford University EE108B Lecture 17 I/O Buses and Interfacing to CPU Christos Kozyrakis Stanford University http://eeclass.stanford.edu/ee108b 1 Announcements Remaining deliverables PA2.2. today HW4 on 3/13 Lab4 on 3/19

More information

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 13 Virtual memory and memory management unit In the last class, we had discussed

More information

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals William Stallings Computer Organization and Architecture 7 th Edition Chapter 7 Input/Output Input/Output Problems Wide variety of peripherals Delivering different amounts of data At different speeds In

More information

ECEN 449 Microprocessor System Design. Hardware-Software Communication. Texas A&M University

ECEN 449 Microprocessor System Design. Hardware-Software Communication. Texas A&M University ECEN 449 Microprocessor System Design Hardware-Software Communication 1 Objectives of this Lecture Unit Learn basics of Hardware-Software communication Memory Mapped I/O Polling/Interrupts 2 Motivation

More information

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

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2. BASIC ELEMENTS Simplified view: Processor Slide 1 Computer System Overview Operating Systems Slide 3 Main Memory referred to as real memory or primary memory volatile modules 2004/S2 secondary memory devices

More information

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

CSE 120. Overview. July 27, Day 8 Input/Output. Instructor: Neil Rhodes. Hardware. Hardware. Hardware CSE 120 July 27, 2006 Day 8 Input/Output Instructor: Neil Rhodes How hardware works Operating Systems Layer What the kernel does API What the programmer does Overview 2 Kinds Block devices: read/write

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides were originally created by Deniz ALTINBUKEN. P&H Chapter 4.9, pages 445 452, appendix A.7 Manages all of the software and hardware on the

More information

CS 4284 Systems Capstone

CS 4284 Systems Capstone CS 4284 Systems Capstone Disks & File Systems Godmar Back Disks & Filesystems Disk Schematics Source: Micro House PC Hardware Library Volume I: Hard Drives 3 Tracks, Sectors, Cylinders 4 Hard Disk Example

More information

Equality-Based Translation Validator for LLVM

Equality-Based Translation Validator for LLVM Equality-Based Translation Validator for LLVM Michael Ste, Ross Tate, and Sorin Lerner University of California, San Diego {mste,rtate,lerner@cs.ucsd.edu Abstract. We udated our Peggy tool, reviously resented

More information

Argo Programming Guide

Argo Programming Guide Argo Programming Guide Evangelia Kasaaki, asmus Bo Sørensen February 9, 2015 Coyright 2014 Technical University of Denmark This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International

More information

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device) Devices -Host -CPU -Device -Controller device) +memory +OS -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, Communication -Registers -Control

More information

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18

we are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18 I/O & Storage Layers CS162 Operating Systems and Systems Programming Lecture 18 Systems April 2 nd, 2018 Profs. Anthony D. Joseph & Jonathan Ragan-Kelley http://cs162.eecs.berkeley.edu Application / Service

More information

Operating Systems. V. Input / Output

Operating Systems. V. Input / Output Operating Systems V. Input / Output Ludovic Apvrille ludovic.apvrille@telecom-paristech.fr Eurecom, office 470 http://soc.eurecom.fr/os/ @OS Eurecom Devices of a Computer System Applications OS CPU Memory

More information

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand Device Programming Nima Honarmand read/write interrupt read/write Spring 2017 :: CSE 506 Device Interface (Logical View) Device Interface Components: Device registers Device Memory DMA buffers Interrupt

More information

John Wawrzynek & Nick Weaver

John Wawrzynek & Nick Weaver CS 61C: Great Ideas in Computer Architecture Lecture 23: Virtual Memory John Wawrzynek & Nick Weaver http://inst.eecs.berkeley.edu/~cs61c From Previous Lecture: Operating Systems Input / output (I/O) Memory

More information

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

Computer Organization and Structure. Bing-Yu Chen National Taiwan University Computer Organization and Structure Bing-Yu Chen National Taiwan University Storage and Other I/O Topics I/O Performance Measures Types and Characteristics of I/O Devices Buses Interfacing I/O Devices

More information

Chapter 5 - Input / Output

Chapter 5 - Input / Output Chapter 5 - Input / Output Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 5 - Input / Output 1 / 90 1 Motivation 2 Principle of I/O Hardware I/O Devices Device Controllers Memory-Mapped

More information

Operating Systems 2010/2011

Operating Systems 2010/2011 Operating Systems 2010/2011 Input/Output Systems part 1 (ch13) Shudong Chen 1 Objectives Discuss the principles of I/O hardware and its complexity Explore the structure of an operating system s I/O subsystem

More information

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O

we are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O CS162 Operating Systems and Systems Programming Lecture 18 Systems October 30 th, 2017 Prof. Anthony D. Joseph http://cs162.eecs.berkeley.edu Recall: How do we Hide I/O Latency? Blocking Interface: Wait

More information

Operating System Design Issues. I/O Management

Operating System Design Issues. I/O Management I/O Management Chapter 5 Operating System Design Issues Efficiency Most I/O devices slow compared to main memory (and the CPU) Use of multiprogramming allows for some processes to be waiting on I/O while

More information

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs Third Generation Batch Multiprogramming Misc. Problem: but I/O still expensive; can happen in middle of job Idea: have a pool of ready jobs in memory, switch to one when another needs I/O When one job

More information

Lecture 9: File System. topic: file systems what they are how the xv6 file system works intro to larger topics

Lecture 9: File System. topic: file systems what they are how the xv6 file system works intro to larger topics 6.828 2011 Lecture 9: File System topic: file systems what they are how the xv6 file system works intro to larger topics FS goals? durable storage multiplexing sharing organization why are file systems

More information

Graph: composable production systems in Clojure. Jason Wolfe Strange Loop 12

Graph: composable production systems in Clojure. Jason Wolfe Strange Loop 12 Grah: comosable roduction systems in Clojure Jason Wolfe (@w01fe) Strange Loo 12 Motivation Interesting software has: many comonents comlex web of deendencies Develoers want: simle, factored code easy

More information

CSC 2405: Computer Systems II

CSC 2405: Computer Systems II CSC 2405: Computer Systems II Dr. Mirela Damian http://www.csc.villanova.edu/~mdamian/csc2405/ Spring 2016 Course Goals: Look under the hood Help you learn what happens under the hood of computer systems

More information

Scuola Superiore Sant Anna. I/O subsystem. Giuseppe Lipari

Scuola Superiore Sant Anna. I/O subsystem. Giuseppe Lipari Scuola Superiore Sant Anna I/O subsystem Giuseppe Lipari Input Output and Device Drivers ERI Gennaio 2008 2 Objectives of the I/O subsystem To hide the complexity From the variability of the devices Provide

More information

has been retired This version of the software Sage Timberline Office Get Started Document Management 9.8 NOTICE

has been retired This version of the software Sage Timberline Office Get Started Document Management 9.8 NOTICE This version of the software has been retired Sage Timberline Office Get Started Document Management 9.8 NOTICE This document and the Sage Timberline Office software may be used only in accordance with

More information

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

Comp 204: Computer Systems and Their Implementation. Lecture 18: Devices Comp 204: Computer Systems and Their Implementation Lecture 18: Devices 1 Today Devices Introduction Handling I/O Device handling Buffering and caching 2 Operating System An Abstract View User Command

More information

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) I/O Fall 2011 Tore Larsen Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) Big Picture Today we talk about I/O characteristics interconnection devices & controllers (disks

More information

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) I/O Fall 2010 Tore Larsen Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum) Big Picture Today we talk about I/O characteristics interconnection devices & controllers (disks

More information

AUTOMATIC GENERATION OF HIGH THROUGHPUT ENERGY EFFICIENT STREAMING ARCHITECTURES FOR ARBITRARY FIXED PERMUTATIONS. Ren Chen and Viktor K.

AUTOMATIC GENERATION OF HIGH THROUGHPUT ENERGY EFFICIENT STREAMING ARCHITECTURES FOR ARBITRARY FIXED PERMUTATIONS. Ren Chen and Viktor K. inuts er clock cycle Streaming ermutation oututs er clock cycle AUTOMATIC GENERATION OF HIGH THROUGHPUT ENERGY EFFICIENT STREAMING ARCHITECTURES FOR ARBITRARY FIXED PERMUTATIONS Ren Chen and Viktor K.

More information

CSE 333 Lecture 9 - storage

CSE 333 Lecture 9 - storage CSE 333 Lecture 9 - storage Steve Gribble Department of Computer Science & Engineering University of Washington Administrivia Colin s away this week - Aryan will be covering his office hours (check the

More information

UML for Global Computing Lecture 3: Property-Driven Development

UML for Global Computing Lecture 3: Property-Driven Development Contents UML for Global Comuting Lecture 3: Proerty-Driven Develoment Martin Wirsing LMU München in cooeration with Hubert Baumeister Lecture : Introducing UML for Mobility Lecture 2: Refining Mobility

More information

Figure 8.1: Home age taken from the examle health education site (htt:// Setember 14, 2001). 201

Figure 8.1: Home age taken from the examle health education site (htt://  Setember 14, 2001). 201 200 Chater 8 Alying the Web Interface Profiles: Examle Web Site Assessment 8.1 Introduction This chater describes the use of the rofiles develoed in Chater 6 to assess and imrove the quality of an examle

More information

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

Hard Disk Drives. Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) Hard Disk Drives Nima Honarmand (Based on slides by Prof. Andrea Arpaci-Dusseau) Storage Stack in the OS Application Virtual file system Concrete file system Generic block layer Driver Disk drive Build

More information

Chapter 6. Storage and Other I/O Topics

Chapter 6. Storage and Other I/O Topics Chapter 6 Storage and Other I/O Topics Introduction I/O devices can be characterized by Behaviour: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections

More information

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory. Operating System Concepts Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

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

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester Operating System: Chap13 I/O Systems National Tsing-Hua University 2016, Fall Semester Outline Overview I/O Hardware I/O Methods Kernel I/O Subsystem Performance Application Interface Operating System

More information