0% found this document useful (0 votes)
18 views9 pages

C Hardware

Uploaded by

rajendhar Varma
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)
18 views9 pages

C Hardware

Uploaded by

rajendhar Varma
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/ 9

SECTI

ON-B

11ANS)DOSPl
usI
nter
rupt
s
Manyuser swil
lfi
ndt hatani nt
imateknowledgeofDOSi nter
rupt
sisnot
neededifuseisconf i
nedt oreadywrit
tenapplicati
onsormany
progr
ammi nglanguages.Foruser swhowr it
et hei
rownpr ogramsinone
ofthemanyi nt
erpretedorcompi ledhi
gh-levellanguages,suchcommon
faci
li
ti
esaswi l
lber equir
edf ormostprogram operati
onswi l
lbeprov
ided
eit
herintheform ofsingleinstr
ucti
ons,orli
brarysubrouti
necall
s
provi
dedwi t
hthelanguagepackage.

Whenani nterr
uptoccurst hepr eparatoryact ionsaremuchl i
ket hosein
theBBChost .Processorregistersaresav edandt her
eturnaddressis
pushedont hestack.Aseachi nt err
upti sallocat edapri
ori
tycategory,al
l
i
nterr
uptsofanequalorl owercat egoryar emaskedout .However ,hi
gher
pri
ori
tyint
erruptsarestil
lpermi tt
ed, t
her efore,ifoneoftheseshoul d
occur,
thehigherpriori
tyinterr
uptwi llinterruptanearli
eroneofl ower
pri
ori
ty.

Asment ionedabov e,theverymuchl ar


germemor yavail
abletoDOS
systemsper mitstheluxuryof,
compar edt o6502sy st
ems, effecti
vel
y
unli
mi t
edst ackspace.Thisinturnpermi t
sahi erarchi
calinterrupt
phil
osophy .Suff
iceittosaythat,i
fonei nterr
uptshoul dneedt ocutacross
theprocessingofanot her
,ther
ei ssuff
icientspacet opermi tallpr
ocessor
regi
stersanddat atobesav edfrom thefirstint
erruptintheusualway ,so
thatit
sprocessingcanr esumenor mallyaf t
erthatofthehi gherprior
it
y
int
erruptiscompl et
e.

Essenti
allyint
err
uptsfal
lint
ooneofthreecategori
es.Thoughtheact
ion
takenwithinDOSf ol
lowsasimi
larpat
hr egar
dlessofthesourceandt
y pe
ofint
errupt.

I
nter
nalHar
dwar
eInt
err
upt
s
Thesear egenerat
edbycer t
ainunexpectedeventsencounteredbythe
processorduringprogram executi
on,suchasat t
emptingtodivideby
i
nternalhardwareinterr
uptsare,perhaps,mosteasi
lyrelat
edt otheBRK
handli
ngr out
inesoft hehost,asbothrepresentanir
recoverabl
eerror
.

Ext
ernalHar
dwar
eInt
err
upt
s
Thesear einterr
upt sgener at
edbyper ipheralhar
dwar eactivi
ty,
most
easil
ythoughtofl iket heactionsperformedbyt hehostpr ocessorduri
ng
IRQ1Vpr ocessing,forex ampl e,
becauseofakey press.I
nat ruePCt hese
i
nterruptsaret r
igger edbyaphy sicaldevicecontrol
lersi
gnalli
ngt heneed
forservi
ce,theav ailabil
it
yofr et
urneddat aorthecompl eti
onofanact ion.
Inmachi nessoequi pped,the8087mat hsco-processorisanot hersource
ofexternalinter
rupts.

Sof
twar
eInt
err
upt
s
Thesei nter
ruptsar egeneratedbyusercode(orDOSi t
self
)byissui
nga
directint
erruptcalltorequestthatanOperat
ingSyst
em functi
onbe
carriedout.Directuser-call
edinter
rupt
saregeneral
lyofthelowest
priorit
y,t
hought heseinterrupt
smaycausehi gherpr
iori
tyint
err
uptsasa
resultoftheact i
onoft hehardwarefuncti
oncall
ed.

12ANS)DOSmemor
ymanagement
 r
