1 Pertemuan 17 Input / Output Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5
2 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : menjelaskan prinsip input-output baik perangkat keras maupun perangkat lunak (C2)
3 Outline Materi Prinsip perangkat keras I/O Device controller Memory Map I/O Direct Access Memory (DMA) Interrupt Revisited Prinsip perangkat lunak I/O
4 Principles of I/O Hardware Dua jenis peralatan IO: 1.Block Devices Data dikirim atau diterima dalam bentuk blok (disk, pita magnetik) Informasi disimpan dalam blok berukuran tetap; setiap blok memiliki alamat sendiri 2.Character devices Data dikirim atau diterima dalam bentuk karakter (line printer, pita kertas, punched card, mouse, network interface) Tidak memiliki alamat ataupun operasi seek
5 Principles of I/O Hardware Some typical device, network, and data base rates
6 Device Controllers I/O devices have components: –mechanical component –electronic component The electronic component is the device controller –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
7 Memory-Mapped I/O (1) Separate I/O and memory space –Need assembly code Memory-mapped I/O –No special protection, but caching may be inconsistent; eg in PDP-11 Hybrid –Eg. Pentium
8 Memory-Mapped I/O (2) (a) A single-bus architecture (b) A dual-bus memory architecture
9 Direct Memory Access (DMA) Operation of a DMA transfer
10 Interrupts Revisited How interrupts happens. Connections between devices and interrupt controller actually use interrupt lines on the bus rather than dedicated wires
11 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) Error handling handle as close to the hardware as possible Uniform naming name of a file or device a string or an integer not depending on which machine
12 Goals of I/O Software (2) Synchronous vs. asynchronous transfers –blocked transfers vs. interrupt-driven Sharable vs. dedicated devices disks are sharable tape drives would not be Buffering data coming off a device cannot be stored in final destination
13 Programmed I/O (1) Steps in printing a string
14 Programmed I/O (2) Writing a string to the printer using programmed I/O
15 Interrupt-Driven I/O Writing a string to the printer using interrupt-driven I/O –Code executed when print system call is made –Interrupt service procedure
16 I/O Using DMA Printing a string using DMA –code executed when the print system call is made –interrupt service procedure