Direct Memory Access Disk and Network transfers: awkward timing:

Slides:



Advertisements
Similar presentations
Lecture Objectives: 1)Explain the limitations of flash memory. 2)Define wear leveling. 3)Define the term IO Transaction 4)Define the terms synchronous.
Advertisements

Input-output and Communication Prof. Sin-Min Lee Department of Computer Science.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
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)
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.
Computer System Organization S H Srinivasan
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Copyright ©: Nahrstedt, Angrave, Abdelzaher
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
I/O Systems I/O Hardware Application I/O Interface
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.
I/O management is a major component of operating system design and operation Important aspect of computer operation I/O devices vary greatly Various methods.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Input/Output (I/O) Important OS function – control I/O
Input / Output Chapter 9.
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.
Interrupts and exceptions
CS501 Advanced Computer Architecture
Operating Systems CMPSC 473
Day 08 Processes.
Day 09 Processes.
CS 3305 System Calls Lecture 7.
I/O system.
CS 286 Computer Organization and Architecture
CS703 - Advanced Operating Systems
Computer Architecture
CSCI 315 Operating Systems Design
Computer System Overview
Computer-System Architecture
Module 2: Computer-System Structures
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Architectural Support for OS
Computer Organization
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
Module 2: Computer-System Structures
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Computer System Overview
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Direct Memory Access Disk and Network transfers: awkward timing: Latency: milliseconds Transfer rate: megabytes per second Too fast for interrupts Too slow for polling (cope with latency?) 5 December 2018 CS2051 Lecture 8

DMA Interface Memory CPU DMA controller DMA Cycle Steal CPU: Disk Address Memory Address Count Command Status Memory DMA Cycle Steal CPU: fetch instruction decode fetch operand operate CPU 5 December 2018 CS2051 Lecture 8

Example: DMA Transfer from disk Process (running) … fread(…) /* will free CPU? */ //(non-blocking I/O?) Device Driver told to transfer data from disk to memory buffer CPU (running other processes) … ISR Disk Controller Initiates transfer Sends bytes to DMA controller DMA Controller Transfers bytes to memory buffer When completed, interrupts the CPU Interrupt 5 December 2018 CS2051 Lecture 8

Memory Mapped I/O Interface may appear as memory location e.g. write to disk interface control register initiates transfer e.g. write pixels to frame buffer - changes appearance of screen NB: protection issues 5 December 2018 CS2051 Lecture 8

Timers Usually generate interrupts for: Time of Day (real clock chip?) time slice for fair use of CPU alarm clock service for applications monitoring/profiling Application OS Network & Device timeouts Typically 50-1000 interrupts per sec 5 December 2018 CS2051 Lecture 8

Exceptions e.g. Division by zero Odd address accessed Invalid memory address used Undefined instruction executed Similar to interrupts (save PC/PSR; set PRIV, goto handler) via vector table Synchronous to current running program 5 December 2018 CS2051 Lecture 8

How does Application enter OS? (user mode vs system mode) e.g. application wishes to delete file, or send network packet Why not by procedure call instruction? Use Trap or Software Interrupt instruction, causing exception Pass parameters? 5 December 2018 CS2051 Lecture 8

Summary Reading: Bacon 3.2, 3.3 (3.2.7 for information only) DMA: saves CPU time by controlling data transfer between I/O device and memory. Memory mapped I/O used to transfer data to and from a device (registers included) by allocating physical memory addresses to device interfaces. Interrupt mechanisms are used to handle a variety of exceptions “(with interrupts) the processor doesn’t waste its time looking for work: when there is something to be done, the work comes looking for the processor” Reading: Bacon 3.2, 3.3 (3.2.7 for information only) 5 December 2018 CS2051 Lecture 8