Top Banner
Com puterA rchitecture CSE 3322 Lecture 25 H om ew ork D ueM ay 5: 5.8.4(a), 5.11.1(a) I/O 1. I/O 2, (see H andout /W eb Site) Final Exam ThursM ay 14 2pm G A C B 103
80

Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Jan 18, 2018

Download

Documents

Alice West

The Operating System ( OS) controls I/O processes
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Computer Architecture CSE 3322

Lecture 25Homework Due May 5: 5.8.4(a), 5.11.1(a)

I/O 1. I/O 2, ( see Handout / Web Site)

Final Exam Thurs May 14 2pm GACB 103

Page 2: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Processor MemoryProcessor-memory bus

I/ODevice

BusAdapter

I/ODevice

I/ODevice

BusAdapter

I/ODevice

I/ODevice

Expansion bus

I/O Bus

Page 3: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

Page 4: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. OS contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

Page 5: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. OS contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

2. Limits access to Users for Protection and ResourceScheduling. ( Some programs violate this)

Page 6: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. Contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

2. Limits access to Users for Protection and ResourceScheduling. ( Some programs violate this)

3. OS must give commands to devices and readsstatus from Devices

Page 7: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. Contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

2. Limits access to Users for Protection and ResourceScheduling. ( Some programs violate this)

3. OS must give commands to devices and readstatus from Devices

4. Devices must notify the OS of changes

Page 8: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. Contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

2. Limits access to Users for Protection and ResourceScheduling. ( Some programs violate this)

3. OS must give commands to devices and readstatus from Devices

4. Devices must notify the OS of changes5. Data must be transferred between memory and

an I/O device

Page 9: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions• Store Register xx in Device Address yy

Page 10: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions• Store Register xx in Device Address yy• Device address is put on I/O control lines and

the data is put on the I/O data lines

Page 11: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions• Store Register xx in Device Address yy• Device address is put on I/O control lines and

the data is put on the I/O data lines• Write from Device Address yy to a Register

or Memory location

Page 12: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions• Store Register xx in Device Address yy• Device address is put on I/O control lines and

the data is put on the I/O data lines• Write from Device Address yy to a Register

or Memory location• Constraining for unknown devices

Page 13: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions2. Memory Mapped I/O

• Memory Address Space is assigned to Devices.

Page 14: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions2. Memory Mapped I/O

• Memory Address Space is assigned to Devices. • A Write to that address goes to a device controller

register and not to the memory ( Commands)

Page 15: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions2. Memory Mapped I/O

• Memory Address Space is assigned to Devices. • A Write to that address goes to a device controller

register and not to the memory ( Commands)• A Read of that address comes from a device

controller register and not the memory ( Status)

Page 16: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

OS must give commands to devices and readstatus from Devices

1. Special I/O instructions2. Memory Mapped I/O

• Memory Address Space is assigned to Devices. • A Write to that address goes to a device controller

register and not to the memory ( Commands)• A Read of that address comes from a device

controller register and not the memory ( Status)• Memory Map defined by software for the installed

I/O controllers ( Flexibility and Expandability)

Page 17: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full

Page 18: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full• Processor is in complete control

Page 19: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full• Processor is in complete control• Polling loop in OS is overhead

Page 20: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full• Processor is in complete control• Polling loop in OS is overhead• Effective on slow devices that initiate I/O

Ex: keyboard and Mouse

Page 21: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full• Processor is in complete control• Polling loop in OS is overhead• Effective on slow devices that initiate I/O

Ex: keyboard and Mouse

Page 22: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling• Processor periodically reads the status of the I/O

Ex: key depressed, print complete, buffer full• Processor is in complete control• Polling loop in OS is overhead• Effective on slow devices that initiate I/O

Ex: keyboard and Mouse• Not efficient for fast devices

Page 23: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling2. Interrupt-driven

• Device controller asserts interrupt signal line andloads interrupt status register.

Page 24: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling2. Interrupt-driven

• Device controller asserts interrupt signal line andloads interrupt status register.

• Processor checks for interrupt at the start ofeach new instruction ( in parallel)

Page 25: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling2. Interrupt-driven

• Device controller asserts interrupt signal line andloads interrupt status register.

• Processor checks for interrupt at the start ofeach new instruction ( in parallel)

• Processor recognizes interrupts on a priority basis

Page 26: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling2. Interrupt-driven

• Device controller asserts interrupt signal line andloads interrupt status register.

• Processor checks for interrupt at the start ofeach new instruction ( in parallel)

• Processor recognizes interrupts on a priority basis• OS services the interrupt based on the Cause

register or vectored interrupt

Page 27: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Devices must notify the OS of changes

1. Polling2. Interrupt-driven

