0% found this document useful (0 votes)
3 views21 pages

Os Module6

Input/output (I/O) devices are hardware that enable interaction between humans or systems and computers, facilitating data input and output. There are three techniques for I/O transfer: programmed I/O, interrupt-driven I/O, and direct memory access (DMA), each with distinct functioning and performance implications. Programmed I/O requires the processor to check the I/O module's status, while interrupt-driven I/O allows the processor to perform other tasks until an interrupt signals that the I/O operation is complete.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views21 pages

Os Module6

Input/output (I/O) devices are hardware that enable interaction between humans or systems and computers, facilitating data input and output. There are three techniques for I/O transfer: programmed I/O, interrupt-driven I/O, and direct memory access (DMA), each with distinct functioning and performance implications. Programmed I/O requires the processor to check the I/O module's status, while interrupt-driven I/O allows the processor to perform other tasks until an interrupt signals that the I/O operation is complete.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

I/O devices

An input/output device, often known as an IO device, is any hardware that allows a


human operator or other systems to interface with a computer. Input/output devices, as the name
implies, are capable of delivering data (output) to and receiving data from a computer (input).
An input/output (I/O) device is a piece of hardware that can take, output, or process data. It receives
data as input and provides it to a computer, as well as sends computer data to storage media as a storage
output.

Organization of I/O function

1) Programmed I/O is one of the three techniques we use for I/O transfer. The other two
methods for the same are interrupted I/O and (direct memory access) DMA. Programmed
I/O is a technique or approach that we use to transfer data between the processor and the
I/O module.

What is the Need?


To understand the need and functioning of the programmed I/O consider a scenario of human and
computer interaction where the human types something on the keyboard. Now the processor has to
save this data into the memory and has to display the same data on the display device.

With the programmed I/O this entire functioning is regulated with the help of a program. This action
of transferring the typed characters from the keyboard to memory and then to the display module must
happen at the right time.
Let us take this in more detail the input from the keyboard is accepted when the key is being pressed
on the keyboard by the user. And the output can be sent to the display module only when the module
is ready to accept it.

Here the speed at which the data is transferred from the keyboard to the computer memory depends
on the typing speed of the computer. On the other hand, the speed at which the output data from
memory is transferred to the display module is very high.

Functioning of programmed I/O


Consider the situation that the processor is busy executing any program. Meanwhile, it encounters
an I/O instruction. To execute the encountered instruction the process supply an appropriate I/O
command to the corresponding I/O module. Accepting the issued command, the I/O module performs
the desired task and sets some appropriate bits of its I/O status registers. As we have seen in our
previous content, the bus structure that each I/O interface has a set of registers.
Further, the I/O module does not notify the processor that it has performed the desired task. Moreover,
it’s the processors’ responsibility to periodically check the status of the I/O module till it finds that the
I/O has successfully completed the desired task.
2) Interrupt driven I/O is an approach to transfer data between ‘memory’ and ‘I/O devices’
through the ‘processor’. The other two techniques for the same are programmed
I/O and direct memory access (DMA). The interrupt-driven I/O involves the use
of interrupt to exchange data between I/O and memory.

programmed I/O we have seen it is a processor who keeps on checking whether the I/O module
is ready for reception and transmission of data or whether the I/O module has completed the
desired task or not. This long waiting of the processor deteriorates the performance of the
system.

To improve the performance of the system an alternative approach can be used where after
issuing the I/O command to the I/O module the processor can get itself busy doing some other
work. In this way, the valuable time of the processor can be utilized.

Functioning of Interrupt Driven I/O


In this section, we will study how with the approach of interrupt-driven I/O the data is
exchanged between memory and I/O through the processor. We will first see this entire
scenario from the I/O module’s point of view and then from the processor’s point of view.

Consider that the data has to be stored in the main memory from the I/O module as input from
the I/O module’s point of view.

1. For this, the processor issues a READ I/O command to the corresponding I/O module and
proceeds with some other useful tasks. It does not wait for the I/O module to get ready with
the desired data.
2. The I/O module then processes this READ I/O command and reads the data from the
addressed peripheral device. The I/O module stores the read data into its data register and
issues an interrupt signal to the processor over the control line in the system bus.

