COSC121: Computer Systems. Exceptions and Interrupts

Size: px
Start display at page:

Download "COSC121: Computer Systems. Exceptions and Interrupts"

Transcription

1 COSC121: Computer Systems. Exceptions and Interrupts Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer Organization and Design (4th) **A special thanks to Eric Roberts and Mary Jane Irwin

2 Read PH.4.9 and PH.6 Notes

3 Outline Interrupts Exceptions

4 This week our journey takes us COSC 121: Computer Systems Application (Browser) Operating System Compiler (Win, Linux) COSC 255: Operating Systems Software Hardware Assembler Processor Memory Drivers I/O system Instruction Set Architecture Datapath & Control Digital Design Circuit Design transistors COSC 120: Computer Hardware

5 Review: Major Components of a Computer Processor Devices Control Memory Output Datapath Input Important metrics for an I/O system Performance Expandability Dependability Cost, size, weight Security

6 A Typical I/O System Processor Interrupts Cache Memory - I/O Bus Main Memory I/O Controller I/O Controller I/O Controller Disk Disk Graphics Network

7 Input and Output Devices I/O devices are incredibly diverse with respect to Behavior input, output or storage Partner human or machine Data rate the peak rate at which data can be transferred between the I/O device and the main memory or processor Device Behavior Partner Data rate (Mb/s) Keyboard input human Mouse input human Laser printer output human Magnetic disk storage machine Graphics display output human Network/LAN input or output machine orders of magnitude range

8 I/O Performance Measures I/O bandwidth (throughput) amount of information that can be input (output) and communicated across an interconnect (e.g., a bus) to the processor/memory (I/O device) per unit time 1. How much data can we move through the system in a certain time? 2. How many I/O operations can we do per unit time? I/O response time (latency) the total elapsed time to accomplish an input or output operation An especially important performance metric in realtime systems Many applications require both high throughput and short response times

9 I/O System Interconnect Issues A bus is a shared communication link (a single set of wires used to connect multiple subsystems) that needs to support a range of devices with widely varying latencies and data transfer rates Advantages Versatile new devices can be added easily and can be moved between computer systems that use the same bus standard Low cost a single set of wires is shared in multiple ways Disadvantages Creates a communication bottleneck bus bandwidth limits the maximum I/O throughput The maximum bus speed is largely limited by The length of the bus The number of devices on the bus

10 Types of Buses Processor-memory bus ( Front Side Bus, proprietary) Short and high speed Matched to the memory system to maximize the memoryprocessor bandwidth Optimized for cache block transfers I/O bus (industry standard, e.g., SCSI, USB, Firewire) Usually is lengthy and slower Needs to accommodate a wide range of I/O devices Use either the processor-memory bus or a backplane bus to connect to memory Backplane bus (industry standard, e.g., PCIexpress) Used as an intermediary bus connecting I/O busses to the processor-memory bus

11 I/O Transactions An I/O transaction is a sequence of operations over the interconnect that includes a request and may include a response either of which may carry data. A transaction is initiated by a single request and may take many individual bus operations. An I/O transaction typically includes two parts 1. Sending the address 2. Receiving or sending the data Bus transactions are defined by what they do to memory output input A read transaction reads data from memory (to either the processor or an I/O device) A write transaction writes data to the memory (from either the processor or an I/O device)

12 Synchronous and Asynchronous Buses Synchronous bus (e.g., processor-memory buses) Includes a clock in the control lines and has a fixed protocol for communication that is relative to the clock Advantage: involves very little logic and can run very fast Disadvantages: Every device communicating on the bus must use same clock rate To avoid clock skew, they cannot be long if they are fast Asynchronous bus (e.g., I/O buses) It is not clocked, so requires a handshaking protocol and additional control lines (ReadReq, Ack, DataRdy) Advantages: Can accommodate a wide range of devices and device speeds Can be lengthened without worrying about clock skew or synchronization problems Disadvantage: slow(er)

13 Asynchronous Bus Handshaking Protocol Output (read) data from memory to an I/O device ReadReq Data 1 addr 2 3 data Ack 4 6 DataRdy 5 7 I/O device signals a request by raising ReadReq and putting the addr on the data lines 1. Memory sees ReadReq, reads addr from data lines, and raises Ack 2. I/O device sees Ack and releases the ReadReq and data lines 3. Memory sees ReadReq go low and drops Ack 4. When memory has data ready, it places it on data lines and raises DataRdy 5. I/O device sees DataRdy, reads the data from data lines, and raises Ack 6. Memory sees Ack, releases the data lines, and drops DataRdy 7. I/O device sees DataRdy go low and drops Ack

14 A Typical I/O System Intel Xeon 5300 processor Main memory DIMMs Disk Disk Keyboard, Mouse, FB DDR2 667 (5.3GB/sec) ESI (2GB/sec) Serial ATA (300MB/sec) LPC (1MB/sec) USB ports USB 2.0 (60MB/sec) Memory Controller Hub (north bridge) 5000P I/O Controller Hub (south bridge) Entreprise South Bridge 2 Intel Xeon 5300 processor Front Side Bus (1333MHz, 10.5GB/sec) PCIe 8x (2GB/sec) PCIe 4x (1GB/sec) PCIe 4x (1GB/sec) PCI-X bus (1GB/sec) PCI-X bus (1GB/sec) Parallel ATA (100MB/sec) CD/DVD

15 Example: The Pentium 4 s Buses 2 serial ATAs: 150 MB/s Memory Controller Hub ( Northbridge ) Graphics output: 2.0 GB/s Gbit ethernet: GB/s 2 parallel ATA: 100 MB/s System Bus ( Front Side Bus ): 64b x 800 MHz (6.4GB/s), 533 MHz, or 400 MHz DDR SDRAM Main Memory Hub Bus: 8b x 266 MHz PCI: 32b x 33 MHz 8 USBs: 60 MB/s I/O Controller Hub ( Southbridge )