• Device controller asserts interrupt signal line andloads interrupt status register.

• Processor checks for interrupt at the start ofeach new instruction ( in parallel)

• Processor recognizes interrupts on a priority basis• OS services the interrupt based on the Cause

register or vectored interrupt• Enables a device to signal that data is ready to be

transferred or an operation has been completed

Page 28: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

The Operating System ( OS) controls I/O processes

1. Contains the low level programs that control theI/O device. ( Device Drivers, usually provided bythe device manufacturer)

2. Limits access to Users for Protection and ResourceScheduling. ( Some programs violate this)

3. OS must give commands to devices and readstatus from Devices

4. Devices must notify the OS of changes5. Data must be transferred between memory and

an I/O device

Page 29: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control• Data and Status transferred by Special Instruction

or Memory Mapped I/O

Page 30: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control• Data and Status transferred by Special Instruction

or Memory Mapped I/O• Polling or Interrupts are used

Page 31: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control• Data and Status transferred by Special Instruction

or Memory Mapped I/O• Polling or Interrupts are used• Fast device with blocks of data can excessively

load processorEx: hard disk and display

Page 32: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control2. Direct Memory Access ( DMA)

• I/O controller transfers block of data between deviceand memory independent of the processor

Page 33: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control2. Direct Memory Access ( DMA)

• I/O controller transfers block of data between deviceand memory independent of the processor

• DMA transfer process1. Processor initiates the device operation ( memory

address, number of bytes, enable bus master)

Page 34: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control2. Direct Memory Access ( DMA)

• I/O controller transfers block of data between deviceand memory independent of the processor

• DMA transfer process1. Processor initiates the device operation ( memory

address, number of bytes, enable bus master)2. DMA controller directly transfers block of data

between memory and device, under arbitration

Page 35: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control2. Direct Memory Access ( DMA)

• I/O controller transfers block of data between deviceand memory independent of the processor

• DMA transfer process1. Processor initiates the device operation ( memory

address, number of bytes, enable bus master)2. DMA controller directly transfers block of data

between memory and device, under arbitration3. DMA sends interrupt to notify completion or error

Page 36: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Data must be transferred between memory and an I/O device

1. Processor Control2. Direct Memory Access ( DMA)

• I/O controller transfers block of data between deviceand memory independent of the processor

• DMA transfer process1. Processor initiates the device operation ( memory

address, number of bytes, enable bus master)2. DMA controller directly transfers block of data

between memory and device, under arbitration3. DMA sends interrupt to notify completion or error

• Enables the processor to continue to operate duringdata transfer

Page 37: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

CPU/Memory

Control

Data

I/O 1 I/O 2 I/O 3

I/O bus

A bus master controls access to the bus

Page 38: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

CPU/Memory

Control

Data

I/O 1 I/O 2 I/O 3

I/O bus

A bus master controls access to the bus• Slaves request bus access

Page 39: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

CPU/Memory

Control

Data

I/O 1 I/O 2 I/O 3

I/O bus

A bus master controls access to the bus• Slaves request bus access• The bus master generates controls to make the

transfer

Page 40: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

CPU/Memory

Control

Data

I/O 1 I/O 2 I/O 3

I/O bus

A bus master controls access to the bus• Slaves request bus access• The bus master generates controls to make the

transfer• The processor is always a bus master and memory

is always a slave

Page 41: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Typically want multiple bus masters, so need to decidewhich bus master gets control.

Page 42: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Typically want multiple bus masters, so need to decidewhich bus master gets control.

Bus Arbitration

Arbitration schemes are used to grant the bus based on:

1. Priority2. Avoid lockout ( fairness)

Page 43: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

I/O and Caches

1. Polling or Interrupt- driven I/O under processorcontrol goes through cache ( virtual and performance)

Page 44: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

I/O and Caches

1. Polling or Interrupt- driven I/O under processorcontrol goes through cache ( virtual and performance)

2. DMA goes direct to main memory• Cache coherency problem

( Cache and memory different)Cache flushing with hardware support

Page 45: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

I/O and Caches

1. Polling or Interrupt- driven I/O under processorcontrol goes through cache ( virtual and performance)

2. DMA goes direct to main memory• Cache coherency problem

( Cache and memory different)Cache flushing with hardware support

• Page boundaries in virtual memoryStay within page boundaries or use virtualaddresses

Page 46: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Y Counter

X counter

MOUSE

The movement of the Mouseincrements or decrements the X and Y counters

Page 47: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Y Counter

X counter

MOUSE

The movement of the Mouseincrements or decrements the X and Y counters.

If the location of the cursor isupdated 20 times per second it appearssmooth to a human.

Page 48: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Y Counter

X counter

MOUSE

