Visualisasi Sistem I/O

Simulasi Interaksi CPU, Memory, dan Perangkat I/O

Kontrol Simulasi

Konfigurasi Sistem

Kecepatan Simulasi

Slow Normal Fast

Arsitektur Sistem I/O

Central Processing Unit

0x1000
IN R0, [0x80]
0
Status: Running
Interrupts: Disabled

Main Memory

I/O Buffers
DMA Buffer
Accesses: 0
DMA Transfers: 0

I/O Controller

0x00
Ready
0x00
IRQ Line
Inactive

DMA Controller

0x0000
0x0000
0
Idle
Transfer: Inactive
Bytes Left: 0

I/O Devices

Keyboard
Ready
Display
Ready
Hello World!
Storage
Ready
Network
Ready

Data Flow Visualization

CPU - Memory Bus
Idle
CPU - I/O Bus
Idle
DMA - Memory Bus
Idle
I/O - Memory Bus
Idle

Perbandingan Teknik I/O

Programmed I/O

CPU secara aktif menunggu dan mengontrol transfer data

Kelebihan:

  • Sederhana implementasinya
  • Tidak perlu hardware khusus
  • Kontrol penuh oleh CPU

Kekurangan:

  • CPU time terbuang untuk polling
  • Efisiensi rendah
  • Slow untuk high-speed devices
High (80-100%)
Slow
Low

Interrupt-Driven I/O

Device memberi sinyal ketika siap, CPU dapat melakukan tugas lain

Kelebihan:

  • CPU tidak menunggu (non-blocking)
  • Lebih efisien dari programmed I/O
  • Responsif untuk slow devices

Kekurangan:

  • Overhead interrupt handling
  • Masih melibatkan CPU untuk setiap transfer
  • Complex interrupt management
Medium (30-60%)
Medium
Medium

DMA (Direct Memory Access)

DMA controller mengatur transfer langsung antara device dan memory

Kelebihan:

  • CPU bebas selama transfer
  • Sangat efisien untuk large transfers
  • High throughput

Kekurangan:

  • Hardware complexity
  • DMA controller required
  • Bus contention issues
Low (5-20%)
High
High

Monitoring Performa

CPU Utilization

0%

I/O Throughput

0 KB/s

Average Latency

0 ms

DMA Efficiency

0%

Statistik Real-time

0
0
0
0 KB
0%
0

Konsep Sistem I/O

Metode Addressing I/O

Memory-Mapped I/O

Device registers dipetakan ke address space memory

  • Instruksi memory access digunakan untuk I/O
  • Tidak perlu instruksi I/O khusus
  • Contoh: ARM, Motorola processors
Port-Mapped I/O

Device registers memiliki address space terpisah

  • Menggunakan instruksi I/O khusus (IN/OUT)
  • Address space terpisah dari memory
  • Contoh: x86 architecture

Teknik Synchronization

Polling

CPU secara periodik mengecek status device

  • Sederhana tapi inefficient
  • Waste CPU cycles
  • Cocok untuk simple systems
Interrupts

Device memberi sinyal ketika ready

  • Efficient CPU utilization
  • Butuh interrupt controller
  • Complex interrupt handling

Buffering Strategies

Single Buffering

Satu buffer untuk transfer data

  • Sederhana implementasinya
  • Processor harus menunggu
  • Throughput terbatas
Double Buffering

Dua buffer bergantian digunakan

  • Continuous data flow
  • Processor tidak perlu menunggu
  • Lebih complex
Circular Buffering

Multiple buffers dalam circular queue

  • Efficient untuk streaming data
  • Complex buffer management
  • Used in network systems

Error Handling & Recovery

Transmission Errors
  • Parity checking
  • CRC (Cyclic Redundancy Check)
  • Checksum verification
Device Errors
  • Timeout detection
  • Status register monitoring
  • Error correction codes
Recovery Strategies
  • Retry mechanisms
  • Error logging
  • Fallback procedures