By sending the interrupted signal, the I/O module indicates the processor that now it is ready
for transmitting the data. But, the I/O module has to wait until the processor asks for the data
from the I/O module.

3. When the processor requests the data from the I/O, it places the data over the data line of the
system bus. Once the I/O module transfers the data to the processor it set itself ready for another
I/O transfer.

Now let us discuss this transfer of data between processor and I/O from the professor’s point of
view.

1. So let’s again start, to retrieve data from the I/O module the processor issues a READ
command and proceeds in doing something else.
For example, it starts executing some other program as it may be working on multiple
programs at a time.

2. As we know that whenever the processor is executing any program, after every instruction
cycle it checks for interrupts that have occurred. If it finds the pending interrupts it responds
and serves the occurred interrupt.

3. The moment processor finds the interrupts by the I/O module, it suspends its current
execution and saves the context (e.g., program counter, processor register) to serve the
interrupt.
~1--- I
PAGE No-'----,---, ___,__}
I V0
-

· • J_ 0

I -
ri
I •

Or -"J: 0 ·

~j
-; - . . -

1 I

,! PAGE No.
DATE

~-·= ==4 == = === =======n=,=======:=~===


d)J~nW h(~
('~) ~~Qj~r
QhR. · 5;~ IA,(,

1
;,;-----1+-:-r.- =±_/-J,Lo Qch~v~l~---1.l~iJ~oJu~·
1
c • 1kLJ W- ..
i

I
~i ~ - - f , - - - - ' - ' - ~ ~ ~ ~ ~ ~ ~ ~ ~ J _ J _ l . l 2 . - J , ~ ~' . - -- - - -

. t~
.- ----tt------.------- - - - , , - - - - - -- - - - - -- - - - -
I\

;~r.• - -f r___j__:..:::::::.._..'._l__J_J~~~-c::.~·~fCA~t=·v~t:..________
~,
,,.
:~ Tu' v\ M' -r o dJ.- iW
<: 11
'

& '
~-~:.;f:-- -'---ft--+'-'l--~1--'-_____f__l~~~~~~~~:::....J.__!_~~~~~~~)
' \J

cful
\1 --/~ - ---tt----'="-~- - = - ~ : . l - - - - -- - - - - - - ' - _ _ _ : __ __::::i___
,,
tt·

I
'<• -·~
· - --tt-::---:----:---~~--:-=..,___~7'--',-_!,c__i=._j~:::":'.'....._~li....J~~~
I
II
.--r--tPO
I ~1-PA_GE-,---
No•..L-I
I I

o.'>

s ·.
, I
I
I

00 Cl
' .

·L ---l--~ - - - - - - - - - --
I

'-'.....---Lf-L~ ~ ~ ~----;;----:-:----;-~~--=--
I
I ,i
\-
j
·, ---~~~~'.,_li~~c..t.------------~~IEr
-

,.__--lf--
i -

'
!
---.--~------- - - - - - ---i-
~ te:--

J
r- --ri-~-t~===-=l;:!.==:2:::=:f-- - - - - - - - -- -~
I

:' :-------1+-1-'~~.,__---~---_c..------------=- IQ
"I
J,
I
I,
.,
.----r---_L-~_Llc~~~~~~~-1----4-e.--- - -~ l[;-
' l
.,
:/_I
J(Ll~~- -~~l:.-
I

I
i ·;
1,
: - - - - - - 1 +! - - - - - . . L : , __:_L~~~,!.__..lL':::i-~~~~:.__,_- - - _ . : . . . . . c ·,
I
6
-~_,.-11,
L

--·
!
n---- -- - t ; - - - -___c,~:_u..:~~~~~LLL.~(}O~L-{~~(/\3~~:.__-.:._
·
fJ
. ", - - - -+ - - -- - ~ ~ ~ ~-..,--- - - ----'---~~~
.!1

i1 ~ - ~v==---~-;--:-'~---___:.--------~~ -----
, ~J..!·~~~i~e.'..,___~~ =~
L\

p;-
!,, -~ ---t-~,=.;;_...J.,...L'::~~~ ~ ~ ~_:,q~c~ce.,gg~
'
s. I
--
_ . - ~ - - - - -~ II._~

~-..
,J
_nJ- ~ -tt---r--=::-:,;"'=7s==-+~1'2-:R:-+
---:::B":JR
_N
I,

' ~·1
'
--:---tt------1==~~~~~=~===-====1=-~~-+--------'-' 1111 ..

.l -
--rr-12..-!-~ =~==--:;-~ - - - - - - : ; - - - : - - - - - -_:,.. t
· ~ - -r----_i....;__..t::.~~~~~.,___,.;iS~eJ1-~~~tt_mg~ _ _ _ :_'°'l) ~ 1
·i--- 1 1- - - - - - ~ - ~ - - - -~ll~
·_,.1
. - ---i:---- - - - -- - -- - - - - - ·
1J·i-.,..----r - --------'------"- -- ---:----- ...:...__._

1
i,:
1
.ri; =. ==r===== = = == == = == = ;=;
~PAGE I
l - -,.._J_
No.

I V

Jj

. '.J4tcl4l

akvice t
oleu \Ce.
I
I'
I
~ GE No. I
I. DATE I I
I

' . Lt

d ed .
.-L___~J2lli~QO'.~~~ ~~~~ak~v~~J.1.!_t...~~ --• ~ I : _ _ - - - l - \ -- - -

.~JIE:f- --~"---'--~
"-----. - - + 1 - - - - - - - - -- - -- -- - - - " \ o . -!~ ()
~ - ~~~====:=~~~~- - ~ - - - i r -- --p--,rll1....
. ;rJtt: Wtj~'
I_db~
r,-------+t-'--9-~~o!L.,_~~~...k.J,L~~~~~~-P~ ~ ~ ~~ llL: 11'.Y\lct!
t ; - - - _::-;-----ti_ _ _ _ _ _ _ _ _ _ __:____ _ __ _ _ ___.., JI[~ lwi.e MOM
~ ~ ~ ~====~~~~~~~~~~± ',,c_---:--:-;- . --:--.--:---:~ I[- _
~---
{.; -6 \
\I C
- ----++------:..___,._.;w.JU_'~~~~~~~~c'._'e_'+h~LLY~lit,k___ _ Jl(e II hY])'f- eO .
- ----t;-=--'--'--- - ' - " ' - " - - ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~-c:f'N-~~~~~~
-- .
I--t\ru_ 'v_
- --it_J£_C_~~~~
- ~ ~ ¼ ~ - - - - - - - ~- -- -~ -~ ll_~ -!----.~ IU_N_1~-x-
- ---tt-----~-,--------------__:_·_-t 1• ~- _--Y-tt-:\=======
\l ±hatg ·
- -tt--- - - - - - : _ _ _ - - -- -- -~ o \\ 9-k--hu
JI] C I r.rnp:rt
--:-,._-----;;------ - - ~ ~Jlt~ \\Q___s_ffiG
---r-----,;
- --tt-- - - - ~ - _ : _ _- - - - - - - -- - - - ~ j
- ----it-----'-_ _ ___:___-:--_ _ _ _ _ __ _ ____:~ -----
- i:, roo.
I\ii ' -
\\ (
- -1r- - - -- -- - -- - --~ -~ ~ · . . \
'; _
1

i
11
"02\Clch
1..,.i_ ._ \ a \ow
- --t-r-- - - - - - - - - - - - - - - - - - - ~ at \\ ~O~ I

111\~ 1.\ a~rz..


- --r-- - - - - - - - - - - - - - - - - - -·_,,.~
- -t--_ _ __ _ _ ___________· CJ• •::·~ \\'B' H
- --ti-- - - - - - - - - ~ ~ : . . _ : _ _ : _ ;
-,____,:-__ _ t 111 C \,'\~W
\~
- --ITl________ ___ ______,______C'llll. ~; \\p,u °-
====H1~=== = == = = == = = == = =11~ ' -~ k =
,: t;;;,, •
:A·
(i i i ~~"''~ ~~====r-
IL -
'
-. .:----
._: - + 1 - - -- -- - - -- - - --------;--------:-----;--:----:--- - -
- ; b~-- ---++------M~o~l~:....i.q_~~~~diJ.
:. :'. . ___...!l~~S'-"=-c.:.-=.W
.=.:._
v1 .:._
/1~'--"t-----'--;-t"'-=-=L.:

_, "_
·- --tt-==¥-1-~'----'.,d_~~~c~\.u.::.=...i.--'----'--'-'.:r=--- - - - -- - -- - -
0
ij .

\J

--..:. , ,,_1- - - i t -- - - - - - - - - - - - - - - - - - -
j
·~ ,; -----tt------=.JIL._.,ll,,.~~~~=-.!::.____::::...::;,.-=-=.
I
:.......!......~w==------'-u-'---'-I~
·_
I

i '-)

I ~r
- ---++--'<rr-=-'-'.----'-'--'~-=------=--..:....,__;_----L..::::...___,_~--'---""'--'~""-=-.,____,_=.+--:~--'-'-'-.>..Z..>;_-

-t-
; ---...::.:___--tt--"-:--~___,,_~-'---t'r-'---;.----,,,-"--'-;i--..........,._~,.J..-.L-lc-~~
.' - - - -~ ~---1----'-<::--.e...:..::_--'-'"-----'---'-=-;---'----'<::--=-=---"---'--'-----,,~"-::r'-----"--=---=....:s'-::,,l-+-c~::'....__!_..l.L_-,L.

~ :=-------1fl..=-~-~~,----'------'-'=-=----'----C.....:......___::---=--...!.....1__!.---=--=-=........!._~~
- -L..__ _

-------+l=::.........::::---=-...!_"7""1--Ll~==-------'----------

~----I+------=-----:----:---.---_.___-,--_ _ _ __
;~ Ave. C?J I~

~ - - ---U--'--- - - - - - - - - - - - -- -- - -
~ = ·= =¾==:;=== = = == = == = == = ===---==
l1
I
/, DATE I I

r~ f3o l't f~O f(O _ 110 I Kt


/0 ~·1a 90
-
50 ~o 7c go go lcfb f\O 0

0I . 4" l I ' •
I i . I

I' I/)- -·--·I


i j •
-
I

I
I
I
I I
I I .I I 1 I I I I I
I
I
i
I
I

I r

A"
1 TJ
,-.J
~ ,c:-n

I,- -
·I'

fJ 1------- bb
.I'. . ___ _ ____________ _ _____j__ '
,~
r---t,::>ft

I
I

- - -ri-- -~ -:::;:=r--T--:-.-;-:--,,- -- -----:--___::~ --:--- - -_:__,


- --rr;0.T11~~~~F:..1...!c...!~~~~~~µ ~~~m_-1£!2.JQ_~-~

=
I ·
..· -

' \
0,m~
0
.
u-t·- · ---tt--:......:c....cc....__~ - ~--------=---__,_____._---"--+-r-----'--+--- --'<:--e-Y--'---'---~--=--

CC IS
a± lo
/

I .
0
' • I

I v•.
I~
-J-+---+----H--- - - - - ~ - - - - : : , - - - - - - - - - - - - ,
' _.I;.._- - - + - - - - + + - - - - - -- - + - - = - - - - - - - - - - - - - - ,
I o__· - - t - - - t t - - - - - - -~ - : - ---;i:;--r-- - - - - - - - - - - i
I~-- -l - - - - 1 + - - - - - - - - - ~ ~ - - - - - - - - - - - - - 1
I~
r-3----+---+t--~-----'----------~
§ -.- - + - - - - f + - - - ~ 1 - - -- - - - - - - - - - - - J
~ --=--'---+--++--~~-- - - ' - - - - - c . . ._ _ _1
-=.:>
, .

SY·
* AGENo.1
DATE I I
WAA,l_ o 1- o / 5"'o '.36 2. { ~, I~

= L44 ,

t.
,, - 1

o_j2 ti t"D/2_ /I • ()

I t1. ell . -

m '.
S~t-i :: 60

C)
. o 140 ts'V l~o /70

- --+----tt-- - ~ - - - L . . - + - ~ - - - - - - - - - - - -
J,~
~,-----il---H-------~~'-------------
\l - .

\l,
l

, :.a .JI
f'"'I
DATE I I

i = 3'5"·

I FlfS

'"Y\J I
,, ' ' ,, . . ..

t ,i ;Ii

,,1

IMAc
:~ILL
Ja.
. . . ., . .

,_____.,.-,---,I
_J>,\
h'/
lJ.J_}JJ- l'>r:---'-1o;;-t....-,--,-,~_ /

\..---+-'r--l-tt1-t-+hf'r--4.t--e-ci~~-rri:+-+-b'--'-i/Y.,l----""H:r---Hf-lf--l-H,l---j2"0 13 ° J 4 ° I S>'1:l l' D 17<> l 11

'
'

8 - - - + ----tt--------t------::.,::"----'-
,•._ _ _ _ _ _ _ _ _ _ _ _ _ ___,:_

8Fl:--
--'-----tt----------.J.
. ------tt-------rr----~---
Sc~/,' . . _ __
___:,-, - - -tt--------~--r-~~_..__.__.__,__-=-----'___,;;;::_~...!....-..l...,_..:...

::::2~
.-- - -+t--- - ; - - - - - - - - ' " t " - - - : - - - - - - - - ; - ~ - - - ~ . J - - - - -
IUW "(Y)ove__ 1YLQ
I: - 4 2 · 5" TI I N,Wc}. '
I

I Go

GO .

4()
\

-= 6 C + I 5" +- 6 + Q..-o 4-- SS 2 It 4

0
..

T o. MJ._ ·, - o )2 6
I Jo
- 4 l._ 0

. <YO

II
--.l. ·-
lll) - ., ·-

Bll-·'
-----tt-.....::.....L..~~~-=-i~~~'...____::!~~~~~~~....:....:::...'-'-=-=--------;~~ 1nt• _.- -
- --,-,.-,-,---_'--'------=--f----'-0'~~~· :::::::_:_~.!..1._-o....!....:i
· '~c.....::....!-!...L...-1,L.~-'-=---~~=---=~ m-.•:-
---;-;-
I ~ ~ ~ - - - - ' - ' - " - - = ~ = . = . . : U , ~ 4 - L = ~ ~ ~ ~ ~~ ~

- - - - - - -I , - ; - - ~ ~ - - ' ~ ' - - - - ' - - =


• ~ = - = ' - - - - - - - - - - - - . . - - .- - II] -C
II . --
>- -

- - - - - - - - + + - - - - - - - - - - ' - - " ' - ' - ' - = - - - ' - : . . . . . , . . £ J - - - _ ; _ _ . . ; _ _ _ _ _ : , . _ _ _ _ , . , ' - = - ' - - ' - ~' - f - " - " ' ~ - " - - = -=---c.._
- - .. -

- ~ - ,-
- ---tt-~~-~'---=---=-=:,_....:....:...=_~-=i-==~--------~-- =-1[• '>·- . -
----tt----+-=-...,_,.,__-=---=-='---'r'r-'-'-----===---:-'-'-'-r---~..:._
- ~'----,---,,,-------=-~ If-« -
- ---+t--U-r--=-:....,~_,____;_.jc...=.....;_""--f-----=...:..,:~~0~t::---""=-:..L...!.~_____J_-'----=-JL~~~
~ 11-. .-
. ~ll":_

·~--
-~a-tr--~-~-c~k-l-,-P-l_'.._1t:--0-q~,~.-----;------ -- ~ - ~ -

t;'--~-~-
==========-=--=--=--=--=--=---:-:-b__;_·-=--=-~-:-=-~-=--=--~~-0=-.,-1:.,...:....::1-e::(:;::::~::~·1~b~ 9._J-'----'.
___..~

-----tl~~~~-;---"--'-tt-'----'--L-.C=f---"--':::..=:=..:::..~~~~l11--~.,---~
--~--'-~--;-=-"~:-:---'--'~~-=-~~~~=-=-·--=--~~~~~Lct>~d
. .::_l!,,_____~~~~(JJ~Vlf~I
---t;-"-=---;"-'--'-~~'-7----'~~,<__L..::=---==--·_!_ ~.__c-,llr~ ; -
0 2.-o gO 34- a.Jul.... ~ :..--
:
- 'Li 1L_
--~~---------~-:___-~---- - ·t;_
1
llal;\
=====#,======. = == == == = =====1:f
::;:=:
,. • 1;\_
L ~ z sf ~ .
Li.&l- oi C~i
- ~'

1
'
. .
~! -----tt---"-----"'--'-;-=--..::__--L...:....!.._=-=-=----.:...i......:--=---'-""-='---=,,,=-,:,.__,,__,_,,,c,,,::,;,_-=-=--_____:_____,,.~....._,__,__."'---"---'-'=------
-;'--
l

1 _ _--tt-t-'--~._._._~ ~~~~---=~~~~~-----~~---·

~;-

t J;; _ _ . C D, "I 6y .
ri J!,~c . r q,vLOf. .s
--"'-tt-f--'--'--'---'-"'---'---->....__,,__-'--'----=----=--.c_----"'---...,_,__,c____ _
C) <S . •
---,~ti).J---
L Ji·

t ~-============--==--=-=
-=-=
-=-=
-=-=
-=-=
-=-=
-=-=
-=-= -=:_=
-=-~ -=-=
-=~-"'-s--_
t- -_---+ -...-H-,__
-_ -
H-
1 ,:, - - ---t+---t------------- -; :, =-- ----+----

,~
l o -, --=----++--+---,--- - -- - - - - - - t - - - - -
1~ -:--!.--- - - t t - - H - ~ ~ - t - - t - t i - t - . ~ ~ : r - H
-:-) ,:
l------l+----j~H-~-f-f--t-:r-t,-~r--t'"'"it~~~~r-t-~'t-----
.--r-t-:- '1°- - + - t - t - , - f - - - + - - - - -

2.i-:·---!i~+----:-,;::===================,_=
: :-~;:::---.==~~:::.==- 1 - - - -
- l~
0
,(,,oEN° \
I1,, <\§" I I I J> e-u
-, =~ =#==~ = ==== == =======~ ~-~ la
+-----~--tt--=~~k~'lll
~_u_~lo~c __,Lb_li~~t~·~.-- - - - - -- - -~[
1

. - - - ' - - I + - - - -- - - - - - -~ ~ ~ ·~ ~ ~ ~~
- - - - i P ~ ~ ~: J . . . 0 , , . - ~ ~ ~ ~ _ _ L l L _ _ j , , _ ' . ~ ~ L S - - ~ ~ ~+--___.;c...-
"- ~ ,

.---+l---..!~,J__J__.!~ ~ ~ ~ ~ : J _ _ Y . . . : ~ ~ ~ ~ ~ l - - ' ~~~~-----"'


c :11

'-'-c JI
.l; c,
'. "
ti

:------tt-->-=-=-=---__!_~~~~~LJ~~~~~~J.~-~ ~ ~ . . . . L - - - ~ 11

r====::::.::~=~-=-~~:~~::~~~~-=-~:_-~-~-·~-~-~-~-~-~-~- - =~
~ II

;, +------tF~~~~~~~~:.L-!:~u:..-~~a~G~2.!:!:~-____, -11

r
~{
Ji-~ ---tr~~~~~~~~~~~--------,"" I
.~'JI
--- ]
tl, . ~_J

*f
,~t:,..]
cl
II
; -'..----(-
- ~\"'ill--Wtt\"?~~~t::tH~7rt-fW-f4-t--l-+~--14~lw_J__~-
~j

il ~I
.l r =-c

1~
_
.- ~-" r~:==
--;;-1>"-rr1t---- 1: :.:0: .==1~;
. ~-=-:--:}---;--=- -:--
--=-- ---=--_------
--=--==: r.- ;--:~
- -~- -_
=
- -~=--=--===
-=-=
---- _.1_-.

You might also like