The movement of the Mouseincrements or decrements the X and Y counters.

If the location of the cursor isupdated 20 times per second it appearssmooth to a human.

1. Poll at 40 times per second.2. Polling I/O routine takes 800 clock cycles3. Each counter is 2 Bytes, Sample is 1 Word4. Clock Rate is 500 MHz

GIVEN:

Page 49: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

1. Poll at 40 times per second.2. Polling I/O routine takes 800 clock cycles3. Each counter is 2 Bytes, Sample is 1 Word4. Clock Rate is 500 MHz

GIVEN:MOUSE

% Processor Usage?Each Polling Cycle is 1/40 sec

Number of clock cycles each polling cycle = 500x106 clock cycles/sec * 1/40 sec = 12.5 x 106

Page 50: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

1. Poll at 40 times per second.2. Polling I/O routine takes 800 clock cycles3. Each counter is 2 Bytes, Sample is 1 Word4. Clock Rate is 500 MHz

GIVEN:MOUSE

% Processor Usage?Each Polling Cycle is 1/40 sec

Number of clock cycles each polling cycle = 500x106 clock cycles/sec * 1/40 sec = 12.5 x 106 % Processor Usage = 800 = 64 x 10-6 = 0.0064 % 12.5 x 106

Page 51: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

1. Poll at 40 times per second.2. Polling I/O routine takes 800 clock cycles3. Each counter is 2 Bytes, Sample is 1 Word4. Clock Rate is 500 MHz

GIVEN:MOUSE

% Processor Usage?Each Polling Cycle is 1/40 sec

Number of clock cycles each polling cycle = 500x106 clock cycles/sec * 1/40 sec = 12.5 x 106 % Processor Usage = 500 = 40 x 10-6 = 0.004 % 12.5 x 106

Transfer Rate = 4 bytes * 40 times/ sec = 160 bytes / sec

Page 52: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Platters6 Surfaces and Heads Tracks or Cylinders

Sectors

Page 53: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Platters6 Surfaces and Heads Tracks or Cylinders

Sectors

Seek Time-Move Headto Track - Min, Max,Ave.

Page 54: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Platters6 Surfaces and Heads Tracks or Cylinders

Sectors

Seek Time-Move Headto Track - Min, Max,Ave.

Rotational latency –Time for the sectorto rotate to the Head –

Average is ½ rotation time

Page 55: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Given: Average Seek Time = 10 msRotational speed = 5400 RPMSector size = 512 bytesData Rate = 5 MBpsec

What is the average transfer rate?

Page 56: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Platters6 Surfaces and Heads Tracks or Cylinders

Sectors

Seek Time-Move Headto Track - Min, Max,Ave.

Rotational latency –Time for the sectorto rotate to the Head –

Average is ½ rotation time

Page 57: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Given: Average Seek Time = 10 msRotational speed = 5400 RPMSector size = 512 bytesData Rate = 5 MBps

What is the average transfer rate from the disk?

Time to transfer a sector = 10 ms + ½ (60 sec/min) + 512 bytes

5400 rev/min 5 x 106 bytes/sec

= 10 + 5.56 + 0.102 ms= 15.67 ms

Page 58: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

Given: Average Seek Time = 10 msRotational speed = 5400 RPMSector size = 512 bytesData Rate = 5 MBps

What is the average transfer rate from the disk?

Time to transfer a sector = 10 ms + ½ (60 sec/min) + 512 bytes

5400 rev/min 5 x 106 bytes/sec= 10 + 5.56 + 0.102 ms = 15.67 ms

Average transfer rate = 512 bytes = 32.7 KBps from the disk 15.67ms

Page 59: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the time to transfer 4 KB from the disk under DMA?Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 Mhz 3. Average transfer rate from the disk is 32.7 KBps

Page 60: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the time to transfer 4 KB from the disk under DMA?Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 MHz 3. Average transfer rate from the disk is 32.7 KBps

Transfer time for 4 KB = 1000 clocks + 4 K B + 500 clocks

500 MHz 32.7 KBps 500 MHz

Page 61: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the time to transfer 4 KB from the disk under DMA?Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 MHz 3. Average transfer rate from the disk is 32.7 KBps

Transfer time for 4 KB = 1000 clocks + 4 K B + 500 clocks

500 MHz 32.7 KBps 500 MHz

= 0.002 ms + 122.32 ms + 0.001 ms

Page 62: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the % Processor usage for this transfer? Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 MHz 3. Average transfer rate from the disk is 32.7 KBps 4. Time to transfer 4 KB = 122.32 ms

Page 63: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the % Processor usage for this transfer? Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 MHz 3. Average transfer rate from the disk is 32.7 KBps 4. Time to transfer 4 KB = 122.32 ms