efer
stosof
twar
eandt
echni
quesempl
oyedt
ogi
ve
appli
cat i
onsaccesst omor ethan640  kibi
by t
es (640* 1024by tes)(kiB)of" conventi
onal
memor y".The640Ki Bl i
mitwasspeci fi
ctot heIBM PCandcl osecompat i
bles;ot
hermachines
running MS-DOS  haddi ff
erentl imit
s,forexampl ethe Apr i
cotPC  couldhav eupt o768Ki Band
the 
Si r
ius Victor9000, 896Ki B.Memor ymanagementont heIBM f ami lywasmadecompl exby
theneedt omai ntai
nbackwar dcompat ibi
li
tytot heoriginalPCdesi gn[1] 
and real
-mode DOS,
whileallowingcomput eruser st otakeadv antageofl argeamount sofl ow-costmemor yand
newgener ationsofpr ocessor s.SinceDOShasgi v
enwayt o 
Mi crosoftWi ndows andother32-
bitoperat i
ngsy stemsnotr estrict
edbyt heor i
ginalarbitrary640Ki Bl i
mi toftheIBM PC,
managi ngt hememor yofaper sonalcomput ernol ongerr equirestheusert omanually
mani pulateinternalsetti
ngsandpar ametersoft hesy stem.
The640Ki Bl
imiti
mposedgr
eatcomplexi
tyonhar
dwar eandsof
twareintendedtoci
rcumventit
;
thephy
sicalmemoryinamachi
necouldbeorgani
sedasacombi nat
ionofbaseorconv ent
ional
memory(incl
udingl
owermemory)
,uppermemory,hi
ghmemor y(notthesameasupper
memory),ext
endedmemory,
andexpandedmemor y,
allhandl
edindif
ferentways.

Conv
ent
ionalmemor
y
The Int
el8088  processorusedi ntheor i
ginalI
BM PChad20addr essl i
nesandsocoul ddirect
ly
address1Mi B( 220 
bytes)ofmemor y.Diff
erentareasofthisaddressspacewer eall
ocatedto
dif
ferentkindsofmemor yusedf ordiff
erentpurposes.Star
ti
ngatt helowestendoft headdress
space,thePChadr ead/ wri
te random accessmemor y 
(RAM)installed,whichwasusedbyDOS
andappl i
cationpr ograms.Thef ir
stpartoft hi
smemor ywasinstall
edont hemot herboardofthe
system (i
nv eryear lymachi nes,64Ki B,l
aterrevi
sedt o256KiB).Addi ti
onalmemor ycouldbe
addedwi thcardspl uggedintot heexpansionslots;eachcardcont ainedstrapsorswitchesto
controlwhatpar toft headdr essspaceaccessesmemor yanddev icesont hatcard.

Uppermemor
y
Theuppermemor yarea(UMA)referstot headdressspacebet ween640Ki Band1024Ki B
(0xA0000–0xFFFFF).Three128KiBr egionsweredef i
nedi nt hisarea.The128Ki Bregion
between0xA0000and0x BFFFFwasr eservedfor v
ideoadapt er  scr
eenmemor y.Thephy si
cal
addressspacebetween0xC0000and0x DFFFFwasr eser vedf ordevice BI
OS ROMs, andspecial
RAM usuall
ysharedwi thphysi
caldevices(forexampl e,sharedmemor yfora 
networ kadapter
).
TheIBM PCr eser
vedt heupper
most128Ki Boft headdressspacef rom 0xE0000t o0xFFFFFfor
the 
ROM BIOS and Cassett
eBASIC read-onlymemor y(ROM) .
14ANS)  a 
fil
esy stem or 
fi
lesystem (oftenabbrevi
atedto 
fs)contr
olshowdat ais stored and
ret
rieved.Wi t
houtaf il
esystem, dataplacedinast oragemedium wouldbeonel argebodyof
datawi t
hnowayt otel
lwher eonepi eceofdatastopsandt henextbegins.Bysepar atingthe
dataintopiecesandgi v
ingeachpi eceaname, thedataiseasil
yisolat
edandi dentif
ied.Taking
it
snamef rom thewaypaper -baseddat amanagementsy st
em isnamed, eachgr oupofdat ais
call
eda" f
il
e."Thest r
uctureandl ogi
cr ulesusedtomanaget hegr oupsofdataandt heirnames
iscall
eda" f
il
esy stem."
Therearemanydi ff
erentki
ndsoff i
lesyst
ems.Eachonehasdiffer
entstr
uctur
eandl ogi
c,
propert
iesofspeed,fl
exibi
li
ty,
securit
y,si
zeandmor e.Somefi
lesyst
emshav ebeendesigned
tobeusedf orspecif
icappl
icati
ons.Forexampl
e,the I
SO9660 
fil
esystem i
sdesigned
specif
ical
lyfor
 opt
