220 likes | 501 Views
Control. Control. Data-path. Data-path. Sistem I/O. Topik Hari ini: I/O Systems. Network. Processor. Processor. Input. Input. Memory. Memory. Output. Output. Sistem IO mengandungi: IO devices (peripherals), Disk, Tape Control units ( programmed IO , DMA , IOP )
E N D
Control Control Data-path Data-path Sistem I/O • Topik Hari ini: I/O Systems Network Processor Processor Input Input Memory Memory Output Output FSKTM
Sistem IO mengandungi: IO devices (peripherals), Disk, Tape Control units (programmed IO, DMA, IOP) Software to carry out IO operations (operating System) Sistem IO berkemungkinan dibezakan oleh corak tawaran pembabitan CPU dalam operasi IO. I/O System FSKTM
I/O System Design Issues • Performance limited by mechanical delays • Expandability interrupts Processor Cache Memory - I/O Bus Main Memory I/O Controller I/O Controller I/O Controller Graphics Disk Disk Network FSKTM
I/O Device Examples Device Behavior Partner Data Rate (KB/sec) Keyboard Input Human 0.01 Mouse Input Human 0.02 Line Printer Output Human 1.00 Floppy disk Storage Machine 50.00 Laser Printer Output Human 100.00 Optical Disk Storage Machine 500.00 Magnetic Disk Storage Machine 5,000.00 Graphics Display Output Human 30,000.00 FSKTM
Prestasi sistem I/O bergantung kpd pelbagai aspek sistem (“limited by weakest link in the chain”): The CPU Thememory system: Internal and external caches Main Memory The underlying interconnection (buses) The I/O controller The I/O device The speed of the I/O software (Operating System) Prestasi Sistem I/O FSKTM
Prestasi Sistem I/O • Dua unit/metrik yg selalu digunakan: • Throughput: I/O bandwidth (truput) • Bil. tugas yg diselesaikan oleh pelayan dlm satu unit masa • Untuk mencapai truput tertinggi seboleh mungkin: • Pelayan tidak mungkin semestinya unggul • Queue tidak mungkin semestinya kosong • Response time: Latency (pendaman) • Bermula apabila tugas diletak dlm queue • Tamat apabila telah diselesaikan oleh server • Untuk meminimumkan masa tindakbalas: • Queue semestinya kosong • Pelayan semestinya unggul FSKTM
Throughput versus Respond Time Response Time (ms) 300 200 100 20% 40% 60% 80% 100% Percentageof maximum throughput FSKTM
Berkaitan persoalan Bgmn aturcara permohonan IO ditransimi kedalam arahan peranti dan berkomunikasi dgn peranti. Bgmn data ditransmisi dari/ke memori. Knp ada pembabitan OS Perkongsian peranti IO oleh pelbagai program diurus oleh OS Adanya sampukan digunakan peranti IO yg diurus oleh OS Apakah tanggungjawap OS Antaramuka I/O FSKTM
Commands to IO devices • Special IO instruction • arahan pemproses akan mengenalpasti device number dan comman word. Arahan ini hy dilaksanakan ketika supervisor mode OS. • Memory mapped I/O • menggunakan special address space yg diperuntukkan bg setiap IO. FSKTM
Komunikasi dgn Pemproses • . • I/O Control Structures • Polling • Interrupts • DMA • I/O Controllers • I/O Processors FSKTM
I/O Interface CPU Memory memory bus Independent I/O Bus Seperate I/O instructions (in,out) Interface Interface Peripheral Peripheral CPU common memory & I/O bus Lines distinguish between I/O and memory transfers Memory Interface Interface FSKTM Peripheral Peripheral
Interrupt Driven Data Transfer add sub and or nop user program (1) I/O interrupt CPU (2) save PC Memory IOC (3) interrupt service addr read store ... rti interrupt service routine device (4) memory User program progress only halted during actual transfer FSKTM
Memory Mapped I/O CPU Single Memory & I/O Bus No Separate I/O Instructions ROM RAM Memory Interface Interface Peripheral Peripheral I/O CPU Memory Bus I/O bus Memory Bus Adaptor FSKTM
Programmed I/O (Polling) CPU IO operations are completely controlled by the CPU, where the CPU executes programs that initiate, direct, and terminate the IO operation Is the data ready? no Memory IOC yes read data device store data busy wait loop not an efficient way to use the CPU unless the device is very fast! IO transfer rate is limited by the speed with which the CPU can test and service an IO device done? no yes FSKTM
Direct Memory Access • Direct Memory Access (DMA): • External to the CPU • Act as a master on the bus • Transfer blocks of data to or from memory without CPU intervention CPU sends a starting address, direction, and length count to DMAC. Then issues "start". CPU DMA is capable of generating memory addresses and transferring data to or from the system bus Memory DMAC IOC device DMAC provides handshake signals for Peripheral Controller, and Memory Addresses and handshake signals for Memory. FSKTM
Direct Memory Access Main memory System bus Address DATA AR AC IOAR DC IODR DMA request Control unit Control unit DMA controller IR DMA Acknowledge CPU DC stores the number of words that remain to be transferred it is automatically decremented and tested for zero IOAR is used to store the address of the next word to be transferred IODR data buffer register IO device FSKTM
Input/Output Processors D1 IOP CPU D2 main memory bus . . . Mem Dn I/O bus target device where cmnds are CPU IOP issues instruction to IOP interrupts when done (1) OP Device Address (4) looks in memory for commands (2) (3) memory OP Addr Cnt Other what to do special requests Device to/from memory transfers are controlled by the IOP directly. IOP steals memory cycles. where to put data how much FSKTM
Responsibilities of the Operating System • OS bertindak sbg antaramuka antara: • Perkakasan I/O & program yg meminta I/O • Tiga ciri sistem I/O: • Sistem I/O dikongsi oleh pelbagai program menggunakan processor • Sistem I/O selalunya menggunakan sampukan utk saling-tukaran informasi berkenaan operasi I/O. • Sampukan mesti diuruskan oleh OS kerana ia melibatkan peralihan ke supervisor mode • The low-level control of an I/O device is complex: • Managing a set of concurrent events • The requirements for correct device control are very detailed FSKTM
Operating System Requirements • Menyediakan kawalan (protection) kpd sumber I/O yg dikongsi • Jaminan bahawa pengguna program hy blh capai peranti IO yg dibenarkan sahaja kpdnya. • Mengurus sampukan yg dijanakan oleh peranti IO • Menyediakan capaian yg samarata kpd sumber IO yg dikongsi • Semua pengguna program mesti mempunyai capaian samarata kpd sumber I/O. • Penjadualan capaian utk meningkatkan truput sistem FSKTM
OS and I/O Systems Communication Requirements • OS mesti berkebolehan menghalang: • Pengguna aturcara berkomunikasi secara terus dgn peranti I/O. • Jika pengguna aturcara boleh menggunakan I/O secara terus: • Kawalan terhadap sumber I/O kongsian, boleh jadi tidak disediakan • Tiga jenis komunikasi diperlukan: • OS mesti berkebolehan memberi arahan kpd peranti I/O • Peranti I/O mesti berkebolehan memberitahu OS apabila ia selesai melaksanakan tugas atau menghadapi masalah. • Data mesti dialihkan drpd memori & peranti I/O FSKTM