I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.

Slides:



Advertisements
Similar presentations
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Advertisements

I/O Systems Operating System Concepts chapter 13 CS 355
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
04/14/2008CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
04/16/2010CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying an earlier edition.
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
I/O Systems CS 3100 I/O Hardware1. I/O Hardware Incredible variety of I/O devices Common concepts ◦Port ◦Bus (daisy chain or shared direct access) ◦Controller.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
CHAPTER 13: I/O SYSTEMS Overview Overview I/O Hardware I/O Hardware I/O API I/O API I/O Subsystem I/O Subsystem Transforming I/O Requests to Hardware Operations.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-2: I/O Management (Review) Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 AE4B33OSS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O.
I/O Systems I/O Hardware Application I/O Interface
2.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 2: Computer-System Structures Computer System Operation I/O Structure.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
1 Comp 104: Operating Systems Concepts Devices. 2 Today Devices –Introduction –Handling I/O Device handling Buffering and caching.
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2 Computer-System Structures n Computer System Operation n I/O Structure.
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.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Chapter 13: I/O Systems. 13.2/34 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 13: I/O Systems I/O Hardware Application I/O Interface.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
Silberschatz, Galvin and Gagne  Operating System Concepts Six Step Process to Perform DMA Transfer.
XE33OSA Chapter 13: I/O Systems. 13.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel.
CENG334 Introduction to Operating Systems Erol Sahin Dept of Computer Eng. Middle East Technical University Ankara, TURKEY URL:
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 Chapter 13: I/O Systems I/O Hardware.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems.
Computer Studies (AL) I/O Management. Reference Silberschatz, Galvin, Gagne “Operating System Concepts 6 th edition”, 2003, Wiley Stallings, “Operating.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 2, 2005 I/O through system calls Protection.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
CMSC 421 Section 0202 I/O Systems Chapter 13: I/O Systems.
I/O Software CS 537 – Introduction to Operating Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Processes and threads.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

I/O Systems ◦ Operating Systems ◦ CS550

Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read Sections  We may not have time to go over them, but there might be a question about NFS on the final.

Blocking & Non-Blocking I/O Blocking - system call suspends application and moves application to wait queue to wait for system call to complete. Simple and easy to understand. Non-blocking I/O - example - receive keyboard and mouse input while processing and displaying data on screen. Provided by some operating systems. -Does not stop application from running for a long period of time. - Different from MPI non-blocking operations

Asynchronous system calls Asynchronous system calls are another means of providing this Returns without waiting for I/O to finish I/O completed by setting a variable, triggering a signal or causing a SW interrupt Difference from non-blocking I/O is that nonblocking returns whatever data is available and asynchronous requests that I/O be completed at a later time. Often used in modern operating systems Ex: disk and network I/O Both buffer I/O and return to the application. Buffers must be flushed, though OS usually has a time limit on how long data can stay in the buffer OS must also maintain data consistency

Example: o "select" system call for TCP/IP sockets o checks if network I/O is possible by using a wait time of zero as a parameter This is a non-blocking operation o "read()" or "write()" must be used to perform data transfer after calling "select()". These could be blocking, non- blocking, or asynchronous.

Vectored I/O  Allow one system call to perform multiple I/O ops in many locations implemented via "readv" system call, also called "scatter-gather" methods  read accepts a vector of many buffers and is able to read from all at once or write to all at once, sometimes as an atomic operation.  Can occur using vector fields on CPU or via system calls or within libraries (MPI).  Can improve read/write speeds

Kernel I/O Kernel provides I/O scheduling, buffering, spooling, reservation of devices, and error checks Scheduling has been previously discussed (disk I/O methods like SSTF, Elevator, etc.) A device status table is used by the kernel to assist with this scheduling We will discuss many of the other topics with respect to kernel I/O

I/O Buffers 1.Buffer - stores data being transferred between two devices 2.Done for 3 reasons 3.Speed mismatch between producer and consumer 4.Adapt for device with different transfer sizes 5.To support copy semantics - guarantee of data consistency between devices I/O Caching 1.Cache - fast memory to hold copies of data 2.Difference between caches and buffers - cache holds a copy of data on a fast storage device whereas buffer may hold the only existing copy of data. 3.Sometimes memory may be used for both caching and buffering

Spooling Spool - a buffer that holds output for a device like a printer OS takes all data for a device like a printer and holds it in a spool (e.g. a file) Once device finishes its job, OS gets next item from the spool and sends it to the device Could limit devices to only have one open spool file, if they cannot multiplex jobs

OS must protect against HW and application errors when said HW/app fails OS can compensate sometimes Ex: on failed "read()" retry "read()" or on failed "send()" issue "resend()" System calls typically return an error bit UNIX/Linux calls return "errno" which may be one of several hundred error codes Some HW such as SCSI (pronounced "scuzzy") may provide very detailed information such as a "sense-key" detailing the nature of the error, an "additional sense code" giving the failure category, and even an "additional sense code qualifier" with more details. These details may be provided in an error log by the OS Error Handling

I/O Protection Require all I/O ops to be privileged instructions This will prevent user processes from disrupting the OS Protect memory-mapped and I/O memory port locations from user access, too Kernel must provide a locking mechanism to allow only protected access to these features

Kernel Data Structures Linux makes use of a file descriptor that points to a "per-process open-file table" This is contained within user-process memory Within this table there are pointers to file-system records within the kernel memory Kernel memory contains: System-wide open-file table File-system records iNode pointer pointers to r/w functions, select, ioctl, and close Network/socket records Pointer to network information Pointer to r/w functions Pointers to select, ioctl, and close iNodes are file control blocks in linux - these contain ownership, permissions, and location data for files

Performance I/O and Network traffic can cause high context switching rates Consider keyboard input provided over network. May wish to use "front end processors" for keyboard I/O and "I/O channel" cpus on servers to deal with processing of this input

Performance (Contd..) Offload this work from the main CPU and we do the following: -Reduce # of context switches -Reduce memory copying between device and application -Reduce interrupt frequency -Increase concurrency -Use hw commands for I/O processing -Have better balance of overall device performance, because more devices may become idle when others become loaded

Next Class: Protection - internal OS problem Mechanisms/Policies Principles - principle of least privilege Domains - hw objects and sw objects Access Matrix Global table Access Lists Capability Lists Access control Language Based Protection Security