icaldi
scs.
Filesystemscanbeusedonnumer ousdifferentt
ypesof 
stor
agedev i
ces t
hatusedif
fer
ent
kindsofmedi a.Asof2019,  har
ddiskdr iv
es havebeenkeystoragedevicesandareproj
ect
edto
remai nsofortheforeseeablefutur
e.[
1]
 
Otherkindsofmediathatareused
i
ncl ude 
SSDs, magnetictapes,andopt i
caldiscs.I
nsomecases, suchaswi t
h t
mpfs,t
he
comput er'
smai nmemor y( r
andom-accessmemor y,RAM)isusedt ocr
eateat empor
aryfi
le
system forshort-t
erm use.
Somef i
lesy st
emsar eusedonl ocal 
dat astoragedevices; [
2]
 
othersprov idefi
leaccessv i
a
a networkpr otocol (
forexample, NFS, 
[
3]
SMB, or  
9P cl
ients).Somef i
lesy st
emsar e"vir
tual"
,
meani ngt hatthesuppl i
ed" f
il
es"(call
ed  vi
rtualfil
es)arecomput edonr equest(such
as procfs 
and sy sfs)oraremer elyamappi ngi nt
oadi ff
er entf i
lesy st
em usedasabacki ng
store.Thef il
esy stem managesaccesst obot hthecont entoff i
lesandt he metadata 
about
thosef i
les.Iti
sr esponsibleforarrangingst oragespace; rel i
abili
ty,effi
ciency,andtuningwith
regardtot hephy si
calstor
agemedi um ar eimpor t
antdesi gnconsi derat
ions

15ANS)VI
DEOMONI
TORORA 
comput
ermoni
tor
 i
sanout
putdev
icet
hatdi
spl
ays
inf
ormat ioninpi ctor
ialform.Amoni torusual l
ycompr isest he v
isualdisplay, 
cir
cuit
ry,casi
ng,
and powersuppl y.The displaydev i
ce i
nmoder nmoni torsist y
picall
ya  t
hinf i
lmtransi
storl
iqui
d
crystaldispl
ay  
(TFT-LCD)wi th 
LEDbackl i
ghting hav
ingr eplaced cold-cathodef l
uorescent
lamp (CCFL)backl i
ghting.Ol dermonitorsuseda  cathoder aytube (CRT) .Moni t
orsare
connect edtot hecomput erv i
a VGA, 
DigitalVisual
Int
erface (DVI), 
HDMI , 
Display Port

Thunder bolt

low-voltagedi ff
erentialsignali
ng (
LVDS)or
otherpropr i
etaryconnect orsandsi gnals.
Or i
ginally
,comput ermonit
orswereusedf or 
dataprocessing 
whi
le t
elevi
sionsets 
wer
eusedf or
entertainment .From the1980sonwards,comput ers(andthei
rmonitors)havebeenusedfor
bothdat apr ocessingandentertai
nment,while 
tel
ev i
sions 
havei
mplement edsomecomput er
functionalit
y.Thecommon  aspectrat
io 
oftel
evisions,andcomputermoni t
ors,
haschanged
from 4:3t o16: 10,to16:9.
Moderncomput ermonitorsareeasil
yinter
changeabl
ewithconvent
ionaltel
evi
sionsetsand
vi
ceversa.Howev er
,ascomput ermonitorsdonotnecessar
il
yincl
udeintegrat
ed speaker
s nor
TVtuners(suchas Di
gitalt
elevi
sionadapters)
,itmaynotbepossi
bletouseacomput er
monit
orasaTVsetwi thoutexter
nalcomponent s
Earl
y elect
roniccomputers werefitt
edwi thapanelof 
li
ghtbul bs 
wher ethest at
eofeach
part
icularbulbwouldindicatetheon/ offstat
eofaparticular 
regi
st erbit 
insi
det hecomput er.
Thisallowedtheengineersoper ati
ngt hecomputertomoni t
orthei nternalstateofthemachi ne,
sothispaneloflight
scamet obeknownast he'monit
or'.Asear l
ymoni torswer eonlycapable
ofdisplayi
ngav eryl
imitedamountofi nformati
onandwer everyt r
ansient ,t
heywer erarely
consideredforprogr
am out put.I
nstead, ali
nepri
nterwast hepr i
mar yout putdev i
ce,whilethe
moni t
orwasl imit
edtokeepi ngtrackoft heprogr
am'soper ati
on.[
2]

