Professional Documents
Culture Documents
IO Systems Lecture 1 New - 20210710 - 134336
IO Systems Lecture 1 New - 20210710 - 134336
IO Systems Lecture 1 New - 20210710 - 134336
Lecture -1
Ibrar Afzal
Lecturer IT Department
1
I/O Systems
• I/O and its main Job
• I/O Harware
2
I/O Systems
The two main jobs of a computer are
• I/O
• Processing.
•The main job is I/O
3
I/O Systems
I/O-device technology exhibits two conflicting trends.
•Increasing standardization of software and hardware interfaces.
4
4
I/O Systems
Port
• The device communicates with the machine via a connection point
Bus
• Set of wires and protocol that specifies a set of messages that can
be sent on the wires.
PCI bus
Expansion bus
6
I/O Systems
• PCI Express
• HyperTransport
•Daisy chain
• When device A has a cable that plugs into device B, and device B has a
cable that plugs into device C, and device C plugs into a port on the
computer
•Controller
7
I/O Systems
•Disk controller
•How can the processor give commands and data to a controller to accomplish an
I/O transfer?
•Controller has one or more registers for data and control signals.
•The processor communicates with the controller by reading and writing bit
patterns in these registers.
8
I/O Systems
An I/O port typically consists of four registers
•Status
•Control
•Data-in
•Data-out
• The data-in register is read by the host to get input.
• The data-out register is written by the host to send output.
• The status register contains bits that can be read by the host.
•These bits indicate states, such as
•Whether the current command has completed
•Whether a byte is available to be read from the data-in register
•Whether a device error has occurred.
9
I/O Systems
•The control register can be written by the host
• To start a command
•Change the mode of a device.
•The data registers are typically 1 to 4 bytes in size.
•Some controllers have FIFO chips
•It can hold several bytes of input or output data to expand the
capacity of the controller beyond the size of the data register.
10
Characteristics I/O devices
Six main Characteristics of I/O devices are:
11
11
Characteristics I/O devices
Six main Characteristics of I/O devices are:
• Synchronous or asynchronous.
A synchronous device performs data transfers with predictable
response times.
Asynchronous device exhibits irregular or unpredictable response
times not coordinated with other computer events.
• Sharable or dedicated.
A sharable device can be used concurrently by several processes or
threads; a dedicated device cannot.
12
12
Characteristics of I/O Devices
• Speed of operation.
Device speeds range from a few bytes per second to a few gigabytes
per second.
13
13
Application I/O Interface
Network Devices
Vectored I/O
14
14
Application I/O Interface
Block and Character Devices
Block-device interface or raw I/O
• read(), write(), and seek()
• Memory-mapped file access can be layered on top of block-device drivers
The actual data transfers are performed only when needed to satisfy
access to the memory image.
Memory mapping is also convenient for programmers.
Character stream interface
• “spontaneously” that is, at times that cannot necessarily be predicted by the
application.
• get() or put() one character
• Convenient for input devices such as keyboards, mice, printers and
modems.
15
15
Application I/O Interface
Network Devices
• Network socket interface: The system calls in the socket interface which
enable an application for
• Creation of a socket
• To listen for any remote application to plug into the local socket
• The use of select() system calls eliminates the polling and busy waiting that
would otherwise be necessary for network I/O.
16
16
Application I/O Interface
• Programmable interval timer
17
17
Application I/O Interface
Clocks and Timers
18
18
Application I/O Interface
Nonblocking and Asynchronous I/O
19
19
Application I/O Interface
Nonblocking and Asynchronous I/O Continues….
Nonblocking call
• does not halt the execution of the application for an extended time.
• Keyboard ,mouse input and video application that reads frames from a file
on disk while simultaneously decompressing and displaying the output on
the display.
• select() system call for network sockets is an example
20
20
Application I/O Interface
Nonblocking and Asynchronous I/O Continues….
Fewer
None at all.
An asynchronous call returns immediately and does not waiting for the I/O
to complete
21
21
Application I/O Interface
Vectored I/O
• Allows one system call to perform multiple I/O operations
involving multiple locations
• Scatter-gather method is useful
Increase throughput and decrease system overhead
Atomicity, assuring that all the I/O is done without interruption
22
22
Thanks
23
23