16 Interfacing I/O Devices to the Processor, Memory, and OS The operating system acts as the interface between the I/O hardware and the program requesting I/O since Multiple programs using the processor share the I/O system I/O systems usually use interrupts which are handled by the OS Low-level control of an I/O device is complex and detailed Thus OS must handle interrupts generated by I/O devices and supply routines for low-level I/O device operations, provide equitable access to the shared I/O resources, protect those I/O devices/activities to which a user program doesn t have access, and schedule I/O requests to enhance system throughput OS must be able to give commands to the I/O devices I/O device must be able to notify the OS about its status Must be able to transfer data between the memory and the I/O device

17 Communication of I/O Devices and Processor How the processor directs the I/O devices Special I/O instructions Must specify both the device and the command Memory-mapped I/O Portions of the high-order memory address space are assigned to each I/O device Read and writes to those memory addresses are interpreted as commands to the I/O devices Load/stores to the I/O address space can only be done by the OS How I/O devices communicate with the processor Polling the processor periodically checks the status of an I/O device (through the OS) to determine its need for service Processor is totally in control but does all the work Can waste a lot of processor time due to speed differences Interrupt-driven I/O the I/O device issues an interrupt to indicate that it needs attention

18 Interrupt Driven I/O An I/O interrupt is asynchronous wrt instruction execution Is not associated with any instruction so doesn t prevent any instruction from completing You can pick your own convenient point to handle the interrupt With I/O interrupts Need a way to identify the device generating the interrupt Can have different urgencies (so need a way to prioritize them) Advantages of using interrupts Relieves the processor from having to continuously poll for an I/O event; user program progress is only suspended during the actual transfer of I/O data to/from user memory space Disadvantage special hardware is needed to Indicate the I/O device causing the interrupt and to save the necessary information prior to servicing the interrupt and to resume normal processing after servicing the interrupt

19 User mode Exception level Interrupt enable Interrupt Priority Levels Priority levels can be used to direct the OS the order in which the interrupts should be serviced MIPS Status register Interrupt mask Determines who can interrupt the processor (if Interrupt enable is 0, none can interrupt) MIPS Cause register Branch delay Pending interrupts Exception codes To enable a Pending interrupt, the correspond bit in the Interrupt mask must be 1 Once an interrupt occurs, the OS can find the reason in the Exception codes field

20 Interrupt Handling Steps 1. Logically AND the Pending interrupt field and the Interrupt mask field to see which enabled interrupts could be the culprit. Make copies of both Status and Cause registers. 2. Select the higher priority of these interrupts (leftmost is highest) 3. Save the Interrupt mask field 4. Change the Interrupt mask field to disable all interrupts of equal or lower priority 5. Save the processor state prior to handling the interrupt 1. See example with LC3 later 6. Set the Interrupt enable bit (to allow higher-priority interrupts) 7. Call the appropriate interrupt handler routine 8. Before returning from interrupt, set the Interrupt enable bit back to 0 and restore the Interrupt mask field Interrupt priority levels (IPLs) assigned by the OS to each process can be raised and lowered via changes to the Status s Interrupt mask field

21 Direct Memory Access (DMA) For high-bandwidth devices (like disks) interrupt-driven I/O would consume a lot of processor cycles With DMA, the DMA controller has the ability to transfer large blocks of data directly to/from the memory without involving the processor 1. The processor initiates the DMA transfer by supplying the I/O device address, the operation to be performed, the memory address destination/source, the number of bytes to transfer 2. The DMA controller manages the entire transfer (possibly thousand of bytes in length), arbitrating for the bus 3. When the DMA transfer is complete, the DMA controller interrupts the processor to let it know that the transfer is complete There may be multiple DMA devices in one system Processor and DMA controllers contend for bus cycles and for memory

22 The DMA Stale Data Problem In systems with caches, there can be two copies of a data item, one in the cache and one in the main memory For a DMA input (from disk to memory) the processor will be using stale data if that location is also in the cache For a DMA output (from memory to disk) and a writeback cache the I/O device will receive stale data if the data is in the cache and has not yet been written back to the memory The coherency problem can be solved by 1. Routing all I/O activity through the cache expensive and a large negative performance impact 2. Having the OS invalidate all the entries in the cache for an I/O input or force write-backs for an I/O output (called a cache flush) 3. Providing hardware to selectively invalidate cache entries i.e., need a snooping cache controller

23 I/O System Performance Designing an I/O system to meet a set of bandwidth and/or latency constraints means 1. Finding the weakest link in the I/O system the component that constrains the design The processor and memory system? The underlying interconnection (i.e., bus)? The I/O controllers? The I/O devices themselves? 2. (Re)configuring the weakest link to meet the bandwidth and/or latency requirements 3. Determining requirements for the rest of the components and (re)configuring them to support this latency and/or bandwidth