Ast
echnol
ogydevelopedengineer
sr eal
izedt
hattheout
putofaCRTdi spl
aywasmoreflex
ibl
e
t
hanapanelofl
ightbulbsandeventuall
y,bygi
vingcont
rolofwhatwasdispl
ayedi
nthe
pr
ogr
am i
tsel
f,t
hemoni
tori
tsel
fbecameapower
fulout
putdev
icei
nit
sownr
igh

18ANS)A 
clockgener
ator
 i
san 
elect
roni
cosci
ll
ator
 (
cir
cui
t)t
hatpr
oducesa 
clocksi
gnal
 f
or
useinsynchronizi
ngacircuit
'
soperat
ion.Thesignalcanrangefrom asi
mple
symmet r
ical
 squarewave t
omorecompl exar
rangement s.Thebasi
cpartst
hatal
lcl
ock
generat
orssharear ear
esonantci
rcui
tandanampl i
fi
er.
Theresonantcir
cuiti
susuall
ya 
quar
tz 
piezo-el
ect
ri
c osci
ll
ator
,al
thoughsi
mpl
er 
tank
ci
rcui
ts 
andev en 
RCcircui
ts 
maybeused.
The 
amplif
ier 
cir
cui
tusual
lyinvert
sthesi
gnalf
rom t
heosci
ll
atorandf
eedsapor
ti
onbacki
nto
theosci
ll
atort
omai nt
ainoscil
lat
ion.
Thegeneratormayhav eadditi
onalsect
ionstomodi f
ythebasi
csignal.The 
8088 
forexample,
useda2/3 dutycycle 
clock,
whichrequi
redtheclockgenerat
ortoincorpor
atel
ogictoconvert
the50/
50dut ycyclewhi chi
stypi
calofrawoscil
lators.
Othersuchopti
onalsecti
onsincl
ude f
requencydivi
der 
or cl
ockmulti
plier
 secti
ons.
Programmableclockgenerat
orsall
owt henumberusedi nthediv
iderormul ti
pli
ertobe
changed,al
lowi
nganyofawi dev ar
iet
yofout putf
requenciest
obesel ectedwithoutmodi
fyi
ng
thehardwar
e.
Theclockgener
atorinamot herboardi
softenchangedbycomputerent
husiast
stocont rolt
he
speedofthei

CPU,  
FSB,
 GPU and RAM.Typicall
ytheprogr
ammablecl
ockgeneratorissetby
theBIOSatboottimetotheselectedval
ue;althoughsomesyst
emshave dy
nami cfrequency
scal
ing,whi
chfrequentl
yre-programstheclockgenerator
.

1.Ani
nputt
imi
ngi
nter
facet
hataccept
sDS1orCCi
nputsi
gnal
s.

2.Ati
ming-generat
ioncomponentt
hatcr
eat
est
het
imi
ngsi
gnal
susedbyt
heout
put
ti
ming-di
str
ibuti
oncomponent.

3.Anoutputti
mingdi
str
ibut
ioncomponentt
hatut
il
izest
het
imingsi
gnal
sfr
om t
het
imi
ng
-generat
ioncomponentt
ocreatemult
ipl
eDS1andCCoutputsi
gnal
s.

