Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.

Similar presentations


Presentation on theme: "ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH."— Presentation transcript:

1 ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi mjchoi@postech.ac.kr DPNM Lab. Dept. of CSE, POSTECH

2 ITEC502 컴퓨터 시스템 및 실습 2 Contents  Principles of I/O hardware  Principles of I/O software  I/O software layers

3 ITEC502 컴퓨터 시스템 및 실습 3 Principles of I/O Hardware Some typical device, network, and bus data rates

4 ITEC502 컴퓨터 시스템 및 실습 4 Device Controllers  I/O devices have components: –mechanical component –electronic component  The electronic component is the device controller or adapter –may be able to handle multiple devices  Controller's tasks –convert serial bit stream to block of bytes –perform error correction as necessary –make available to main memory

5 ITEC502 컴퓨터 시스템 및 실습 5 Memory-Mapped I/O (1)  Separate I/O and memory space  Memory-mapped I/O  Hybrid

6 ITEC502 컴퓨터 시스템 및 실습 6 Memory-Mapped I/O (2) (a) A single-bus architecture (b) A dual-bus memory architecture

7 ITEC502 컴퓨터 시스템 및 실습 7 Direct Memory Access (DMA) Operation of a DMA transfer

8 ITEC502 컴퓨터 시스템 및 실습 8 Interrupts Revisited  How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires Bus

9 ITEC502 컴퓨터 시스템 및 실습 9 Principles of I/O Software Goals of I/O Software (1)  Device independence –programs can access any I/O device –without specifying device in advance ·floppy, hard drive, or CD-ROM  Uniform naming –name of a file or device a string or an integer –not depending on which machine  Error handling –handle as close to the hardware as possible

10 ITEC502 컴퓨터 시스템 및 실습 10 Goals of I/O Software (2)  Synchronous vs. asynchronous transfers –blocked transfers vs. interrupt-driven  Buffering –data coming off a device cannot be directly stored in final destination  Sharable vs. dedicated devices –disks are sharable –tape drives would not be

11 ITEC502 컴퓨터 시스템 및 실습 11 Programmed I/O (1) Steps in printing a string

12 ITEC502 컴퓨터 시스템 및 실습 12 Programmed I/O (2) Writing a string to the printer using programmed I/O buffer */

13 ITEC502 컴퓨터 시스템 및 실습 13 Interrupt-Driven I/O  Writing a string to the printer using interrupt-driven I/O –(a) Code executed when print system call is made –(b) Interrupt service procedure

14 ITEC502 컴퓨터 시스템 및 실습 14 I/O Using DMA  Printing a string using DMA –(a) code executed when the print system call is made –(b) interrupt service procedure

15 ITEC502 컴퓨터 시스템 및 실습 15 I/O Software Layers Layers of the I/O Software System

16 ITEC502 컴퓨터 시스템 및 실습 16 Interrupt Handlers (1)  Interrupt handlers are best hidden –have driver starting an I/O operation block until interrupt notifies of completion  Interrupt procedure does its task –then unblocks driver that started it

17 ITEC502 컴퓨터 시스템 및 실습 17 Interrupt Handlers (2)  Steps must be performed in software after interrupt completed 1.Save regs not already saved by interrupt hardware 2.Set up context for interrupt service procedure 3.Set up stack for interrupt service procedure 4.Ack interrupt controller, reenable interrupts 5.Copy registers from where saved 6.Run service procedure 7.Set up MMU context for process to run next 8.Load new process' registers 9.Start running the new process

18 ITEC502 컴퓨터 시스템 및 실습 18 Device Drivers  Logical position of device drivers is shown here  Communications between drivers and device controllers go over the bus

19 ITEC502 컴퓨터 시스템 및 실습 19 Device-Independent I/O Software (1) Functions of the device-independent I/O software Uniform interfacing for device drivers Buffering Error reporting Allocating and releasing dedicate devices Providing a device-independent block size

20 ITEC502 컴퓨터 시스템 및 실습 20 Device-Independent I/O Software (2) (a) Without a standard driver interface (b) With a standard driver interface

21 ITEC502 컴퓨터 시스템 및 실습 21 Device-Independent I/O Software (3) (a) Unbuffered input (b) Buffering in user space (c) Buffering in the kernel followed by copying to user space (d) Double buffering in the kernel

22 ITEC502 컴퓨터 시스템 및 실습 22 Device-Independent I/O Software (4) Networking may involve many copies

23 ITEC502 컴퓨터 시스템 및 실습 23 User-Space I/O Software Layers of the I/O system and the main functions of each layer


Download ppt "ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH."

Similar presentations


Ads by Google