24 I/O System Performance Example A disk workload consisting of 64KB reads and writes where the user program executes 200,000 instructions per disk I/O operation and a processor that sustains 3 billion instr/s and averages 100,000 OS instructions to handle a disk I/O operation The maximum disk I/O rate (# I/O s/sec) of the processor is a memory-i/o bus that sustains a transfer rate of 1000 MB/s Each disk I/O reads/writes 64 KB so the maximum I/O rate of the bus is SCSI disk I/O controllers with a DMA transfer rate of 320 MB/s that can accommodate up to 7 disks per controller disk drives with a read/write bandwidth of 75 MB/s and an average seek plus rotational latency of 6 ms what is the maximum sustainable I/O rate and what is the number of disks and SCSI controllers required to achieve that rate?

25 I/O System Performance Example A disk workload consisting of 64KB reads and writes where the user program executes 200,000 instructions per disk I/O operation and a processor that sustains 3 billion instr/s and averages 100,000 OS instructions per disk I/O operation The maximum disk I/O rate (# I/O s/s) of the processor is Instr execution rate 3 x = = 10,000 I/O s/s Instr per I/O ( ) x 10 3 a memory-i/o bus that sustains a transfer rate of 1000 MB/s Each disk I/O reads/writes 64 KB so the maximum I/O rate of the bus is Bus bandwidth 1000 x = = 15,625 I/O s/s Bytes per I/O 64 x 10 3 SCSI disk I/O controllers with a DMA transfer rate of 320 MB/s that can accommodate up to 7 disks per controller disk drives with a read/write bandwidth of 75 MB/s and an average seek plus rotational latency of 6 ms what is the maximum sustainable I/O rate and what is the number of disks and SCSI controllers required to achieve that rate?

26 Disk I/O System Example Processor 10,000 I/O s/s Cache Memory - I/O Bus 15,625 I/O s/s 320 MB/s Main Memory I/O Controller I/O Controller Disk Disk Disk Disk 75 MB/s Up to 7

27 I/O System Performance Example, Con t So the processor is the bottleneck, not the bus disk drives with a read/write bandwidth of 75 MB/s and an average seek plus rotational latency of 6 ms Disk I/O read/write time = seek + rotational time + transfer time = 6ms + 64KB/(75MB/s) = 6.9ms Thus each disk can complete 1000ms/6.9ms or 146 I/O s per second. To saturate the processor requires 10,000 I/O s per second or 10,000/146 = 69 disks To calculate the number of SCSI disk controllers, we need to know the average transfer rate per disk to ensure we can put the maximum of 7 disks per SCSI controller and that a disk controller won t saturate the memory-i/o bus during a DMA transfer Disk transfer rate = (transfer size)/(transfer time) = 64KB/6.9ms = 9.56 MB/s Thus 7 disks won t saturate either the SCSI controller (with a maximum transfer rate of 320 MB/s) or the memory-i/o bus (1000 MB/s). This means we will need 69/7 or 10 SCSI controllers.

28 Exceptions: Example MIPS Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer Organization and Design (4th) **A special thanks to Eric Roberts and Mary Jane Irwin

29 Dealing with Exceptions Exceptions (and interrupts) are just another form of control hazard. Exceptions and interrupts arise from R-type arithmetic overflow Trying to execute an undefined instruction An I/O device request An OS service request (e.g., a page fault, TLB exception) A hardware malfunction The pipeline has to stop executing the offending instruction in midstream, let all prior instructions complete, flush all following instructions, set a register to show the cause of the exception, save the address of the offending instruction, and then jump to a prearranged address (the address of the exception handler code) The software (OS) looks at the cause of the exception and handles with it

30 Two Types of Exceptions Interrupts asynchronous to program execution caused by external events may be handled between instructions, so can let the instructions currently active in the pipeline complete before passing control to the OS interrupt handler simply suspend and resume user program Exceptions synchronous to program execution caused by internal events condition must be remedied by the trap handler for that instruction, so much stop the offending instruction midstream in the pipeline and pass control to the OS trap handler the offending instruction may be retried (or simulated by the OS) and the program may continue or it may be aborted

31 Where in the Pipeline Exceptions Occur IM Reg DM Reg ALU Arithmetic overflow Undefined instruction TLB or page fault I/O service request Hardware malfunction Stage(s)? EX ID IF, MEM any any Synchronous? yes yes yes no no Beware that multiple exceptions can occur simultaneously in a single clock cycle

32 Multiple Simultaneous Exceptions I n s t r. O r d e r Inst 0 Inst 1 Inst 2 Inst 3 IM Reg DM Reg ALU IM Reg DM Reg ALU ALU D$ page fault arithmetic overflow IM Reg DM Reg undefined instruction IM Reg DM Reg ALU Inst 4 I$ page fault IM Reg DM Reg ALU Hardware sorts the exceptions so that the earliest instruction is the one interrupted first

33 Additions to MIPS to Handle Exceptions (Fig 6.42) Cause register (records exceptions) hardware to record in Cause the exceptions and a signal to control writes to it (CauseWrite) EPC register (records the addresses of the offending instructions) hardware to record in EPC the address of the offending instruction and a signal to control writes to it (EPCWrite) Exception software must match exception to instruction A way to load the PC with the address of the exception handler Expand the PC input mux where the new input is hardwired to the exception handler address - (e.g., hex for arithmetic overflow) A way to flush offending instruction and the ones that follow it

34 PC IF.Flush Compare Datapath with Controls for Exceptions hex Add IF/ID PCSrc Hazard Unit Control Shift left 2 Branch ID.Flush Add ID/EX Cause EPC EX.Flush 0 0 EX/MEM MEM/WB Instruction Memory Read Address 0 Read Addr 1 RegFile Read Addr 2 Read Data 1 Write Addr ReadData 2 Write Data 16 Sign Extend 32 ALU ALU cntrl Data Memory Read Data Address Write Data Forward Unit Forward Unit

35 Exceptions: Example LC3 Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer Organization and Design (4th) **A special thanks to Eric Roberts and Mary Jane Irwin

36 Interrupts. Interrupt-Driven I/O 1. External device signals need to be serviced. 2. Processor saves state and starts service routine. 3. When finished, processor restores state and resumes program. Interrupt is an unscripted subroutine call, triggered by an external event. How doe we save the current state of computation so the interrupt can be resolved? 10-39

37 Processor State: Example LC3 What state is needed to completely capture the state of a running process? Processor Status Register Privilege [15], Priority Level [10:8], Condition Codes [2:0] Program Counter Pointer to next instruction to be executed. Registers All temporary state of the process that s not stored in memory

38 Where to Save Processor State? Can t use registers. Programmer doesn t know when interrupt might occur, so she can t prepare by saving critical registers. When resuming, need to restore state exactly as it was. Memory allocated by service routine? Must save state before invoking routine, so we wouldn t know where. Also, interrupts may be nested that is, an interrupt service routine might also get interrupted! Use a stack! Location of stack hard-wired. Push state to save, pop to restore.

39 Supervisor Stack A special region of memory used as the stack for interrupt service routines. Initial Supervisor Stack Pointer (SSP) stored in Saved.SSP. Another register for storing User Stack Pointer (USP): Saved.USP. Want to use R6 as stack pointer. So that our PUSH/POP routines still work. When switching from User mode to Supervisor mode (as result of interrupt), save R6 to Saved.USP

40 Invoking the Service Routine The Details 1. If Priv = 1 (user), Saved.USP = R6, then R6 = Saved.SSP. 2. Push PSR and PC to Supervisor Stack. 3. Set PSR[15] = 0 (supervisor mode). 4. Set PSR[10:8] = priority of interrupt being serviced. 5. Set PSR[2:0] = Set MAR = x01vv, where vv = 8-bit interrupt vector provided by interrupting device (e.g., keyboard = x80). 7. Load memory location (M[x01vv]) into MDR. 8. Set PC = MDR; now first instruction of ISR will be fetched. Note: This all happens between the STORE RESULT of the last user instruction and the FETCH of the first ISR instruction.

41 Returning from Interrupt Special instruction RTI that restores state. 1. Pop PC from supervisor stack. (PC = M[R6]; R6 = R6 + 1) 2. Pop PSR from supervisor stack. (PSR = M[R6]; R6 = R6 + 1) 3. If PSR[15] = 1, R6 = Saved.USP. (If going back to user mode, need to restore User Stack Pointer.) RTI is a privileged instruction. Can only be executed in Supervisor Mode. If executed in User Mode, causes an exception. (More about that later.)

42 Example (1) Saved.SSP / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / x3006 Program A ADD PC x3006 Executing ADD at location x3006 when Device B interrupts

43 Example (2) / / / / / / Program A x6200 ISR for Device B R6 / / / / / / x3007 x3006 ADD PSR for A / / / / / / x6210 RTI PC x Saved.USP = R6. R6 = Saved.SSP. Push PSR and PC onto stack, then transfer to Device B service routine (at x6200).

44 Example (3) R6 / / / / / / / / / / / / x3007 x3006 Program A ADD x6200 x6202 ISR for Device B AND PSR for A / / / / / / x6210 RTI PC x6203 Executing AND at x6202 when Device C interrupts

45 Example (4) R6 x6203 PSR for B x3007 PSR for A / / / / / / x3006 Program A ADD x6200 x6202 ISR for Device B AND x6210 RTI x6300 ISR for Device C PC x6300 x6315 RTI Push PSR and PC onto stack, then transfer to Device C service routine (at x6300).

46 Example (5) R6 x6203 PSR for B x3007 PSR for A / / / / / / x3006 Program A ADD x6200 x6202 ISR for Device B AND x6210 RTI x6300 ISR for Device C PC x6203 x6315 RTI Execute RTI at x6315; pop PC and PSR from stack

47 Example (6) Saved.SSP x6203 PSR for B x3007 PSR for A / / / / / / x3006 Program A ADD x6200 x6202 ISR for Device B AND x6210 RTI x6300 ISR for Device C PC x3007 x6315 RTI Execute RTI at x6210; pop PSR and PC from stack. Restore R6. Continue Program A as if nothing happened.

48 Exception: Internal Interrupt When something unexpected happens inside the processor, it may cause an exception. Examples: Privileged operation (e.g., RTI in user mode) Executing an illegal opcode Divide by zero Accessing an illegal address (e.g., protected system memory) Handled just like an interrupt Vector is determined internally by type of exception Priority is the same as running program 10-51

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World

Chapter 8 I/O. Computing Layers. I/O: Connecting to Outside World. I/O: Connecting to the Outside World Computing Layers Problems Chapter 8 I/O Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Algorithms Language Instruction Set

More information

Chapter 8. A Typical collection of I/O devices. Interrupts. Processor. Cache. Memory I/O bus. I/O controller I/O I/O. Main memory.

Chapter 8. A Typical collection of I/O devices. Interrupts. Processor. Cache. Memory I/O bus. I/O controller I/O I/O. Main memory. Chapter 8 1 A Typical collection of I/O devices Interrupts Cache I/O bus Main memory I/O controller I/O controller I/O controller Disk Disk Graphics output Network 2 1 Interfacing s and Peripherals I/O

More information

Lecture 13. Storage, Network and Other Peripherals

Lecture 13. Storage, Network and Other Peripherals Lecture 13 Storage, Network and Other Peripherals 1 I/O Systems Processor interrupts Cache Processor & I/O Communication Memory - I/O Bus Main Memory I/O Controller I/O Controller I/O Controller Disk Disk

More information

Systems Architecture II

Systems Architecture II Systems Architecture II Topics Interfacing I/O Devices to Memory, Processor, and Operating System * Memory-mapped IO and Interrupts in SPIM** *This lecture was derived from material in the text (Chapter

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 31: Computer Input/Output Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview for today Input and output are fundamental for

More information

Computer Architecture CS 355 Busses & I/O System

Computer Architecture CS 355 Busses & I/O System Computer Architecture CS 355 Busses & I/O System Text: Computer Organization & Design, Patterson & Hennessy Chapter 6.5-6.6 Objectives: During this class the student shall learn to: Describe the two basic

More information

INPUT/OUTPUT DEVICES Dr. Bill Yi Santa Clara University

INPUT/OUTPUT DEVICES Dr. Bill Yi Santa Clara University INPUT/OUTPUT DEVICES Dr. Bill Yi Santa Clara University (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,

More information

INPUT/OUTPUT ORGANIZATION

INPUT/OUTPUT ORGANIZATION INPUT/OUTPUT ORGANIZATION Accessing I/O Devices I/O interface Input/output mechanism Memory-mapped I/O Programmed I/O Interrupts Direct Memory Access Buses Synchronous Bus Asynchronous Bus I/O in CO and

More information

INPUT/OUTPUT ORGANIZATION

INPUT/OUTPUT ORGANIZATION INPUT/OUTPUT ORGANIZATION Accessing I/O Devices I/O interface Input/output mechanism Memory-mapped I/O Programmed I/O Interrupts Direct Memory Access Buses Synchronous Bus Asynchronous Bus I/O in CO and

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

INPUT/OUTPUT ORGANIZATION

INPUT/OUTPUT ORGANIZATION INPUT/OUTPUT ORGANIZATION Accessing I/O Devices I/O interface Input/output mechanism Memory-mapped I/O Programmed I/O Interrupts Direct Memory Access Buses Synchronous Bus Asynchronous Bus I/O in CO and

More information

CS152 Computer Architecture and Engineering Lecture 20: Busses and OS s Responsibilities. Recap: IO Benchmarks and I/O Devices

CS152 Computer Architecture and Engineering Lecture 20: Busses and OS s Responsibilities. Recap: IO Benchmarks and I/O Devices CS152 Computer Architecture and Engineering Lecture 20: ses and OS s Responsibilities April 7, 1995 Dave Patterson (patterson@cs) and Shing Kong (shing.kong@eng.sun.com) Slides available on http://http.cs.berkeley.edu/~patterson

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 29: Computer Input/Output Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Announcements ECE Honors Exhibition Wednesday, April

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

EN1640: Design of Computing Systems Topic 07: I/O

EN1640: Design of Computing Systems Topic 07: I/O EN1640: Design of Computing Systems Topic 07: I/O Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown University Spring 2017 [ material

More information

CENG 3420 Lecture 06: Pipeline

CENG 3420 Lecture 06: Pipeline CENG 3420 Lecture 06: Pipeline Bei Yu byu@cse.cuhk.edu.hk CENG3420 L06.1 Spring 2019 Outline q Pipeline Motivations q Pipeline Hazards q Exceptions q Background: Flip-Flop Control Signals CENG3420 L06.2

More information

Input & Output. Lecture 16. James Goodman (revised by Robert Sheehan) Computer Science 210 s1c Computer Systems 1 Lecture Notes

Input & Output. Lecture 16. James Goodman (revised by Robert Sheehan) Computer Science 210 s1c Computer Systems 1 Lecture Notes Computer Science 210 s1c Computer Systems 1 Lecture Notes Lecture 16 Input & Output James Goodman (revised by Robert Sheehan) Credits: Slides prepared by Gregory T. Byrd, North Carolina State University

More information

Introduction to Input and Output

Introduction to Input and Output Introduction to Input and Output The I/O subsystem provides the mechanism for communication between the CPU and the outside world (I/O devices). Design factors: I/O device characteristics (input, output,

More information

Chapter Seven Morgan Kaufmann Publishers

Chapter Seven Morgan Kaufmann Publishers Chapter Seven Memories: Review SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: value is stored as a charge on capacitor (must be

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

Subroutines & Traps. Announcements. New due date for assignment 2 5pm Wednesday, 5May

Subroutines & Traps. Announcements. New due date for assignment 2 5pm Wednesday, 5May Computer Science 210 s1c Computer Systems 1 2010 Semester 1 Lecture Notes Lecture 19, 26Apr10: Subroutines & Traps James Goodman! Announcements New due date for assignment 2 5pm Wednesday, 5May Test is

More information

Virtual Memory Input/Output. Admin

Virtual Memory Input/Output. Admin Virtual Memory Input/Output Computer Science 104 Lecture 21 Admin Projects Due Friday Dec 7 Homework #6 Due Next Wed Dec 5 Today VM VM + Caches, I/O Reading I/O Chapter 8 Input Output (primarily 8.4 and

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

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

Chapter 10 And, Finally... The Stack

Chapter 10 And, Finally... The Stack Chapter 10 And, Finally... The Stack Memory Usage Instructions are stored in code segment Global data is stored in data segment Local variables, including arryas, uses stack Dynamically allocated memory

More information

ECE468 Computer Organization and Architecture. OS s Responsibilities

ECE468 Computer Organization and Architecture. OS s Responsibilities ECE468 Computer Organization and Architecture OS s Responsibilities ECE4680 buses.1 April 5, 2003 Recap: Summary of Bus Options: Option High performance Low cost Bus width Separate address Multiplex address

More information

Computer Systems Laboratory Sungkyunkwan University

Computer Systems Laboratory Sungkyunkwan University I/O System Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Introduction (1) I/O devices can be characterized by Behavior: input, output, storage

More information

Computer Architecture Computer Science & Engineering. Chapter 6. Storage and Other I/O Topics BK TP.HCM

Computer Architecture Computer Science & Engineering. Chapter 6. Storage and Other I/O Topics BK TP.HCM Computer Architecture Computer Science & Engineering Chapter 6 Storage and Other I/O Topics Introduction I/O devices can be characterized by Behaviour: input, output, storage Partner: human or machine

More information

Storage, Networks, and Other Peripherals

Storage, Networks, and Other Peripherals 8 Storage, Networks, and Other Peripherals Combining bandwidth and storage... enables swift and reliable access to the ever-expanding troves of content on the proliferating disks and... repositories of

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

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

CPS104 Computer Organization and Programming Lecture 17: Interrupts and Exceptions. Interrupts Exceptions and Traps. Visualizing an Interrupt

CPS104 Computer Organization and Programming Lecture 17: Interrupts and Exceptions. Interrupts Exceptions and Traps. Visualizing an Interrupt CPS104 Computer Organization and Programming Lecture 17: Interrupts and Exceptions Robert Wagner cps 104 Int.1 RW Fall 2000 Interrupts Exceptions and Traps Interrupts, Exceptions and Traps are asynchronous

More information

Interconnecting Components

Interconnecting Components Interconnecting Components Need interconnections between CPU, memory, controllers Bus: shared communication channel Parallel set of wires for data and synchronization of data transfer Can become a bottleneck

More information

Chapter 10 And, Finally... The Stack. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University

Chapter 10 And, Finally... The Stack. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University Chapter 10 And, Finally... The Stack ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 2 Stack: An Abstract Data Type An important abstraction that

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

Lecture 11: Interrupt and Exception. James C. Hoe Department of ECE Carnegie Mellon University

Lecture 11: Interrupt and Exception. James C. Hoe Department of ECE Carnegie Mellon University 18 447 Lecture 11: Interrupt and Exception James C. Hoe Department of ECE Carnegie Mellon University 18 447 S18 L11 S1, James C. Hoe, CMU/ECE/CALCM, 2018 Your goal today Housekeeping first peek outside

More information

Thomas Polzer Institut für Technische Informatik

Thomas Polzer Institut für Technische Informatik Thomas Polzer tpolzer@ecs.tuwien.ac.at Institut für Technische Informatik Processor Interrupts Cache Memory I/O bus Main memory I/O controller I/O controller I/O controller Disk Disk Graphics output Network

More information

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception

Outline. A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception Outline A pipelined datapath Pipelined control Data hazards and forwarding Data hazards and stalls Branch (control) hazards Exception 1 4 Which stage is the branch decision made? Case 1: 0 M u x 1 Add

More information

Introduction to Operating Systems. Chapter Chapter

Introduction to Operating Systems. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

Buses. Disks PCI RDRAM RDRAM LAN. Some slides adapted from lecture by David Culler. Pentium 4 Processor. Memory Controller Hub.

Buses. Disks PCI RDRAM RDRAM LAN. Some slides adapted from lecture by David Culler. Pentium 4 Processor. Memory Controller Hub. es > 100 MB/sec Pentium 4 Processor L1 and L2 caches Some slides adapted from lecture by David Culler 3.2 GB/sec Display Memory Controller Hub RDRAM RDRAM Dual Ultra ATA/100 24 Mbit/sec Disks LAN I/O Controller

More information

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now?

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Outline of Today s Lecture. The Big Picture: Where are We Now? CPS104 Computer Organization and Programming Lecture 18: Input-Output Robert Wagner cps 104.1 RW Fall 2000 Outline of Today s Lecture The system Magnetic Disk Tape es DMA cps 104.2 RW Fall 2000 The Big

More information

Computer Architecture. Hebrew University Spring Chapter 8 Input/Output. Big Picture: Where are We Now?

Computer Architecture. Hebrew University Spring Chapter 8 Input/Output. Big Picture: Where are We Now? Computer Architecture Hebrew University Spring 2001 Chapter 8 Input/Output Adapted from COD2e by Petterson & Hennessy Chapter 8 I/O Big Picture: Where are We Now? I/O Systems Computer Processor Control

More information

Example Networks on chip Freescale: MPC Telematics chip

Example Networks on chip Freescale: MPC Telematics chip Lecture 22: Interconnects & I/O Administration Take QUIZ 16 over P&H 6.6-10, 6.12-14 before 11:59pm Project: Cache Simulator, Due April 29, 2010 NEW OFFICE HOUR TIME: Tuesday 1-2, McKinley Exams in ACES

More information

There are different characteristics for exceptions. They are as follows:

There are different characteristics for exceptions. They are as follows: e-pg PATHSHALA- Computer Science Computer Architecture Module 15 Exception handling and floating point pipelines The objectives of this module are to discuss about exceptions and look at how the MIPS architecture

More information

Chapter 6. I/O issues

Chapter 6. I/O issues Computer Architectures Chapter 6 I/O issues Tien-Fu Chen National Chung Cheng Univ Chap6 - Input / Output Issues I/O organization issue- CPU-memory bus, I/O bus width A/D multiplex Split transaction Synchronous

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

Computer System Overview

Computer System Overview Computer System Overview Operating Systems 2005/S2 1 What are the objectives of an Operating System? 2 What are the objectives of an Operating System? convenience & abstraction the OS should facilitate

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 35: Final Exam Review Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Material from Earlier in the Semester Throughput and latency

More information

Introduction to Operating Systems. Chapter Chapter

Introduction to Operating Systems. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

Introduction to Operating. Chapter Chapter

Introduction to Operating. Chapter Chapter Introduction to Operating Systems Chapter 1 1.3 Chapter 1.5 1.9 Learning Outcomes High-level understand what is an operating system and the role it plays A high-level understanding of the structure of

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

IO System. CP-226: Computer Architecture. Lecture 25 (24 April 2013) CADSL

IO System. CP-226: Computer Architecture. Lecture 25 (24 April 2013) CADSL IO System Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/

More information

Module 6: INPUT - OUTPUT (I/O)

Module 6: INPUT - OUTPUT (I/O) Module 6: INPUT - OUTPUT (I/O) Introduction Computers communicate with the outside world via I/O devices Input devices supply computers with data to operate on E.g: Keyboard, Mouse, Voice recognition hardware,

More information

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1 Introduction Chapter 4.1 Chapter 4.2 Review: MIPS (RISC) Design Principles Simplicity favors regularity fixed size instructions small number

More information

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests

More information

Where We Are in This Course Right Now. ECE 152 Introduction to Computer Architecture Input/Output (I/O) Copyright 2012 Daniel J. Sorin Duke University

Where We Are in This Course Right Now. ECE 152 Introduction to Computer Architecture Input/Output (I/O) Copyright 2012 Daniel J. Sorin Duke University Introduction to Computer Architecture Input/Output () Copyright 2012 Daniel J. Sorin Duke University Slides are derived from work by Amir Roth (Penn) Spring 2012 Where We Are in This Course Right Now So

More information

Page 1, 5/4/99 8:22 PM

Page 1, 5/4/99 8:22 PM Outline Review Pipelining CS61C Review of Cache/VM/TLB Lecture 27 May 5, 1999 (Cinco de Mayo) Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs61c/schedule.html Review Interrupt/Polling

More information

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles Michela Taufer http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer

More information

LECTURE 3: THE PROCESSOR

LECTURE 3: THE PROCESSOR LECTURE 3: THE PROCESSOR Abridged version of Patterson & Hennessy (2013):Ch.4 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 17: Pipelining Wrapup Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Outline The textbook includes lots of information Focus on

More information

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University Chapter 3 Top Level View of Computer Function and Interconnection Contents Computer Components Computer Function Interconnection Structures Bus Interconnection PCI 3-2 Program Concept Computer components

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

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture The Processor Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut CSE3666: Introduction to Computer Architecture Introduction CPU performance factors Instruction count

More information

Chapter 6. Storage and Other I/O Topics. Jiang Jiang

Chapter 6. Storage and Other I/O Topics. Jiang Jiang Chapter 6 Storage and Other I/O Topics Jiang Jiang jiangjiang@ic.sjtu.edu.cn [Adapted from Computer Organization and Design, 4 th Edition, Patterson & Hennessy, 2008, MK] Chapter 6 Storage and Other I/O

More information

Chapter 6. Storage and Other I/O Topics. ICE3003: Computer Architecture Fall 2012 Euiseong Seo

Chapter 6. Storage and Other I/O Topics. ICE3003: Computer Architecture Fall 2012 Euiseong Seo Chapter 6 Storage and Other I/O Topics 1 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

I/O - input/output. system components: CPU, memory, and bus -- now add I/O controllers and peripheral devices. CPU Cache

I/O - input/output. system components: CPU, memory, and bus -- now add I/O controllers and peripheral devices. CPU Cache I/O - input/output system components: CPU, memory, and bus -- now add I/O controllers and peripheral devices CPU Cache CPU must perform all transfers to/from simple controller, e.g., CPU reads byte from

More information

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles. Interrupts and Exceptions. Device Interrupt (Say, arrival of network message)

CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles. Interrupts and Exceptions. Device Interrupt (Say, arrival of network message) CISC 662 Graduate Computer Architecture Lecture 7 - Multi-cycles Michela Taufer Interrupts and Exceptions http://www.cis.udel.edu/~taufer/teaching/cis662f07 Powerpoint Lecture Notes from John Hennessy

More information

ECS 154B Computer Architecture II Spring 2009

ECS 154B Computer Architecture II Spring 2009 ECS 154B Computer Architecture II Spring 2009 Pipelining Datapath and Control 6.2-6.3 Partially adapted from slides by Mary Jane Irwin, Penn State And Kurtis Kredo, UCD Pipelined CPU Break execution into

More information

Input/Output Introduction

Input/Output Introduction Input/Output 1 Introduction Motivation Performance metrics Processor interface issues Buses 2 Page 1 Motivation CPU Performance: 60% per year I/O system performance limited by mechanical delays (e.g.,

More information

Introduction. Motivation Performance metrics Processor interface issues Buses

Introduction. Motivation Performance metrics Processor interface issues Buses Input/Output 1 Introduction Motivation Performance metrics Processor interface issues Buses 2 Motivation CPU Performance: 60% per year I/O system performance limited by mechanical delays (e.g., disk I/O)

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 27: Midterm2 review Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Midterm 2 Review Midterm will cover Section 1.6: Processor

More information

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

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic) I/O Systems Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) I/O Systems 1393/9/15 1 / 57 Motivation Amir H. Payberah (Tehran

More information

Digital System Design Using Verilog. - Processing Unit Design

Digital System Design Using Verilog. - Processing Unit Design Digital System Design Using Verilog - Processing Unit Design 1.1 CPU BASICS A typical CPU has three major components: (1) Register set, (2) Arithmetic logic unit (ALU), and (3) Control unit (CU) The register

More information

The Processor: Improving the performance - Control Hazards

The Processor: Improving the performance - Control Hazards The Processor: Improving the performance - Control Hazards Wednesday 14 October 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary

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 Behavior: input, output, t storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections

More information

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier Some material adapted from Mohamed Younis, UMBC CMSC 6 Spr 23 course slides Some material adapted from Hennessy & Patterson / 23 Elsevier Science Characteristics IBM 39 IBM UltraStar Integral 82 Disk diameter

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 Behavior: input, output, storage Partner: human or machine Data rate: bytes/sec, transfers/sec I/O bus connections

More information

Chapter 6 Storage and Other I/O Topics

Chapter 6 Storage and Other I/O Topics Department of Electr rical Eng ineering, Chapter 6 Storage and Other I/O Topics 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline 6.1 Introduction 6.2 Dependability,

More information

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics. Instructor: Dan Garcia h<p://inst.eecs.berkeley.

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics. Instructor: Dan Garcia h<p://inst.eecs.berkeley. CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 36: IO Basics Instructor: Dan Garcia h

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

EE 457 Unit 8. Exceptions What Happens When Things Go Wrong

EE 457 Unit 8. Exceptions What Happens When Things Go Wrong 1 EE 457 Unit 8 Exceptions What Happens When Things Go Wrong 2 What are Exceptions? Exceptions are rare events triggered by the hardware and forcing the processor to execute a software handler HW Interrupts

More information

MaanavaN.Com CS1202 COMPUTER ARCHITECHTURE

MaanavaN.Com CS1202 COMPUTER ARCHITECHTURE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK SUB CODE / SUBJECT: CS1202/COMPUTER ARCHITECHTURE YEAR / SEM: II / III UNIT I BASIC STRUCTURE OF COMPUTER 1. What is meant by the stored program

More information

Computer Organization

Computer Organization Chapter 5 Computer Organization Figure 5-1 Computer hardware :: Review Figure 5-2 CPU :: Review CPU:: Review Registers are fast stand-alone storage locations that hold data temporarily Data Registers Instructional

More information

14:332:331 Pipelined Datapath

14:332:331 Pipelined Datapath 14:332:331 Pipelined Datapath I n s t r. O r d e r Inst 0 Inst 1 Inst 2 Inst 3 Inst 4 Single Cycle Disadvantages & Advantages Uses the clock cycle inefficiently the clock cycle must be timed to accommodate

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

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

Chapter 4 The Processor 1. Chapter 4A. The Processor

Chapter 4 The Processor 1. Chapter 4A. The Processor Chapter 4 The Processor 1 Chapter 4A The Processor Chapter 4 The Processor 2 Introduction CPU performance factors Instruction count Determined by ISA and compiler CPI and Cycle time Determined by CPU hardware

More information

Lecture 9 Pipeline and Cache

Lecture 9 Pipeline and Cache Lecture 9 Pipeline and Cache Peng Liu liupeng@zju.edu.cn 1 What makes it easy Pipelining Review all instructions are the same length just a few instruction formats memory operands appear only in loads

More information

C02: Interrupts and I/O

C02: Interrupts and I/O CISC 7310X C02: Interrupts and I/O Hui Chen Department of Computer & Information Science CUNY Brooklyn College 2/8/2018 CUNY Brooklyn College 1 Von Neumann Computers Process and memory connected by a bus

More information

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION Introduction A general purpose computer should have the ability to exchange information with a wide range of devices in varying environments. Computers

More information

Lecture 10 Exceptions and Interrupts. How are exceptions generated?

Lecture 10 Exceptions and Interrupts. How are exceptions generated? Lecture 10 Exceptions and Interrupts The ARM processor can work in one of many operating modes. So far we have only considered user mode, which is the "normal" mode of operation. The processor can also

More information

Slides for Lecture 15

Slides for Lecture 15 Slides for Lecture 15 ENCM 501: Principles of Computer Architecture Winter 2014 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 6 March,

More information

COMPUTER ORGANIZATION AND DESIGN

COMPUTER ORGANIZATION AND DESIGN COMPUTER ORGANIZATION AND DESIGN 5 Edition th The Hardware/Software Interface Chapter 4 The Processor 4.1 Introduction Introduction CPU performance factors Instruction count CPI and Cycle time Determined

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

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

CS 333 Introduction to Operating Systems. Class 1 - Introduction to OS-related Hardware and Software

CS 333 Introduction to Operating Systems. Class 1 - Introduction to OS-related Hardware and Software CS 333 Introduction to Operating Systems Class 1 - Introduction to OS-related Hardware and Software Jonathan Walpole Computer Science Portland State University 1 About the instructor Instructor - Jonathan

More information

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection Unit 1 Chapter 3 Top Level View of Computer Function and Interconnection Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given correct control signals

More information

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Initial Representation Finite State Diagram. Logic Representation Logic Equations Control Implementation Alternatives Control may be designed using one of several initial representations. The choice of sequence control, and how logic is represented, can then be determined independently;

More information

CMSC 313 Lecture 26 DigSim Assignment 3 Cache Memory Virtual Memory + Cache Memory I/O Architecture

CMSC 313 Lecture 26 DigSim Assignment 3 Cache Memory Virtual Memory + Cache Memory I/O Architecture CMSC 313 Lecture 26 DigSim Assignment 3 Cache Memory Virtual Memory + Cache Memory I/O Architecture UMBC, CMSC313, Richard Chang CMSC 313, Computer Organization & Assembly Language Programming

More information

Recap: What is virtual memory? CS152 Computer Architecture and Engineering Lecture 22. Virtual Memory (continued) Buses

Recap: What is virtual memory? CS152 Computer Architecture and Engineering Lecture 22. Virtual Memory (continued) Buses CS152 Computer Architecture and Engineering Lecture 22 Virtual (continued) es April 21, 2004 John Kubiatowicz (www.cs.berkeley.edu/~kubitron) Virtual Address Space Recap: What is virtual memory? Physical

More information