4.Aper
formance-moni
tor
ing(
PM)componentt
hatmoni
tor
sthet
imi
ngchar
act
eri
sti
csof
thei
nputsi
gnals.

5.Anal
armi
nter
facet
hatconnect
stot
hecent
ral
-of
fi
ce(
CO)al
arm-moni
tor
ingsy
stem.

6.Anoper
ati
onsinter
facef
orl
ocalcr
aft
sper
sonuseandcommuni
cat
ionswi
thr
emot
e
oper
ati
onssystems.

Sect
ionC
Answerany3quest
ions.Eachquest
ioncar
ri
es10mar
ks.(
3x10=30mar
ks)

19ANS)  DMA standsfor“Dir
ectMemoryAccess”andi samet hodoft r
ansfer
ri
ng
datafrom t
he computer‘

RAM  t
oanotherpartofthe 
computer 
wit
houtprocessi
ng
i
tusi ngthe 
CPU.Whi lemostdat at
hati sinputoroutputfrom your
 computer 
is
processed by the 
CPU,some dat a does notr equi
re pr
ocessing,orcan be
processedbyanotherdevice.
Inthesesit
uati
ons,DMAcansav eprocessi
ngtimeandisamoreef
fi
cientwayto
mov edatafrom t
hecomput er
’s 
memory t
ootherdevi
ces.I
nor
derf
ordev i
cesto
usedirectmemoryaccess,t
heymustbeassignedtoaDMAchannel
.Eachtypeof
por
tonacomput erhasasetofDMA channel st
hatcanbeassi
gnedt oeach
connecteddevi
ce.Forexampl
e,aPCIcont
rol
lerandahar
ddr
ivecont
rol
lereach
havetheirownsetofDMAchannel
s. 

 
Forexample,asoundcar dmayneedt oaccessdat astor
edinthecomput er
’sRAM,
butsinceitcanprocessthedat ait
self
,itmayuseDMAt obypasst he 
CPU.Video
cardsthatsuppor
tDMAcanal soaccesst hesyst
em memor yandpr ocessgraphi
cs
withoutneedingt
heCPU.Ul t
raDMAhar ddr i
vesuseDMAt otransferdatafast
er
thanprevi
ousharddrivesthatrequi
redthedatatofir
stberunthrought heCPU.

Analt
ernativetoDMAi stheProgrammedI nput
/Out
put(PIO)inter
faceinwhichall
data transmi t
ted bet ween dev ices goes t hrough t he pr ocessor. A
newer
 protocol 
fortheATAIIDEint
erfacei
sUl t
raDMA,whichpr ovi
desabur stdat
a
tr
ansf
errateupt o33mbps.Har ddrivest
hatcomewithUltraDMAl 33alsosupport
PIOmodes1, 3,and4,andmultiwordDMAmode2at16. 6mbps.
DMATr
ansf
erTypes

Memor
yToMemor
yTr
ansf
er

Inthismodebl ockofdataf rom onememor yaddr essismov edtoanot hermemor y


address.I nt hismodecur r entaddr ess r
egister 
ofchannel0i susedt opoi ntthe
sourceaddr essandt hecur rentaddressr egisterofchanneli susedt opoi ntthe
destinationaddr essinthef i
rsttransfercycle,databy t
ef rom thesour ceaddr essis
loadedi nt het empor ar
yregi steroft heDMA cont r
oll
erandi nt henextt r
ansfer
cyclet hedat af rom thetempor aryregisterisst oredi nt hememor ypoi ntedby
destination addr ess.Af t
er each dat at ransfer current addr ess r
egisters 
are
decrement edori ncrementedaccor dingt ocur r
entset t
ings.Thechannel1cur r
ent
wor dcountr egisterisal
sodecr ement edby1af tereachdat atr
ansf er.Whent he
wor dcountofchannel1goest oFFFFH,aTCi sgener atedwhi chact i
vatesEOP
outputt erminatingtheDMAser vi
ce.
Aut
oini
ti
ali
ze

In thi
s mode, dur ing the i nit
ial
izat
ion the base addr ess and wor d
count
 r
egi
ster
s ar
el oaded si
mul t
aneously wi
tht he cur
rentaddress and wor
d
count
 r
