Simulation: Paged Memory System Synopsis

Nitin Handa, RK3701B41 B-Tech CSE Lovely P o!e""ional #nive "ity

Concept $o a % oce"" to "ta t e&ec'tion, the "%ace in (ain (e(o y need" to )e allocated !o the % oce"" to "to e it" add e"" "%ace *con"i"tin+ o! te&t, data, hea% and "tac, "e+(ent"-. /n o%e atin+ "y"te(" "'%%o tin+ ('ltita",in+ o ('lti% o+ a((in+, ('lti%le % oce""e" (ay )e conc' ently e"ident *(e(o y "%ace allocated the add e"" "%ace" o! the e"%ective % oce""e" )e in 0ain 0e(o y-. Conti+'o'" (e(o y allocation i" a "i(%le (e(o y allocation "che(e !ollo1ed in ea ly o%e atin+ "y"te(". Paged Memory2 P oce""e" *% o+ a("- a e divided into !i&ed "i3e %iece" called Pa+e". 0ain (e(o y i" divided into !i&ed "i3e %a tition" called Bloc," *Pa+e $ a(e"Physical and Virtual Addressing2 The (ain (e(o y o! a co(%'te "y"te( i" o +ani3ed a" an a ay o! 0 conti+'o'" )yte-"i3ed cell". Each )yte ha" a 'ni4'e physical address (PA). The !i "t )yte ha" an add e"" o! 0, the ne&t )yte an add e"" o! 1, the ne&t )yte an add e"" o! 5, and "o on. 6iven thi" "i(%le o +ani3ation, the (o"t nat' al 1ay !o a CP# to acce"" (e(o y 1o'ld )e to '"e %hy"ical add e""e". 7e call thi" a%% oach physical addressing. 7ith vi t'al add e""in+, the CP# acce""e" (ain (e(o y )y +ene atin+ a virtual address (VA), 1hich i" conve ted to the a%% o% iate %hy"ical add e"" )e!o e )ein+ "ent to the (e(o y. The ta", o! conve tin+ a vi t'al add e"" to a %hy"ical one i" ,no1n a" address translation. Page Tables: 8i t'al (e(o y add e"" t an"lation '"e" %a+e ta)le". The"e a e "i(%le a ay" in (e(o y inde&ed )y %a+e n'()e . 9 %a+e ta)le )a"e e+i"te *PTBR- hold" the )a"e add e"" !o the %a+e ta)le o! the c' ent % oce"". Each %a+e ta)le ent y contain" in!o (ation a)o't a "in+le %a+e. The (o"t i(%o tant %a t o! thi" in!o (ation i" a ! a(e n'()e - 1he e the %a+e i" located in %hy"ical (e(o y. 9dd e"" t an"lation co()ine" the ! a(e n'()e 1ith the o!!"et %a t o! a lo+ical add e"" to !o ( a %hy"ical add e"". $o 35 )it lo+ical "%ace 50 )it" !o %a+e n'()e and 15 )it" !o o!!"et. /! %a+e "i3e i" 4 KB *5 15then %a+e ta)le (ay con"i"t o! 1 (illion ent ie" *5 35:515-. Each % oce"" (ay need '% to 4 0B o! %hy"ical add e"" "%ace a""'(in+ each ent y con"i"tin+ 4 )yte". Con"ide lo+ical add e"" 504; and the !ollo1in+ %a+e ta)le !o "o(e % oce"" P0. 9""'(e a 1<)it add e"" "%ace 1ith a %a+e "i3e o! 1K.

Conve t lo+ical add e"" to )ina y2 Lo+ical add e""2 000100000000001 Ste%5. Concatenate o!!"et 1ith %hy"ical %a+e ! a(e n'()e Lo+ical 9dd e"" 00010 0000000001 Programming Language use for Simulation $o "i('lation C>> lan+'a+e 1ill )e '"ed.Ste% 1. 00011 Ste% 3. Then %a+e n'()e i" '"ed to inde& the %a+e ta)le !o +ettin+ ! a(e n'()e .1i. add e"" "i3e etc.en '% a" !ollo1"2 00010 0000000001. =ete (ine the lo+ical %a+e n'()e 2 Since the e a e <-)it" allocated to the lo+ical %a+e. Re!e ence"2 htt%2::en.o +:1i.a" an inde& into the %a+e ta)le to +et %hy"ical %a+e n'()e i.i:8i t'al?(e(o y @%e atin+ Sy"te( Conce%t". the add e"" i" ) o.i%edia. Thi" %a+e ta)le 1ill )e i(%le(ented th o'+h 5-= a ay. Cha%te A *0e(o y 0ana+e(ent- . $o each lo+ical add e"" !i "t it i" conve ted in )ina y !o (at and divided in %a+e n'()e and o!!"et acco din+ to add e"" "%ace. Thi" ! a(e n'()e > o!!"et i" '"ed to calc'late %hy"ical add e"". Sil)e "chat3 6alvin.e. #"e lo+ical %a+e n'()e *00010. #"e have to ente %a+e "i3e.