Processor time = 1000 + 500 clocks = 0.003 ms 500 MHz

Page 64: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

HARD DRIVE

What is the % Processor usage for this transfer? Given: 1. OS requires 1000 clock cycles for initial set up and

500 clock cycles to handle completion interrupt 2. Clock is 500 MHz 3. Average transfer rate from the disk is 32.7 KBps 4. Time to transfer 4 KB = 122.32 ms

Processor time = 1000 + 500 clocks = 0.003 ms 500 MHz

% Processor usage = 0.003 = 0.0025 % 122.32 Assuming no

memory contention

Page 65: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

A Optical disk transfers data to the processor in 32 bit units and has a data rate of 1M Bytes per sec. No data transfers can be missed. Consider a computer with a 900 MHz clock rate and a polling loop of 1500 clock cycles that includes the cycles to transfer a 32 bit unit.

What is the required polling rate to not miss any data?

Page 66: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

A Optical disk transfers data to the processor in 32 bit units and has a data rate of 1M Bytes per sec. No data transfers can be missed. Consider a computer with a 900 MHz clock rate and a polling loop of 1500 clock cycles that includes the cycles to transfer a 32 bit unit.

What is the required polling rate to not miss any data?

Polling Rate = 1M B/s * 8 bits/Byte = 0.25 M units/sec 32 b/sample

Page 67: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

What is the % Processor Usage?

Page 68: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

What is the % Processor Usage?

Polling period = 1/ 0.25 M = 4 microsec

Page 69: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

What is the % Processor Usage?

Polling period = 1/ 0.25 M = 4 microsec

Processor Time = 1500 Clk Cycles = 1.67 microsec 900 M Hz

Page 70: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

What is the % Processor Usage?

Polling period = 1/ 0.25 M = 4 microsec

Processor Time = 1500 Clk Cycles = 1.67 microsec 900 M Hz

% Processor Usage = 1.67 / 4 = 41.75%

Page 71: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Consider a interrupt driven I/O instead of polling with a interrupt routine of 2000 clock cycles that includes the cycles to transfer a 32 bit unit each interrupt. If the optical disk is active transferring data 5% of the time, what is the % Processor Usage?

Page 72: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Consider a interrupt driven I/O instead of polling with a interrupt routine of 2000 clock cycles that includes the cycles to transfer a 32 bit unit each interrupt. If the optical disk is active transferring data 5% of the time, what is the % Processor Usage?

Processing time each interrupt = 2000 clock cycles 900 Mhz

= 2.222 microsec

Page 73: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Consider a interrupt driven I/O instead of polling with a interrupt routine of 2000 clock cycles that includes the cycles to transfer a 32 bit unit each interrupt. If the optical disk is active transferring data 5% of the time, what is the % Processor Usage?

Processing time each interrupt = 2000 clock cycles 900 Mhz

= 2.222 microsecInterrupt period = 32 bits/ unit during transfer 8 bits/byte * 1 M bytes/sec

= 4 microsec/transfer

Page 74: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Consider a interrupt driven I/O instead of polling with a interrupt routine of 2000 clock cycles that includes the cycles to transfer a 32 bit unit each interrupt. If the optical disk is active transferring data 5% of the time, what is the % Processor Usage?

Processing time each interrupt = 2000 clock cycles 900 Mhz

= 2.222 microsecInterrupt period = 32 bits/ unit during transfer 8 bits/byte * 1 M bytes/sec

= 4 microsec/transfer

% Processor usage = 5% * 2.222x10-6 = 0.125 % 4 x 10-6

Page 75: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 7: Memory Hierarchy

Organization and operation of Caches:Direct, 2-way and 4-way associative with

multiword blocks.Memory Organizations interfacing with

Cache

Page 76: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 7: Memory Hierarchy

Organization and operation of Caches:Direct, 2-way, 4-way and Fully associative

with multiword blocks.Memory Organizations interfacing with

CacheCache Performance Measures: Ave Memory

Access Time, Hit Rate, Miss Rate, MissPenalty, Effective CPI

Page 77: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 7: Memory Hierarchy

Organization and operation of Caches:Direct, 2-way and 4-way associative with

multiword blocks.Memory Organizations interfacing with

CacheCache Performance Measures: Ave Memory

Access Time, Hit Rate, Miss Rate, MissPenalty, Effective CPI

Organization and operation of Virtual Memory:Page Tables, TLB, TLB Miss, Page Fault

Page 78: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 8: Input / OutputI/O Busses

Page 79: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 8: Input / OutputI/O BussesPolling, Interrupt Driven, DMA

Page 80: Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.

Review for Exam III

Chapter 8: Input / OutputI/O BussesPolling, Interrupt Driven, DMAPerformance: I/O Rates, % Processor Usage