egi
ster
s bythe micr
oprocessor.Theaddr essandt hecountint hebase
r
egi
ster
sremai
nunchangedt
hroughoutt
heDMAser
vice.
Afterthefirstblocktransf
eri.e.af
tert
heactivati
onoftheEOPsi gnal
,theori
ginal
valuesoft hecur rentaddr
essandcur rentwordcountregister
sar eautomati
cally
restor
edf r
om t hebaseaddr essandbasewor dcountr
egisterofthatchannel
.After
autoiniti
ali
zationt hechannelisreadyt operfor
m anotherDMAser vi
ce,without
CPUi nter
vent i
on.
DMACont
rol
ler

Thecont roll
eri sintegratedi ntot hepr ocessorboar dandmanagesal lDMAdat a
transfer
s.Tr ansferri
ngdat abet weensy stem memor yandan110dev icer equires
twost eps.Dat agoesf rom t hesendi ngdev i
cet ot heDMAcont roll
erandt hent o
ther ecei
v i
ngdev i
ce.The  micropr ocessor  gi
vest heDMA cont roll
erthel ocat i
on,
dest i
nati
on,andamountofdat at hatist obet ransf err
ed.Thent heDMAcont rol
ler
transfer
st hedat a,all
owi ngt hemi croprocessort ocont i
nuewi t
hot herprocessing
tasks.Whenadev iceneedst ouset heMi croChannelbust osendorr eceiv edat a,
i
tcompet eswi thallt
heot herdev icest hatar etryi
ngt ogaincontrolofthebus.Thi s
processi sknownasar bitrati
on.TheDMAcont r
ollerdoesnotar bit
rateforcont rol
oft heBUSi nstead;theI/ Odev i
cet hati ssendingorr eceivi
ngdata(theDMAsl ave)
partici
patesi narbitr
ati
on.I tistheDMAcont r
oller,howev er,t
hattakescont r
olof
thebuswhent hecentralar bitr
ationcont rolpointgrantstheDMAsl ave’srequest.

