Scho ol of Com pute r Scie nce and Eng inee ring
OBSE RVAT IO N/DAT A SH EET
Na me: MG"Dt\M 'i?I TV:[ k Section : E
US N No tl:2\JA.2{,C.S(02C,'l Date: 2 f 4/2'5
0~ Expt No: ~ •I
Lab:
Title: ~i'a'1~ Cot'Ylt Fiis~ ~)Jw.- \'>se.LtJo Coc.lt
1
~ivt : P~, kl " ~~ tolJ n.W'>1b»t o( ~ole~s ~( ma::r20 )'
l<~c-J. V\
Declo.>ta 0"6'lf~ : TI~~~- {:;W\1 [7o] ,wc:JfiV\g-tima.[1.c)J)wsn~~OIA.n~.L!,mtao)
lJtc.\00u Vo_)'io.¼ .
o.. v~ - l-.Jru t, "- ~ _B mQ. : D
o..V<3- tU)'Y\a.~ou..n.cLt,n-ui =o
(.) Y 'vJ I( f ~ P"6 oc.~~~ ~wrsl t; fYu? ~ ''
f o ~ i ::: o ~ c h- 1 do
py;~" P[:+I )''
\-ctcx.cl hu.-6sl -ti V)'\2 [i J
~~ ~ai,
Llc,]B ~ _ t-rn-u [o] :-o
~o'2s ; =- 1 L, h- I do
t.oa.i-l; "'1- t ;WU' [t] .: O
lo"?J j:: b io i-1 cl.o
(,Ow ti~- l, Y"YIL [i] +;;: bu:15sLL'n-u [j]
~YI, cJ Jo..,
p~~~ Ptroce~~ bu.~i~ t1Y'fll ~ciiti' ~ ifnt0 tU.ll'ri&~owt& lf~''
11
lor i ::o to Vi- I do
t~~(t)O LVtcL t-tmt [i) ::- bu:!S.sL i-in-u2 [ i] ~ GJo1t'i~ -tf~ [i]
a. Y~- ~rufi ~ - tiwu +== ~ru·U ~ -tfV'rl( [i]
p~ir\l (( P(l+i] btos! Ji~[. J l.icut;~- tirt'lg[i] tuWla.~eiwJ_l i~[;J
~ fo~
a.V~ -t.Jo.ifing t-it,,i,f c CA.Vg _ c.ao.Jb~t,wt.e /n Signatu reofthe faculty /inchar ge
29
n.v~_ l\-OS't'lU)'~ _(;tme =- o..vg _lt.otta:~ou\11.J _~rmo /VI
Plr~n..l (( Av~~ LJ)ruli~ !,f;'\O \
0,.V~ _ c:)Cl;( gng~ .f: I t'Y\.f II
Pt5fvJ (\ A.ve:~~ T~a,,owJ 1;rvu,,·
a.v~- ~~~-,g!u~t»J_t\wtt
ft.JD
C>l7T Pl) T !
GrJv, tDtoJ "urnb.b? c~ pool~~ge~ ~ l,
En.P.e,i p?fc c~ ~s bu:~! t ·Vmt :
P[ i] ::6
P[il::: t
CJ 5 ' '3 15 2'l
t> l3J-=- 2
r t ~J ==:,
t. W•T TAT
P~oets~ '3,T ~•T
0 s
P( i) s 5
l '1
P(iJ g 13 5
15 13 ,s
pf3J !
2.2 15 2.'l
f[t,J 1
A-v~ <--?a.,bt'\~ tme .:-s:,.~
Av~ TA-i ! I~ •75
Av~ c.)a.th>1~ ,~~ = o-+5 -+)J+§ ::-- S3 -= g,£5
t, t;"
AV~ C,J~ti~ ,.,. M{;; 5 -1 11..- 15"t'l'2. :: SS" :: n•75"
~ T
School of c ·o mputer Science and Engineering
OB SE RVATION/DAT A SH EET
Name: M~D~M ~I. TV:Cl< Section: ~
USN N o l'QIJ A 2 t, t:,.<;. (? Q2£,'l' Date: 2 / Li 12.5
Lab: 01 Expt N o: 5 '2.
4
Tit le: $~o()t~t :ft b f, rs~ LS~ F] - Pseud.o C.cd.e.
~~3in
InptJ n
f0~ \ ;: O ~ 0 ~- 1
tY\pd- b_t 1~ [i J
Ptil ::t~,
{ O ~ ( j :o to II\ - 1)
pos = i
tb ~ t o "1- I
j =. j 4 I
: ~ b_ !imt [j] ( b- t-;MR [pos) ~ pos : J
SevO-f b_trmt [r] L:)i~ b _-ti.-n12 [pos]., P[i] (.;,~l-t,
() LPo~]
t..:> - i,h'la [o] =D
~::6
.f.o, i~I to Yl -1 .
l-.:> - ii f'h.R [ i) :: St,UY1 Lb-iim.c2 [ o J to b... t i f\'\.G? [ f - \j )
to W
+ = LltW- b;~ [i]
o..v~- wh-= LJbJ In
l-o t-cJ ~o
P~, Yl1 lt P'!S'OC!.e s, bu.~d t1mt wruti~ ti~ tW1no.,mwt9 ti~ Jj
io ~ l ; :: o t o n - ,)
~o..i ( r1 = b- b~wu Ci 1 +- u - ·H tnt [ i ]
~o to..1 +- = !-cJ. [ i J
P~; ~ p [i], b _t-f me ol , l::J - l-; rn.a ( rJ ., tcJ [ i1
o.v~ _ bJ- = h,bcJ lri
A
"'~•n..:
n._,•.. L t(
v~ c.o~
o .l '
~'~
I
timt = o..V~-Q~
'1
plro,1-- Avg {u~~ t.t~ow-,J time = Cl. v~ _y ,, Signature of the faculty/incharge
th<}
Ot>TPt> "f :
E;nlet "VJYlhm ot r~oc~~s: 4
~,Jb bu ~!l t,M.Q :
P! = I
r~ -= '2
r~ : - ,
Pt, ic t,
P&oc~si "Q,"T L.) •T TAT
P, C)
~2 2
1
P.3 3 j
f\
~ ~ lb
Av~ (,.YT =- ~-s-
Av~ TAT-= 5
Gio.c~U'\h l l ~
LP1} P1] P3J PZ\
o 2 6 ll t~
0 + I +3+& ::- 2.•5
Li
Av~ TA, T .: t +3 ~G-+ lo =5
C,
I
School of Computer Science and Engineering
OBSERVATION/DATA SH EET
Name: 1'11~01\t-'\ 1<! i VJ..lc' Section: r f
USN No \1< \Jf\~t.,CS.li o2. ~ C'1 Date:
Lab: OS Expt No: 13• 1
Title: ~ow,& ~obiVI t\\~o~1 ~m (Pseu.&.o coJ.e)
l5ef vi
TY\~~J n [ nlU'YI b~ ~ t p)f002.sse1)
lo~ c.owJ.:o fo n-1
rf'\pJ ~ti h'U [counJ] b-tiW\.Q [ccwJJ
O.b<J .J
~Q..~ P- t [ tol.lV\l J = b - t~ ma [ tou.vJ-)
:CvtptJ t,W\ ~ Sltc.e.
f:;rne : OJ ~tm~n.::V>.1 c..Jeu~ -tfme = (J J tLt'~V)-Cl ~oun.el- ti t'YlP -:::o,
cowJ. =c, f lo.~ =o
II
p15fll\J P~o c.~ ss I ht~ Vl a.¥olJJ'\J ~fW\£ I l.:>alt ,'Vl1 !ivn.a"
w \<lie 'iS"~mc,.ivt >o;
i l <fes r- t (lou.h}) ( = ti Ml _g lic~ A.tvD
cfe,g P- l [c.owJ J ~ o
tTrvu i := ~<?..SP-- l-- [ (Dw,JJ ·
oe.>P- ~ [c.oaj):: 6
fl~= I
e.l~Q. it <fesp~ { [cow,}] ~
oQ_sp_ t [towJJ = ~in1e-Slic.e
~rmi ~= b,·me_sfice
. it '1fe.S P-
.. ·- L
b [ lowvJ =::. 0 a;,, A tvD i~ ~:::. J
<fewio...i' n. = ::. 1
tt.t~n~ow-J - tim.e -t = l ~i~ _o. ~~- ti n-u [(ow,}))
w ...·L t-tWlf += [ !-imi. - ll. n - t 1""' [cot.VJ] - b. ti"" [ coU11fD
p~i ~ p'6ocess [c.ow,J + 1] ~u'IS"via¥oUhJ biry-u> ~Ot,i t; "'$ ~inv
1
t=l°"9 =o J
ij COw,J .-:; .= n - I lt.e,n c.ouvJ =O Signature of the faculty/incharge
• I
lD+ol V\.o ol " '6oc.e~.se~~ ;~
~
1
A11irtvoJ Hme roJ 'iluirsl Umit fo11 ptC>W<s1 o
1
A..-.NJ l,mt a,,,J 'i?ut&~ bim, foir p>oass 2 '. 3
Aniv.J HML o.nJ. 'Bu~!\; Hml fo"< PY<>W.S 3 • 2. ~
,,
s
't I'.\ T wT Pl p Pr P P1 f_, P1
Ps Pi, h Ps P, f>.1 tl ,s 20 22 23 2~
LJ 6 0 2. L, 6 g 10 12 ·~
q
t, q'
Av~ c...::, T =- 7.
-r A-,. ;: \ "2. · 3)
Avq\
l,-t6 ~ <l ::- ~
Av9
c.....:,T.::: ~
g, ::: 12<D
Av~
,A, -- ~'?= ~
3
p .,., 1:¥ E~ •
C
-
ii- .. :~:~===
.,,~
-,.Mil)
•~ SlgMtu.-.o,tJNf'ttulty.
School of Computer Science and Engi neering
O BSE RVAT IO N/DATA SHEET
Name: t-\~Df\M ~1:'tV-,rk' Section: (?
USN No 1k\)l\2t,cS( 02~q Date:
Lab: O! Expt No: i- ~
.
Title: P~tocrH~ A\~o-a-iltm - P~euclo cocL
~e~in
P~ivJ- 11 t~ TotcJ .,)urnbwt o~ p~oc.e.sse1
:t'npi.J fl
p }}
Pit vJ u t r ~ ~ t 1'im.2 ~ ptto"6i ~~ t o'b q,~ ~~ oce ss
fo"1r i = o to n - \ d o
11
p'6h'\)- t( p [i-+ ,l
fa--tvu \\ ~u.¥.S t thvte~~
TV\ ptif b- t iVYtR [i]
n-L•,.1<1{) ' "'
f' u I VU t' ~ IO 2S' I C-j ! >,
'L, P4J P~ [rJ
~[ ( ] .:: i-+I
~~
~or i~o l-o n-1 \Jo
po$= i
to~ j=i tl to
n-1 Do
i f- () cJ [j 1 <P'ls L4)o~] ~
Po! :: j
ehd i l
~\'\ &
Seva.p () (f [ i ) w ; l;ii p'b" [ foSJ
Sroo..P 'o- tirru! L~] wat \:) _tf t'Y\P [pos]
SG.'.)CA.p p [ ~) c.oilh p[pos]
e.h,(J
c..,_!,;>Yli to]= b
bohJ_ wt =O
?o¥ f:;t l-o h l 0 0 4
w - i, me r j ] -: ()
0 • j
t"b~ J=b tb li~I Do Signature of the faculty/lncharg•
to-tiV>V [il::: w- i tt'Vl(? [ ; J -l b. t:YY\.1?[11
3. Execute C progmms to simulate CPU scheduling algorithms to find turnaround and waiting time.
3.1. First Come First Senrcd (FCFS) algorithm
3.2. Shortest Job First (SJF) alf?orithm
3.3. Round Robin <RR) 11lttno-:, i. -
0\tJ t w.liMP [t]
~ 0 ~ cJ _ ~ l :- lob·J - w +
(l~
°'v~- wl= totc.J ~Go! \ Y1
1:-o hJ _-1:oJ -: D
to'b' i ~ D lo ri -1 du
~
h1. l [i 1 b- ti"'' [;J ~ w-l.im.t [i l
lo hJ _l(\J :: ~ olcJ - l-oJ- -+ t~ [ i J
en& t::cJ :; l<)lcJ ~ hJ /'f't
a.vta-
11
p~, ,.J '' P., o c•" 'B u,,S j 'T; "" C.:XUl ll'I ~ H""' lu»>a-.ouJ'l<ll trrvt1
~o") i=o to \'1-1 do
f,-6\l-\J pf(), b- Hm.e [r J 1 w- t; mt [iJ ,t,J eJ
e.n-J
11
pl"inl- Ave,o~
()lfiaj IC ~\JQ,°I'~
end
00 'TPvT ~
GJu, t-oW n ·D o~ P,~u~s: 1
t~ bu.¥~t l ime cu,J P'610'/J;'Uf
P1 11ua-b! Tim£ ~ 6 P~io~a~ ~ 2
P2- \51.l~ ~ 1, ~:
~ Pa-i66; h~ : I
P1 l3u.ist Tim£ ~ + P2ri ori t~ :'5
P"1oCQSS TI r wT TAT
p'2- ~ 0
P,
s
P1 '
1 I !.,
I '7
9...1
Avg ~T:::: 1-
Av~ w T : O ➔ 8 +l~ = 7J
~v~ T A-r:; u, i
G7aflU lkaj ~ +Jt,•n• ::- I~
i
l P2-rsl ~,l P1}
0 11r 2,
· rvu@rvu -Opti.Plex - SFF - 7020 :-/Docunents/1RUA24CSE8194S gee -o FCFS FCFS.c
- j rvu@rvu-OptiP1ex-SFF-7820 :-/Docunents/1RUA24CSE0194$ • / FCFS
Emil bash: ./: Is a directory
El rvu@rvu -OptlPlex -SFF- 70.20 : -/DocUl'\ents/lRUA24CSE0194 $ ./FCFS
Enter to.:al nuMber of processes{naxi.nuri 20): S
Enter Process Burst Til'le;
P[J], s
P[2], 6
I '[3]' 4
P['1]: 8
P[S]: 2
Process Burst Ti.Me Wai.ting Ti.1~e Turnaround Ti.1•1e
P[l) s
P[2] 6 s
0
'
))
P[3]
P[ d)
4
8
11
15 ,,
15
P[5] 2 23 25
Average Waiting Ti.Me: l e
'Average Turnaround Tine:1Srvu@rvu-OptiPlex- SFF -7020 :-/DocuMents/1RUA24CSE0194S
rvu@rvu·OptlPlex·SFF·78Ze :-/Oocul'lents / 1RUA24CSE0194S gee -o sjf sjf.c
rvu@rvu-OptlPlex-SFF-7020 :-/0ocu~ents / tRUA24CSE8194$ ,/sjf
Enter nul"1ber of process: 5
Enter Burst Ti..1~e:
·p1 : 2
p2: S
p3: I
p4; 4
_p5 : 3
Process Burs1: Til"1e Wai.ting Til"1e Turnaround Tir,e
7 0 7
2
s
7
,,' ',,
18
'3 18 21
.Average Wai.ti.ng Ti.1"1e=9.600000
,r•, Average Turn11round Ti.Me=13.aeae00
"._• - r vu@rvu-Opt'i.Plex- SFF -7020 : -/Oocul'lents/1RUAZ4CSE0194$
[email protected] :-/0ocul'lents/1RUA24CSE0194S gee •o roundrobin roundrobi.n.c
rvu~rvu-Opti.Ptex - SFF -7828 :- /0ocURents/1RUAZ4CSE0194S . /roundrobi.n
~
,.
Enter Total nurtber of Processes.: 5
Enter Arri.val Ti.rm and Burst Ti.l'te for Process Process Nul'lber 1
"'
,,
II Enter Arri.val Ti.l'le and Burst Til'le foe Process Process Nuriber
Enter Arri.val Tl.I'll?
'"' '
Burst Ti.f'le for Process Process Nui'\ber l
6
,, •
ii Enter Arri.val Ti.i'\e and Burst Ti.l'le for Process Process Null'iber
Enter ArrLva1 Ti.Ill~
En-.:er Tir'le Sli.c:e: '"' 2
'
Burst Tll'le for Process Process Nuf'lber 5 : 1 2
!Turnaround Tii'lel~ai.ti.ng Ti.Ae
P[5]
I'[ 1]
11
12
14
'
7
P[3] 10
P[2] 17 11
P[ 4] 19 11
•, .) Average 'I, <n' t:1.ng
• r·tr,e= - 24 .se0000
'-• • Avg Turn.around Ti.111e = 14.600000
[email protected] :-/0ocur,ents/1RUA24CSE0194S
rvu@rvu-OpttPlex-SFF-7020 : -/0ocul'lents/1RUA24CSE0194$ ./FCFS
Enter total nu!'lber of proc~sses(!'laxi.Mu~ 20): S
Enter Process Burst Tll'le:
P(1]: 2
P[2), s
!P[3J: 1
,P[4]; 4
P[S), 3
Process Burst Ti.t~e Wai.ti.ng Turnaround Ti.t~e
. P[l)
,P[2)
2
s '
2
'"'' 2
7
P[3) 1 7 :14
·p[ -'l]
.P[SJ '
3
'14
18
18
21
•J Average \/a1.ting Ti.!'le:8
• •·,Aver age Turnaround Ti.!'le:
[email protected] - 7020: -/Oocu!'lents/1RUA24CSE01945
rvu@rvu·Opti.Plex·SFF-70Ze :-/Oocu~ents/ 1RUA24CSE&194$ ./sjf
Enter nuriber of process: S
ll Enter Surst Tll'le :
p1: 5
ii :pZ: 6
:p3: 4
·p'1:
p5: 2
•
.,
Process
' pl
Burst Ti.r<ie
4
s
Wa t. ting T1.l'le
'
4
Turnaround Til'le
'
9
:p2 6 9 15
''p4 B 15 23
!p5 ,s
' 23
,.. Wai.tt.ng Ti.~1e=10. 2G080B
• A\le-rage- Turnaround Ti.rie"'15. 200000
[email protected] :-/0ocur1~nts/1RUA24CSEG194S ./roundrobi.n
'II.I .Enter Total nul'lber of Processes: s
Enter Arri.val Ti.!'le aod Burst Ti.l'le fo, Process Process Nur1ber j • 3
iO s 3
Enter Arri.val Ti.r1e aod Burst Ti.rie fo, Process Process NUl'lber 2 ,,
•
I 12:, Enter Arri.val Ti1qe aod Burst Tll'le for Prc,cess Process NUl'lber 3 ,,
7
••
Enter Arri.val Ti.I'll? aod Burst Ti.l'le fo, Process Process Nul'lber 4
!
Enter Arri.val Ti.1qe aod Burst Ti.l'le fo, Process Process Nul'lber 5
B
,.
's
Enter Ti.Me Sl i.ce: 4
ii Process I Turnaround Ti.l'le]Wai.ti.ng Tine
.3
P[1]
Pl4]
P[2]
'
7
15
•
10
P[3]
P[S]
16
18 ,.
9
Wai.ting Ti.l'le= •28.200000
,Avg Turnaround Ti.l'le =
[email protected]:-/0ocu!'leots/1RUA24CSE0194 S ./roundrobi.n
rvu@rvu-OpttPlex-SFF-7028 : -/Docunents/1RUA24CSEa194S ./priority
' Enter ToLa1 NuJ'lber of Process:5
IEnter Bu.---st Til'le and Pri.ori.ty
,1
!P{lJ
jBurst Ti.Pie: S
Pri.ori.ty:3
ra:. P[2]
Burst
• Ti.PJe:6
Pri.ori,ty:2
urst Ti.PJe:4
ri.ority:1
P[4]
Burst Ti.Me:8
Pri.ortty:l\
0(5]
Burst Ti.Me:Z
Pri.ortty: S
Burst Ti.rie Wai.ting Ti.J'le, Turnaround Ti..l'le
[3)
P(2] '
6 '
4 '1,
[lj s 10 1S
[' l 1S 23
P[S] '
2 23 25
Average Wai.ting Ti.Ae=le
Avera e Turnaround Ti.l'le=lS