21ANS)Af il
eisanamedcollect
ionofrelat
edinfor
mationthati
srecordedon
secondarystor
agesuchasmagnet i
cdisks,magneti
ctapesandopticaldi
sks.I
n
general
,afil
eisasequenceofbits,
bytes,l
inesorr
ecordswhosemeani ngis
defi
nedbyt hefi
lescr
eat
oranduser .
Fi
leSt
ruct
ure
AFil
eStructur
eshoul
dbeaccordi
ngt oarequi
redf ormatthatt
heoper
ati
ngsyst
em
canunderst
and.Afi
lehasacert
aindefi
nedstructureaccordi
ngtoi
tst
ype.At
ext
fi
lei
sasequenceofcharact
ersorgani
zedint
ol i
nes.
Asour cefi
leisasequenceofpr oceduresandfuncti
ons.Anobjectf
il
eisasequence
ofbytesorganizedi
ntoblocksthatareunderstandabl
ebyt hemachine.
When
operati
ngsy st
em defi
nesdiff
erentfil
estruct
ures,i
talsocontai
nsthecodeto
supportthesefil
estr
uctur
e.Unix,MS-DOSsuppor tminimum numberoffi
le
str
ucture.
Fi
leType
Fi
letyperef
erstotheabil
it
yoftheoper
ati
ngsystem t
odist
ingui
shdi
ff
erentt
ypes
offi
lesuchastextfi
lessourcef
il
esandbi
naryfi
lesetc.
Manyoper
ati
ngsy
stemssuppor
tmanyt
ypesoff
il
es.
Oper
ati
ngsy
stem l
ikeMS-DOSandUNI
Xhav
ethef
oll
owi
ngt
ypesoff
il
es−
Or
dinar
yfi
les
•Thesear
ethef
il
est
hatcont
ainuseri
nfor
mat
ion.
•Thesemayhav
etext
,dat
abasesorexecut
abl
epr
ogr
am.
•Theusercanapplyvar
iousoper
ati
onsonsuchf
il
esl
ikeadd,
modi
fy,
del
eteor
evenr
emov etheenti
refi
le.
Di
rect
oryf
il
es
•Thesef
il
escont
ainl
istoff
il
enamesandot
heri
nfor
mat
ionr
elat
edt
othesef
il
es.
Speci
alf
il
es
•Thesef
il
esar
eal
soknownasdev
icef
il
es.
•Thesefi
lesr
epr
esentphy
sicaldev
icel
ikedi
sks,
ter
minal
s,pr
int
ers,
net
wor
ks,
tape
dri
veetc.
Thesef
il
esar
eoft
wot
ypes:
a.Char
acterspecialf
il
es:dat
aishandl
edchar
act
erbychar
act
erasi
ncaseof
ter
minal
sorpr i
nters.
b.Bl
ockspeci
alf
il
es:dat
aishandl
edi
nbl
ocksasi
nthecaseofdi
sksandt
apes.
Fi
leAccessMechani
sms
Fil
eaccessmechani
sm r
eferstothemannerinwhi
cht
her
ecor
dsofaf
il
emaybe
accessed.Ther
ear
eseveralwaystoaccessf
il
es:
•Sequent
ialaccess
•Di
rect
/Random access
•I
ndexedsequent
ialaccess
Sequent
ialaccess
Asequentialaccessist
hati
nwhichther ecor
dsareaccessedinsomesequence,
i
.e.,t
heinformati
oninthefi
lei
sprocessedinorder
,onerecordaft
ertheother
.This
accessmet hodisthemostpri
mit
iveone.Example:Compiler
susuall
yaccessfi
les
i
nt hi
sfashion.
Di
rect
/Random access
Random accessf
il
eor
gani
zat
ionpr
ovi
des,
accessi
ngt
her
ecor
dsdi
rect
ly.
Eachrecor
dhasi t
sownaddressonthef
il
ewi
thbyt
hehel
pofwhi
chi
tcanbe
di
rect
lyaccessedforr
eadi
ngorwri
ti
ng.
Therecor
dsneednotbeinanysequencewi
thi
nthef
il
eandt
heyneednotbei
n
adj
acentl
ocat
ionsonthest
oragemedium.
Indexedsequent
ialaccess 
Thi
smechani
sm i
sbui
ltuponbaseofsequent
ial
access.
Ani
ndexi
scr
eat
edf
oreachf
il
ewhi
chcont
ainspoi
nter
stov
ari
ousbl
ocks.
I
ndexi
ssear
chedsequent
ial
lyandi
tspoi
nteri
susedt
oaccesst
hef
il
edi
rect
ly.
SpaceAl
locat
ion
Fil
esareal
locat
eddi
skspacesbyoperati
ngsystem.Operat
ingsy
stemsdepl
oy
fol
lowi
ngthreemai
nwaystoall
ocatediskspacetofi
les.
•Cont
iguousAl
locat
ion
•Li
nkedAl
locat
ion
•I
ndexedAl
locat
ion
Cont
iguousAl
locat
ion
•Eachf
il
eoccupi
esacont
iguousaddr
essspaceondi
sk.
•Assi
gneddi
skaddr
essi
sinl
inearor
der
.
•Easyt
oimpl
ement
.
•Ext
ernalf
ragment
ati
oni
samaj
ori
ssuewi
tht
hist
ypeofal
locat
iont
echni
que.
Li
nkedAl
locat
ion
•Eachf
il
ecar
ri
esal
istofl
inkst
odi
skbl
ocks.
•Di
rect
orycont
ainsl
ink/poi
ntert
ofi
rstbl
ockofaf
il
e.
•Noext
ernalf
ragment
ati
on
•Ef
fect
ivel
yusedi
nsequent
ialaccessf
il
e.
•I
nef
fi
cienti
ncaseofdi
rectaccessf
il
e.
I
ndexedAl
locat
ion
•Pr
ovi
dessol
uti
onst
opr
obl
emsofcont
iguousandl
inkedal
locat
ion.
•Ai
ndexbl
ocki
scr
eat
edhav
ingal
lpoi
nter
stof
il
es.
•Eachfi
lehasi
tsownindexbl
ockwhi
chst
orest
headdr
essesofdi
skspace
occupi
edbythefi
le.
•Di
rect
orycont
ainst
headdr
essesofi
ndexbl
ocksoff
il
es.

22ANS)an 
int
err
upt
 i
sar
esponsebyt
he 
processor
 t
oanev
entt
hatneedsat
tent
ionf
rom t
he
softwar e.Ani nterr uptcondi tionalert
st heprocessorandser vesasar equestfortheprocessor
tointerruptt hecur rentlyexecut i
ngcodewhenper mi t
ted,sothattheev entcanbepr ocessedin
atimel ymanner .I fther equesti saccept ed,
thepr ocessorrespondsbysuspendi ngit
scur r
ent
acti
vities, savi
ngi ts  state,andex ecuti
nga  f
unction call
edan int
errupthandler
 (oraninterr
upt
servicer outine,ISR)t odealwi t
htheev ent.Thisinterrupt
ionistempor ary,
and, unl
essthe
i
nterrupti ndicatesaf atalerror,t
hepr ocessorresumesnor malactivi
ti
esaf t
ertheinterr
upt
handl erfinishes.[
1]

Int
err
uptsarecommonl yusedbyhar dwaredevi
cestoindi
cateelect
roni
corphysicalst
ate
changesthatrequi
reattenti
on.Inter
rupt
sarealsocommonl yusedtoimplement
 comput er
multi
taski
ng,especial
lyin 
real
-timecomput i
ng.Syst
emst hatuseint
err
uptsi
ntheseway sar
e
sai
dt obeinter
rupt-dr
iven

Ani nter
ruptisasignalf
rom adevi
ceatt
achedt oacomput erorfr
om a
program wit
hinthecomputerthatr
equi
rest he 
operati
ngsy st
em tost
op
andfigureoutwhattodonex t
.Almostallpersonal(orl
arger)comput
ers
todayare i
nterr
upt-dri
ven -thatis,theyst artdownt helistof
comput er 
inst
ructi
ons 
inonepr ogram ( perhapsanappl icationsuchasa
wor dprocessor)andkeeprunningt hei nstruct
ionsuntileit
her( A)they
can'tgoanyf urt
heror(B)aninterruptsi gnalissensed.Af tertheinter
rupt
signali
ssensed, thecomputereitherr esumesr unni
ngt hecur rent
program orbeginsrunninganotherpr ogr am.

Basicall
y,asinglecomput ercanper f
orm onlyonecomput erinst
ruct
ionat
atime.But ,becausei
tcanbei nt
errupted,i
tcant aket urnsinwhich
programsorset sofinstructi
onsthatitperforms.Thisi sknownas
multit
asking.Itall
owstheusert odoanumberofdi fferentthingsatthe
samet ime.Thecomput ersimplytakesturnsmanagi ngt heprogramsthat
theuserst art
s.Ofcourse,thecomput eroper at
esatspeedst hatmakei t
seem ast houghalloftheuser '
stasksar ebeingperfor medatt hesame
ti
me.( Thecomput er'
soper at
ingsy st
em isgoodatusi ngl i
tt
lepausesin
operati
onsandusert hinkt i
met owor konot herprograms. )

Anoperati
ngsy stem usuall
yhassomecodet hatiscal
ledan i
nt er
rupt
handl
er.Theinterrupthandlerpri
orit
izest
heint
errupt
sandsav esthem i
n

queue i
fmor ethanonei swai t
ingtobehandled.Theoperatingsy st
em
hasanotherli
tt
lepr ogr
am, somet i
mescalleda 
scheduler
,thatfiguresout
whichprogram t
ogi vecontroltonext.

Ingeneral,
t her earehardwareinter
rupt
sandsof t
war einterrupts.A
hardwareint erruptoccurs,f
orexample,whenanI /
Ooper ationis
completedsuchasr eadingsomedat aint
ot hecomput erfrom at apedriv
e.
Asof t
warei nt err
uptoccurswhenanappl icati
onpr ogram ter minatesor
requestscer tainservi
cesfrom theoperat
ingsy st
em.I naper sonal
comput er
,ahar dwareinterr
uptrequest(I
RQ)hasav aluet hatassoci at
esit
withaparticul ardevi
ce.

You might also like