diff --git a/EOPSY/lab3/report/.report.tex.swp b/EOPSY/lab3/report/.report.tex.swp new file mode 100644 index 00000000..d27796c7 Binary files /dev/null and b/EOPSY/lab3/report/.report.tex.swp differ diff --git a/EOPSY/lab4/report/report.aux b/EOPSY/lab4/report/report.aux new file mode 100644 index 00000000..03929e99 --- /dev/null +++ b/EOPSY/lab4/report/report.aux @@ -0,0 +1,25 @@ +\relax +\providecommand\hyper@newdestlabel[2]{} +\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument} +\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined +\global\let\oldcontentsline\contentsline +\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} +\global\let\oldnewlabel\newlabel +\gdef\newlabel#1#2{\newlabelxx{#1}#2} +\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} +\AtEndDocument{\ifx\hyper@anchor\@undefined +\let\contentsline\oldcontentsline +\let\newlabel\oldnewlabel +\fi} +\fi} +\global\let\hyper@last\relax +\gdef\HyperFirstAtBeginDocument#1{#1} +\providecommand\HyField@AuxAddToFields[1]{} +\providecommand\HyField@AuxAddToCoFields[2]{} +\citation{Page Replacement Algorithms} +\bibcite{Page Replacement Algorithms}{1} +\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{First in First out}{1}{section*.1}\protected@file@percent } +\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces PageFault.java file}}{1}{figure.1}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{Mapping}{1}{section*.2}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {2}Finishing comments}{1}{section.2}\protected@file@percent } diff --git a/EOPSY/lab4/report/report.fdb_latexmk b/EOPSY/lab4/report/report.fdb_latexmk new file mode 100644 index 00000000..da7087c5 --- /dev/null +++ b/EOPSY/lab4/report/report.fdb_latexmk @@ -0,0 +1,87 @@ +# Fdb version 3 +["pdflatex"] 1651819250 "report.tex" "report.pdf" "report" 1651819251 + "/etc/texmf/web2c/texmf.cnf" 1649511474 475 c0e671620eb5563b2130f56340a5fde8 "" + "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcti1000.tfm" 1136768653 2048 3777f70f4372b17e2d3fda2b5684af05 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm" 1136768653 1328 c834bbb027764024c09d3d2bf908b5f0 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm" 1136768653 1324 c910af8c371558dc20f2d7822f66fe64 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm" 1136768653 1524 4414a8315f39513458b80dfc63bff03a "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm" 1136768653 1512 f21f83efb36853c0b70002322c1ab3ad "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm" 1136768653 1520 eccf95517727cb11801f4f1aee3a21b4 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1136768653 1288 655e228510b4c2a1abe905c368440826 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm" 1136768653 1292 296a67155bdbfc32aa9c636f21e91433 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr6.tfm" 1136768653 1300 b62933e007d01cfd073f79b963c01526 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr8.tfm" 1136768653 1292 21c1c5bfeaebccffdb478fd231a0997d "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1136768653 1124 6c73e740cf17375f03eec0ee63599741 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm" 1136768653 1116 933a60c408fc0a863a92debe84b2d294 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm" 1136768653 1120 8b7d695260f3cff42e636090a8002094 "" + "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm" 1136768653 1480 aa8e34af0eb6a2941b776984cf1dfdc4 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb" 1248133631 34811 78b52f49e893bcba91bd7581cdc144c0 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb" 1248133631 32080 340ef9bf63678554ee606688e7b5339d "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb" 1248133631 36299 5f9df58c2139e7edcf37c8fca4bd384d "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb" 1248133631 32722 d7379af29a190c3f453aba36302ff5a9 "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb" 1248133631 32362 179c33bbf43f19adbb3825bb4e36e57a "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb" 1248133631 32569 5e5ddc8df908dea60932f3c484a54c0d "" + "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb" 1248133631 37944 359e864bd06cde3b1cf57bb20757fb06 "" + "/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii" 1461363279 71627 94eb9990bed73c364d7f53f960cc8c5b "" + "/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty" 1575674566 24708 5584a51a7101caf7e6bbf1fc27d8f7b1 "" + "/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty" 1576625341 40635 c40361e206be584d448876bba8a64a3b "" + "/usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty" 1576016050 33961 6b5c75130e435b2bfdb9f480a09a39f9 "" + "/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty" 1576625273 7734 b98cbb34c81f667027c1e3ebdbfce34b "" + "/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty" 1576625223 8371 9d55b8bd010bc717624922fb3477d92e "" + "/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty" 1573336935 6902 30fdaf7dc5636b8e3afa306210c45cae "" + "/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty" 1572645307 1057 525c2192b5febbd8c1f662c9468335bb "" + "/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty" 1575499628 8356 7bbb2c2373aa810be568c29e333da8ed "" + "/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty" 1576625065 31769 002a487f55041f8e805cfbf6385ffd97 "" + "/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty" 1576878844 5412 d5a2436094cd7be85769db90f29250a6 "" + "/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty" 1576624944 13807 952b0226d4efca026f0e19dd266dcc22 "" + "/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty" 1576624883 18552 1e1cc7b75da0dfaacce7cdcb27d306bf "" + "/usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty" 1576015897 19007 15924f7228aca6c6d184b115f4baa231 "" + "/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty" 1576624663 7008 f92eaa0a3872ed622bbf538217cd2ab7 "" + "/usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty" 1576191570 19336 ce7ae9438967282886b3b036cfad1e4d "" + "/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty" 1576625391 3935 57aa3c3e203a5c2effb4d2bd2efbc323 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/article.cls" 1580683321 20023 e427dd9e17e239bf926ef3aab67fe35e "" + "/usr/share/texlive/texmf-dist/tex/latex/base/omlcmr.fd" 1580683321 2471 93c7889092ef3d83d375b915c5381dfe "" + "/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd" 1580683321 2470 59e43b502a8bea3a12f4954945302e40 "" + "/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo" 1580683321 8446 9874cccac5fee462272c582807dbbf56 "" + "/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty" 1579991033 13886 d1306dcf79a944f6988e688c1785f9ce "" + "/usr/share/texlive/texmf-dist/tex/latex/float/float.sty" 1137110151 6749 16d2656a1984957e674b149555f1ea1d "" + "/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty" 1578002852 41601 9cf6c5257b1bc7af01a58859749dd37a "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg" 1465944070 1224 978390e9c2234eab29404bc21b268d1e "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def" 1515537368 17334 520b9b85ad8a2a48eda3f643e27a5179 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty" 1580683321 16932 04729abe63b66ec59ea56edcd722b058 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty" 1580683321 9067 1b996612394a52e1efe89c8bfe8a5892 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty" 1580683321 2590 e3b24ff953e5b58d924f163d25380312 "" + "/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty" 1580683321 3976 d7fa7d81d2870d509d25b17d0245e735 "" + "/usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty" 1580250785 17914 4c28a13fc3d975e6e81c9bea1d697276 "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def" 1579642962 50630 3d9728faf8630190cf601ce2cbe470d9 "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty" 1579642962 238752 60dd338d71b6a4ab2192131f73dc908b "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty" 1579642962 13244 0070bcab7b5a88187847128d22faf4d8 "" + "/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def" 1579642962 14134 32b36577d311ddb6522413c7581ee968 "" + "/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty" 1575152344 22520 c4c2dab203104295e1e618be7e5c0f5b "" + "/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def" 1580854751 25404 9d60f463a00d154207ec0048dee27cf0 "" + "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg" 1279039959 678 4792914a8f45be57bb98413425e4c7af "" + "/usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty" 1575499565 5766 13a9e8766c47f30327caf893ece86ac8 "" + "/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg" 1568236792 1830 bbaba8afaf42cc048ec4d4ff73467521 "" + "/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty" 1568236792 80511 830f3f1d3ab7448dd84233e9c2f6462c "" + "/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty" 1568236792 204271 6a0ce6b8dafb6c4a13b9036ab1717c77 "" + "/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty" 1568236792 77022 32914f01b528131c47be2a1040d3856d "" + "/usr/share/texlive/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty" 1574631863 19963 36fd8e818f9f0f32e2db8413d4970122 "" + "/usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty" 1576624809 9878 9e94e8fa600d95f9c7731bb21dfb67a4 "" + "/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty" 1575674187 9715 b051d5b493d9fe5f4bc251462d039e5f "" + "/usr/share/texlive/texmf-dist/tex/latex/url/url.sty" 1388531844 12796 8edb7d69a20b857904dd0ea757c14ec9 "" + "/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e "" + "/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc" 1565080000 2900 1537cc8184ad1792082cd229ecc269f4 "" + "/usr/share/texmf/fonts/type1/public/cm-super/sfti1000.pfb" 1565080000 186554 e8f0fa8ca05e038f257a06405232745f "" + "/usr/share/texmf/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e "" + "/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1649511498 4770781 1ed1abab22da9c3e2cc82e4db562318b "" + "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1649511522 8256308 efb305160d4d659dcd0c4df67bdfa340 "" + "report.aux" 1651819250 1291 2ad45efb724135c31d626d6936d14b17 "pdflatex" + "report.out" 1651819250 100 25fdc042cd41a4fc702071f1ee9cd704 "pdflatex" + "report.tex" 1651819249 1665 7fe501939e4c3d08e14885cab811844d "" + (generated) + "report.pdf" + "report.aux" + "report.out" + "report.log" diff --git a/EOPSY/lab4/report/report.fls b/EOPSY/lab4/report/report.fls new file mode 100644 index 00000000..bdb58bff --- /dev/null +++ b/EOPSY/lab4/report/report.fls @@ -0,0 +1,142 @@ +PWD /home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EOPSY/eopsy_rudnicki_lab/lab4/report +INPUT /etc/texmf/web2c/texmf.cnf +INPUT /usr/share/texmf/web2c/texmf.cnf +INPUT /usr/share/texlive/texmf-dist/web2c/texmf.cnf +INPUT /var/lib/texmf/web2c/pdftex/pdflatex.fmt +INPUT report.tex +OUTPUT report.log +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/article.cls +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/size10.clo +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def +INPUT /usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/url/url.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/float/float.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/float/float.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def +INPUT /usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def +INPUT report.aux +INPUT report.aux +OUTPUT report.aux +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty +INPUT /usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty +INPUT report.out +INPUT report.out +INPUT report.out +INPUT report.out +OUTPUT report.pdf +INPUT ./report.out +INPUT ./report.out +OUTPUT report.out +INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +INPUT /usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +INPUT /usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr17.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr8.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr6.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmti10.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcti1000.tfm +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omlcmr.fd +INPUT /usr/share/texlive/texmf-dist/tex/latex/base/omlcmr.fd +INPUT /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map +INPUT report.aux +INPUT ./report.out +INPUT ./report.out +INPUT /usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb +INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb +INPUT /usr/share/texmf/fonts/type1/public/cm-super/sfti1000.pfb diff --git a/EOPSY/lab4/report/report.log b/EOPSY/lab4/report/report.log new file mode 100644 index 00000000..8d82079b --- /dev/null +++ b/EOPSY/lab4/report/report.log @@ -0,0 +1,340 @@ +This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2022.4.9) 6 MAY 2022 08:40 +entering extended mode + restricted \write18 enabled. + file:line:error style messages enabled. + %&-line parsing enabled. +**report.tex +(./report.tex +LaTeX2e <2020-02-02> patch level 2 +L3 programming layer <2020-02-14> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls +Document Class: article 2019/12/20 v1.4l Standard LaTeX document class +(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo +File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option) +) +\c@part=\count167 +\c@section=\count168 +\c@subsection=\count169 +\c@subsubsection=\count170 +\c@paragraph=\count171 +\c@subparagraph=\count172 +\c@figure=\count173 +\c@table=\count174 +\abovecaptionskip=\skip47 +\belowcaptionskip=\skip48 +\bibindent=\dimen134 +) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty +Package: keyval 2014/10/28 v1.15 key=value parser (DPC) +\KV@toks@=\toks14 +) +\lst@mode=\count175 +\lst@gtempboxa=\box45 +\lst@token=\toks15 +\lst@length=\count176 +\lst@currlwidth=\dimen135 +\lst@column=\count177 +\lst@pos=\count178 +\lst@lostspace=\dimen136 +\lst@width=\dimen137 +\lst@newlines=\count179 +\lst@lineno=\count180 +\lst@maxwidth=\dimen138 + (/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty +File: lstmisc.sty 2019/09/10 1.8c (Carsten Heinz) +\c@lstnumber=\count181 +\lst@skipnumbers=\count182 +\lst@framebox=\box46 +) (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg +File: listings.cfg 2019/09/10 1.8c listings configuration +)) +Package: listings 2019/09/10 1.8c (Carsten Heinz) + (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty +Package: hyperref 2020/01/14 v7.00d Hypertext links for LaTeX + (/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty +Package: ltxcmds 2019/12/15 v1.24 LaTeX kernel commands for general use (HO) +) (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty +Package: iftex 2019/11/07 v1.0c TeX engine tests +) (/usr/share/texlive/texmf-dist/tex/latex/pdftexcmds/pdftexcmds.sty +Package: pdftexcmds 2019/11/24 v0.31 Utility functions of pdfTeX for LuaTeX (HO) + (/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty +Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) +) +Package pdftexcmds Info: \pdf@primitive is available. +Package pdftexcmds Info: \pdf@ifprimitive is available. +Package pdftexcmds Info: \pdfdraftmode found. +) (/usr/share/texlive/texmf-dist/tex/generic/kvsetkeys/kvsetkeys.sty +Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO) +) (/usr/share/texlive/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty +Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO) +) (/usr/share/texlive/texmf-dist/tex/generic/pdfescape/pdfescape.sty +Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) +) (/usr/share/texlive/texmf-dist/tex/latex/hycolor/hycolor.sty +Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO) +) (/usr/share/texlive/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty +Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO) +) (/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty +Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO) +) (/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty +Package: kvoptions 2019/11/29 v3.13 Key value format for package options (HO) +) +\@linkdim=\dimen139 +\Hy@linkcounter=\count183 +\Hy@pagecounter=\count184 + (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def +File: pd1enc.def 2020/01/14 v7.00d Hyperref: PDFDocEncoding definition (HO) +Now handling font encoding PD1 ... +... no UTF-8 mapping file for font encoding PD1 +) (/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty +Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO) +) (/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty +Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO) +) +\Hy@SavedSpaceFactor=\count185 +\pdfmajorversion=\count186 +Package hyperref Info: Hyper figures OFF on input line 4547. +Package hyperref Info: Link nesting OFF on input line 4552. +Package hyperref Info: Hyper index ON on input line 4555. +Package hyperref Info: Plain pages OFF on input line 4562. +Package hyperref Info: Backreferencing OFF on input line 4567. +Package hyperref Info: Implicit mode ON; LaTeX internals redefined. +Package hyperref Info: Bookmarks ON on input line 4800. +\c@Hy@tempcnt=\count187 + (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty +\Urlmuskip=\muskip16 +Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. +) +LaTeX Info: Redefining \url on input line 5159. +\XeTeXLinkMargin=\dimen140 + (/usr/share/texlive/texmf-dist/tex/generic/bitset/bitset.sty +Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO) + (/usr/share/texlive/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty +Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO) +)) +\Fld@menulength=\count188 +\Field@Width=\dimen141 +\Fld@charsize=\dimen142 +Package hyperref Info: Hyper figures OFF on input line 6430. +Package hyperref Info: Link nesting OFF on input line 6435. +Package hyperref Info: Hyper index ON on input line 6438. +Package hyperref Info: backreferencing OFF on input line 6445. +Package hyperref Info: Link coloring OFF on input line 6450. +Package hyperref Info: Link coloring with OCG OFF on input line 6455. +Package hyperref Info: PDF/A mode OFF on input line 6460. +LaTeX Info: Redefining \ref on input line 6500. +LaTeX Info: Redefining \pageref on input line 6504. + (/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty +Package: atbegshi 2019/12/05 v1.19 At begin shipout hook (HO) +) +\Hy@abspage=\count189 +\c@Item=\count190 +\c@Hfootnote=\count191 +) +Package hyperref Info: Driver (autodetected): hpdftex. + (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def +File: hpdftex.def 2020/01/14 v7.00d Hyperref driver for pdfTeX + (/usr/share/texlive/texmf-dist/tex/latex/atveryend/atveryend.sty +Package: atveryend 2019-12-11 v1.11 Hooks at the very end of document (HO) +Package atveryend Info: \enddocument detected (standard20110627). +) +\Fld@listcount=\count192 +\c@bookmark@seq@number=\count193 + (/usr/share/texlive/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty +Package: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO) + (/usr/share/texlive/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty +Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO) +) +Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 286. +) +\Hy@SectionHShift=\skip49 +) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty +Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR) + (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty +Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR) + +(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty +Package: trig 2016/01/03 v1.10 sin cos tan (DPC) +) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg +File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration +) +Package graphics Info: Driver file: pdftex.def on input line 105. + (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def +File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex +)) +\Gin@req@height=\dimen143 +\Gin@req@width=\dimen144 +) (/usr/share/texlive/texmf-dist/tex/latex/float/float.sty +Package: float 2001/11/08 v1.3d Float enhancements (AL) +\c@float@type=\count194 +\float@exts=\toks16 +\float@box=\box47 +\@float@everytoks=\toks17 +\@floatcapt=\box48 +) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty +Package: geometry 2020/01/02 v5.9 Page Geometry + (/usr/share/texlive/texmf-dist/tex/generic/iftex/ifvtex.sty +Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead. +) +\Gm@cnth=\count195 +\Gm@cntv=\count196 +\c@Gm@tempcnt=\count197 +\Gm@bindingoffset=\dimen145 +\Gm@wd@mp=\dimen146 +\Gm@odd@mp=\dimen147 +\Gm@even@mp=\dimen148 +\Gm@layoutwidth=\dimen149 +\Gm@layoutheight=\dimen150 +\Gm@layouthoffset=\dimen151 +\Gm@layoutvoffset=\dimen152 +\Gm@dimlist=\toks18 +) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def +File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode +\l__kernel_color_stack_int=\count198 +\l__pdf_internal_box=\box49 +) (./report.aux) +\openout1 = `report.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +\c@lstlisting=\count199 +\AtBeginShipoutBox=\box50 +Package hyperref Info: Link coloring OFF on input line 7. + (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty +Package: nameref 2019/09/16 v2.46 Cross-referencing by name of section + (/usr/share/texlive/texmf-dist/tex/latex/refcount/refcount.sty +Package: refcount 2019/12/15 v3.6 Data extraction from label references (HO) +) (/usr/share/texlive/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty +Package: gettitlestring 2019/12/15 v1.6 Cleanup title references (HO) +) +\c@section@level=\count266 +) +LaTeX Info: Redefining \ref on input line 7. +LaTeX Info: Redefining \pageref on input line 7. +LaTeX Info: Redefining \nameref on input line 7. + (./report.out) (./report.out) +\@outlinefile=\write3 +\openout3 = `report.out'. + + (/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii +[Loading MPS to PDF converter (version 2006.09.02).] +\scratchcounter=\count267 +\scratchdimen=\dimen153 +\scratchbox=\box51 +\nofMPsegments=\count268 +\nofMParguments=\count269 +\everyMPshowfont=\toks19 +\MPscratchCnt=\count270 +\MPscratchDim=\dimen154 +\MPnumerator=\count271 +\makeMPintoPDFobject=\count272 +\everyMPtoPDFconversion=\toks20 +) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty +Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf +Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 485. + (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg +File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live +)) +*geometry* driver: auto-detecting +*geometry* detected driver: pdftex +*geometry* verbose mode - [ preamble ] result: +* driver: pdftex +* paper: +* layout: +* layoutoffset:(h,v)=(0.0pt,0.0pt) +* modes: +* h-part:(L,W,R)=(90.3375pt, 433.62001pt, 90.3375pt) +* v-part:(T,H,B)=(90.3375pt, 614.295pt, 90.3375pt) +* \paperwidth=614.295pt +* \paperheight=794.96999pt +* \textwidth=433.62001pt +* \textheight=614.295pt +* \oddsidemargin=18.0675pt +* \evensidemargin=18.0675pt +* \topmargin=-18.9325pt +* \headheight=12.0pt +* \headsep=25.0pt +* \topskip=10.0pt +* \footskip=30.0pt +* \marginparwidth=65.0pt +* \marginparsep=11.0pt +* \columnsep=10.0pt +* \skip\footins=9.0pt plus 4.0pt minus 2.0pt +* \hoffset=0.0pt +* \voffset=0.0pt +* \mag=1000 +* \@twocolumnfalse +* \@twosidefalse +* \@mparswitchfalse +* \@reversemarginfalse +* (1in=72.27pt=25.4mm, 1cm=28.453pt) + +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <12> on input line 12. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line 12. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line 12. +(/usr/share/texlive/texmf-dist/tex/latex/listings/lstlang1.sty +File: lstlang1.sty 2019/09/10 1.8c listings language file +) +LaTeX Font Info: Trying to load font information for OMS+cmr on input line 20. + (/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd +File: omscmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions +) +LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 20. +LaTeX Font Info: Trying to load font information for OML+cmr on input line 25. + (/usr/share/texlive/texmf-dist/tex/latex/base/omlcmr.fd +File: omlcmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions +) +LaTeX Font Info: Font shape `OML/cmr/m/it' in size <10> not available +(Font) Font shape `OML/cmm/m/it' tried instead on input line 25. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 27. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line 27. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 48. + [1 + +{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}pdfTeX warning (ext4): destination with the same identifier (name{figure.1}) has been already used, duplicate ignored + +\AtBegShi@Output ...ipout \box \AtBeginShipoutBox + \fi \fi +l.48 \end{document} + ] +Package atveryend Info: Empty hook `AfterLastShipout' on input line 48. + (./report.aux) +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 48. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 48. +Package rerunfilecheck Info: File `report.out' has not changed. +(rerunfilecheck) Checksum: 25FDC042CD41A4FC702071F1EE9CD704;100. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 48. + ) +Here is how much of TeX's memory you used: + 7424 strings out of 481239 + 110306 string characters out of 5920378 + 570541 words of memory out of 5000000 + 22566 multiletter control sequences out of 15000+600000 + 537009 words of font info for 39 fonts, out of 8000000 for 9000 + 1141 hyphenation exceptions out of 8191 + 34i,6n,42p,215b,1492s stack positions out of 5000i,500n,10000p,200000b,80000s +{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc} +Output written on report.pdf (1 page, 96710 bytes). +PDF statistics: + 85 PDF objects out of 1000 (max. 8388607) + 72 compressed objects within 1 object stream + 24 named destinations out of 1000 (max. 500000) + 17 words of extra memory for PDF output out of 10000 (max. 10000000) + diff --git a/EOPSY/lab4/report/report.out b/EOPSY/lab4/report/report.out new file mode 100644 index 00000000..a9178fc8 --- /dev/null +++ b/EOPSY/lab4/report/report.out @@ -0,0 +1,2 @@ +\BOOKMARK [1][-]{section.1}{Introduction}{}% 1 +\BOOKMARK [1][-]{section.2}{Finishing comments}{}% 2 diff --git a/EOPSY/lab4/report/report.pdf b/EOPSY/lab4/report/report.pdf new file mode 100644 index 00000000..166a635e Binary files /dev/null and b/EOPSY/lab4/report/report.pdf differ diff --git a/EOPSY/lab4/report/report.synctex.gz b/EOPSY/lab4/report/report.synctex.gz new file mode 100644 index 00000000..281b7281 Binary files /dev/null and b/EOPSY/lab4/report/report.synctex.gz differ diff --git a/EOPSY/lab4/report/report.tex b/EOPSY/lab4/report/report.tex new file mode 100644 index 00000000..99737f5f --- /dev/null +++ b/EOPSY/lab4/report/report.tex @@ -0,0 +1,48 @@ +\documentclass{article} +\usepackage{listings} +\usepackage{hyperref} +\usepackage{graphicx} +\usepackage{float} +\usepackage[margin=1.25in]{geometry} +\begin{document} +\title{EOPSY Lab 4 Report} +\author{Krzysztof Rudnicki, 307585} +\date{\today} +\maketitle +\section{Introduction} +\paragraph{First in First out} +We use FIFO (First in First out) page replacement algorithm for those laboratories as indicated +by the PageFault.java file line 18 +\begin{figure}[H] +\caption{PageFault.java file} +\begin{lstlisting}[language=Java] +[...] +public class PageFault { + + /** + * The page replacement algorithm for the memory management sumulator. + * This method gets called whenever a page needs to be replaced. + *

+ * The page replacement algorithm included with the simulator is + * FIFO (first-in first-out). A while or for loop should be used + * to search through the current memory contents for a canidate + * replacement page. In the case of FIFO the while loop is used + * to find the proper page while making sure that virtPageNum is + * not exceeded. +[...] +\end{lstlisting} +\end{figure} +All pages are stored in memory in a queue. Oldest page (First that came in) is +in front of this queue. \\ When we need to replace the page we remove the page that +is first in queue (so the one that came in as a first one, first in, first out) +\cite{Page Replacement Algorithms} +\paragraph{Mapping} + + +\section{Finishing comments} +\begin{thebibliography}{9} +\bibitem{Page Replacement Algorithms} +\href{https://www.geeksforgeeks.org/page-replacement-algorithms-in-operating-systems/}{[Geeks +for Geeks page replacament algorithms]} +\end{thebibliography} +\end{document} diff --git a/EOPSY/lab4/task4/README b/EOPSY/lab4/task4/README new file mode 100644 index 00000000..818dd2da --- /dev/null +++ b/EOPSY/lab4/task4/README @@ -0,0 +1 @@ +Change directory to ./ftp and submit "make setup". diff --git a/EOPSY/lab4/task4/ftp/Makefile b/EOPSY/lab4/task4/ftp/Makefile new file mode 100644 index 00000000..59bad64c --- /dev/null +++ b/EOPSY/lab4/task4/ftp/Makefile @@ -0,0 +1,24 @@ + +default: info + + +help: + less README.tjk + +compile: + javac -nowarn *.java + +run: + java MemoryManagement commands memory.conf + +setup: + ./setUp + +info: + @echo "" + @echo "Use 'make' with one argument:" + @echo "" + @echo " make help" + @echo " make compile" + @echo " make run" + @echo "" diff --git a/EOPSY/lab4/task4/ftp/README.tjk b/EOPSY/lab4/task4/ftp/README.tjk new file mode 100644 index 00000000..e77b9a16 --- /dev/null +++ b/EOPSY/lab4/task4/ftp/README.tjk @@ -0,0 +1,45 @@ + + + WORKPLACE ORGANIZATION: +mkdir ../work +cd ../work +cp ../ftp/* . +gzip -d memory.tgz +tar -xvf memory.tar +rm memory.tar + + + READING: +more/less/vi/vim README.tjk +netscape/lynx/links install_unix.html +netscape/lynx/links user_guide.html + + + COMPILE: +javac -nowarn *.java + + + RUN: +java MemoryManagement commands memory.conf + + + FILES: +input file name: commands +initial content of the VM map: memory.conf +output file name: tracefile + + +--[ YOUR TASK ]------------------------------------------------------- + +Create a command file that maps any 8 pages of physical memory to the +first 8 pages of virtual memory, and then reads from one virtual memory +address on each of the 64 virtual pages. Step through the simulator one +operation at a time and see if you can predict which virtual memory +addresses cause page faults. What page replacement algorithm is being +used? + +Locate in the sources and describe to the instructor the page +replacement algorithm. + +---------------------------------------------------------------------- + diff --git a/EOPSY/lab4/task4/ftp/memory.tgz b/EOPSY/lab4/task4/ftp/memory.tgz new file mode 100644 index 00000000..98483c9d Binary files /dev/null and b/EOPSY/lab4/task4/ftp/memory.tgz differ diff --git a/EOPSY/lab4/task4/ftp/setUp b/EOPSY/lab4/task4/ftp/setUp new file mode 100755 index 00000000..8a9877bb --- /dev/null +++ b/EOPSY/lab4/task4/ftp/setUp @@ -0,0 +1,9 @@ +echo "Creating ../work subdirectory" +mkdir ../work 2>/dev/null +cd ../work +cp ../ftp/* . +gzip -d memory.tgz +tar -xvf memory.tar +rm memory.tar +echo "" +echo "Now, go to the directory ../work and submit 'make'" diff --git a/EOPSY/lab4/task4/work/.memory.conf.swp b/EOPSY/lab4/task4/work/.memory.conf.swp new file mode 100644 index 00000000..235982c0 Binary files /dev/null and b/EOPSY/lab4/task4/work/.memory.conf.swp differ diff --git a/EOPSY/lab4/task4/work/Common.class b/EOPSY/lab4/task4/work/Common.class new file mode 100644 index 00000000..bde546be Binary files /dev/null and b/EOPSY/lab4/task4/work/Common.class differ diff --git a/EOPSY/lab4/task4/work/Common.java b/EOPSY/lab4/task4/work/Common.java new file mode 100644 index 00000000..ef146424 --- /dev/null +++ b/EOPSY/lab4/task4/work/Common.java @@ -0,0 +1,58 @@ +public class Common { + + static public long s2l ( String s ) + { + long i = 0; + + try { + i = Long.parseLong(s.trim()); + } catch (NumberFormatException nfe) { + System.out.println("NumberFormatException: " + nfe.getMessage()); + } + + return i; + } + + static public int s2i ( String s ) + { + int i = 0; + + try { + i = Integer.parseInt(s.trim()); + } catch (NumberFormatException nfe) { + System.out.println("NumberFormatException: " + nfe.getMessage()); + } + + return i; + } + + static public byte s2b ( String s ) + { + int i = 0; + byte b = 0; + + try { + i = Integer.parseInt(s.trim()); + } catch (NumberFormatException nfe) { + System.out.println("NumberFormatException: " + nfe.getMessage()); + } + b = (byte) i; + return b; + } + + public static long randomLong( long MAX ) + { + long i = -1; + + java.util.Random generator = new + java.util.Random(System.currentTimeMillis()); + while (i > MAX || i < 0) + { + int intOne = generator.nextInt(); + int intTwo = generator.nextInt(); + i = (long) intOne + intTwo; + } + return i; + } +} + diff --git a/EOPSY/lab4/task4/work/ControlPanel.class b/EOPSY/lab4/task4/work/ControlPanel.class new file mode 100644 index 00000000..c99a93a2 Binary files /dev/null and b/EOPSY/lab4/task4/work/ControlPanel.class differ diff --git a/EOPSY/lab4/task4/work/ControlPanel.java b/EOPSY/lab4/task4/work/ControlPanel.java new file mode 100644 index 00000000..a0c1832c --- /dev/null +++ b/EOPSY/lab4/task4/work/ControlPanel.java @@ -0,0 +1,1852 @@ +import java.applet.*; +import java.awt.*; + +public class ControlPanel extends Frame +{ + Kernel kernel ; + Button runButton = new Button("run"); + Button stepButton = new Button("step"); + Button resetButton = new Button("reset"); + Button exitButton = new Button("exit"); + Button b0 = new Button("page " + (0)); + Button b1 = new Button("page " + (1)); + Button b2 = new Button("page " + (2)); + Button b3 = new Button("page " + (3)); + Button b4 = new Button("page " + (4)); + Button b5 = new Button("page " + (5)); + Button b6 = new Button("page " + (6)); + Button b7 = new Button("page " + (7)); + Button b8 = new Button("page " + (8)); + Button b9 = new Button("page " + (9)); + Button b10 = new Button("page " + (10)); + Button b11 = new Button("page " + (11)); + Button b12 = new Button("page " + (12)); + Button b13 = new Button("page " + (13)); + Button b14 = new Button("page " + (14)); + Button b15 = new Button("page " + (15)); + Button b16 = new Button("page " + (16)); + Button b17 = new Button("page " + (17)); + Button b18 = new Button("page " + (18)); + Button b19 = new Button("page " + (19)); + Button b20 = new Button("page " + (20)); + Button b21 = new Button("page " + (21)); + Button b22 = new Button("page " + (22)); + Button b23 = new Button("page " + (23)); + Button b24 = new Button("page " + (24)); + Button b25 = new Button("page " + (25)); + Button b26 = new Button("page " + (26)); + Button b27 = new Button("page " + (27)); + Button b28 = new Button("page " + (28)); + Button b29 = new Button("page " + (29)); + Button b30 = new Button("page " + (30)); + Button b31 = new Button("page " + (31)); + Button b32 = new Button("page " + (32)); + Button b33 = new Button("page " + (33)); + Button b34 = new Button("page " + (34)); + Button b35 = new Button("page " + (35)); + Button b36 = new Button("page " + (36)); + Button b37 = new Button("page " + (37)); + Button b38 = new Button("page " + (38)); + Button b39 = new Button("page " + (39)); + Button b40 = new Button("page " + (40)); + Button b41 = new Button("page " + (41)); + Button b42 = new Button("page " + (42)); + Button b43 = new Button("page " + (43)); + Button b44 = new Button("page " + (44)); + Button b45 = new Button("page " + (45)); + Button b46 = new Button("page " + (46)); + Button b47 = new Button("page " + (47)); + Button b48 = new Button("page " + (48)); + Button b49 = new Button("page " + (49)); + Button b50 = new Button("page " + (50)); + Button b51 = new Button("page " + (51)); + Button b52 = new Button("page " + (52)); + Button b53 = new Button("page " + (53)); + Button b54 = new Button("page " + (54)); + Button b55 = new Button("page " + (55)); + Button b56 = new Button("page " + (56)); + Button b57 = new Button("page " + (57)); + Button b58 = new Button("page " + (58)); + Button b59 = new Button("page " + (59)); + Button b60 = new Button("page " + (60)); + Button b61 = new Button("page " + (61)); + Button b62 = new Button("page " + (62)); + Button b63 = new Button("page " + (63)); + Label statusValueLabel = new Label("STOP" , Label.LEFT) ; + Label timeValueLabel = new Label("0" , Label.LEFT) ; + Label instructionValueLabel = new Label("NONE" , Label.LEFT) ; + Label addressValueLabel = new Label("NULL" , Label.LEFT) ; + Label pageFaultValueLabel = new Label("NO" , Label.LEFT) ; + Label virtualPageValueLabel = new Label("x" , Label.LEFT) ; + Label physicalPageValueLabel = new Label("0" , Label.LEFT) ; + Label RValueLabel = new Label("0" , Label.LEFT) ; + Label MValueLabel = new Label("0" , Label.LEFT) ; + Label inMemTimeValueLabel = new Label("0" , Label.LEFT) ; + Label lastTouchTimeValueLabel = new Label("0" , Label.LEFT) ; + Label lowValueLabel = new Label("0" , Label.LEFT) ; + Label highValueLabel = new Label("0" , Label.LEFT) ; + Label l0 = new Label(null, Label.CENTER); + Label l1 = new Label(null, Label.CENTER); + Label l2 = new Label(null, Label.CENTER); + Label l3 = new Label(null, Label.CENTER); + Label l4 = new Label(null, Label.CENTER); + Label l5 = new Label(null, Label.CENTER); + Label l6 = new Label(null, Label.CENTER); + Label l7 = new Label(null, Label.CENTER); + Label l8 = new Label(null, Label.CENTER); + Label l9 = new Label(null, Label.CENTER); + Label l10 = new Label(null, Label.CENTER); + Label l11 = new Label(null, Label.CENTER); + Label l12 = new Label(null, Label.CENTER); + Label l13 = new Label(null, Label.CENTER); + Label l14 = new Label(null, Label.CENTER); + Label l15 = new Label(null, Label.CENTER); + Label l16 = new Label(null, Label.CENTER); + Label l17 = new Label(null, Label.CENTER); + Label l18 = new Label(null, Label.CENTER); + Label l19 = new Label(null, Label.CENTER); + Label l20 = new Label(null, Label.CENTER); + Label l21 = new Label(null, Label.CENTER); + Label l22 = new Label(null, Label.CENTER); + Label l23 = new Label(null, Label.CENTER); + Label l24 = new Label(null, Label.CENTER); + Label l25 = new Label(null, Label.CENTER); + Label l26 = new Label(null, Label.CENTER); + Label l27 = new Label(null, Label.CENTER); + Label l28 = new Label(null, Label.CENTER); + Label l29 = new Label(null, Label.CENTER); + Label l30 = new Label(null, Label.CENTER); + Label l31 = new Label(null, Label.CENTER); + Label l32 = new Label(null, Label.CENTER); + Label l33 = new Label(null, Label.CENTER); + Label l34 = new Label(null, Label.CENTER); + Label l35 = new Label(null, Label.CENTER); + Label l36 = new Label(null, Label.CENTER); + Label l37 = new Label(null, Label.CENTER); + Label l38 = new Label(null, Label.CENTER); + Label l39 = new Label(null, Label.CENTER); + Label l40 = new Label(null, Label.CENTER); + Label l41 = new Label(null, Label.CENTER); + Label l42 = new Label(null, Label.CENTER); + Label l43 = new Label(null, Label.CENTER); + Label l44 = new Label(null, Label.CENTER); + Label l45 = new Label(null, Label.CENTER); + Label l46 = new Label(null, Label.CENTER); + Label l47 = new Label(null, Label.CENTER); + Label l48 = new Label(null, Label.CENTER); + Label l49 = new Label(null, Label.CENTER); + Label l50 = new Label(null, Label.CENTER); + Label l51 = new Label(null, Label.CENTER); + Label l52 = new Label(null, Label.CENTER); + Label l53 = new Label(null, Label.CENTER); + Label l54 = new Label(null, Label.CENTER); + Label l55 = new Label(null, Label.CENTER); + Label l56 = new Label(null, Label.CENTER); + Label l57 = new Label(null, Label.CENTER); + Label l58 = new Label(null, Label.CENTER); + Label l59 = new Label(null, Label.CENTER); + Label l60 = new Label(null, Label.CENTER); + Label l61 = new Label(null, Label.CENTER); + Label l62 = new Label(null, Label.CENTER); + Label l63 = new Label(null, Label.CENTER); + + public ControlPanel() + { + super(); + } + + public ControlPanel( String title ) + { + super(title); + } + + public void init( Kernel useKernel , String commands , String config ) + { + kernel = useKernel ; + kernel.setControlPanel( this ); + setLayout( null ); + setBackground( Color.white ); + setForeground( Color.black ); + resize( 635 , 545 ); + setFont( new Font( "Courier", 0, 12 ) ); + + runButton.setForeground( Color.blue ); + runButton.setBackground( Color.lightGray ); + runButton.reshape( 0,25,70,15 ); + add( runButton ); + + stepButton.setForeground( Color.blue ); + stepButton.setBackground( Color.lightGray ); + stepButton.reshape( 70,25,70,15 ); + add( stepButton ); + + resetButton.setForeground( Color.blue ); + resetButton.setBackground( Color.lightGray ); + resetButton.reshape( 140,25,70,15 ); + add( resetButton ); + + exitButton.setForeground( Color.blue ); + exitButton.setBackground( Color.lightGray ); + exitButton.reshape( 210,25,70,15 ); + add( exitButton ); + + b0.reshape(0, (0+2)*15+25, 70, 15); + b0.setForeground( Color.magenta ); + b0.setBackground( Color.lightGray ); + add ( b0 ); + + b1.reshape(0, (1+2)*15+25, 70, 15); + b1.setForeground( Color.magenta ); + b1.setBackground( Color.lightGray ); + add ( b1 ); + + b2.reshape(0, (2+2)*15+25, 70, 15); + b2.setForeground( Color.magenta ); + b2.setBackground( Color.lightGray ); + add ( b2 ); + + b3.reshape(0, (3+2)*15+25, 70, 15); + b3.setForeground( Color.magenta ); + b3.setBackground( Color.lightGray ); + add ( b3 ); + + b4.reshape(0, (4+2)*15+25, 70, 15); + b4.setForeground( Color.magenta ); + b4.setBackground( Color.lightGray ); + add ( b4 ); + + b5.reshape(0, (5+2)*15+25, 70, 15); + b5.setForeground( Color.magenta ); + b5.setBackground( Color.lightGray ); + add ( b5 ); + + b6.reshape(0, (6+2)*15+25, 70, 15); + b6.setForeground( Color.magenta ); + b6.setBackground( Color.lightGray ); + add ( b6 ); + + b7.reshape(0, (7+2)*15+25, 70, 15); + b7.setForeground( Color.magenta ); + b7.setBackground( Color.lightGray ); + add ( b7 ); + + b8.reshape(0, (8+2)*15+25, 70, 15); + b8.setForeground( Color.magenta ); + b8.setBackground( Color.lightGray ); + add ( b8 ); + + b9.reshape(0, (9+2)*15+25, 70, 15); + b9.setForeground( Color.magenta ); + b9.setBackground( Color.lightGray ); + add ( b9 ); + + b10.reshape(0, (10+2)*15+25, 70, 15); + b10.setForeground( Color.magenta ); + b10.setBackground( Color.lightGray ); + add ( b10 ); + + b11.reshape(0, (11+2)*15+25, 70, 15); + b11.setForeground( Color.magenta ); + b11.setBackground( Color.lightGray ); + add ( b11 ); + + b12.reshape(0, (12+2)*15+25, 70, 15); + b12.setForeground( Color.magenta ); + b12.setBackground( Color.lightGray ); + add ( b12 ); + + b13.reshape(0, (13+2)*15+25, 70, 15); + b13.setForeground( Color.magenta ); + b13.setBackground( Color.lightGray ); + add ( b13 ); + + b14.reshape(0, (14+2)*15+25, 70, 15); + b14.setForeground( Color.magenta ); + b14.setBackground( Color.lightGray ); + add ( b14 ); + + b15.reshape(0, (15+2)*15+25, 70, 15); + b15.setForeground( Color.magenta ); + b15.setBackground( Color.lightGray ); + add ( b15 ); + + b16.reshape(0, (16+2)*15+25, 70, 15); + b16.setForeground( Color.magenta ); + b16.setBackground( Color.lightGray ); + add ( b16 ); + + b17.reshape(0, (17+2)*15+25, 70, 15); + b17.setForeground( Color.magenta ); + b17.setBackground( Color.lightGray ); + add ( b17 ); + + b18.reshape(0, (18+2)*15+25, 70, 15); + b18.setForeground( Color.magenta ); + b18.setBackground( Color.lightGray ); + add ( b18 ); + + b19.reshape(0, (19+2)*15+25, 70, 15); + b19.setForeground( Color.magenta ); + b19.setBackground( Color.lightGray ); + add ( b19 ); + + b20.reshape(0, (20+2)*15+25, 70, 15); + b20.setForeground( Color.magenta ); + b20.setBackground( Color.lightGray ); + add ( b20 ); + + b21.reshape(0, (21+2)*15+25, 70, 15); + b21.setForeground( Color.magenta ); + b21.setBackground( Color.lightGray ); + add ( b21 ); + + b22.reshape(0, (22+2)*15+25, 70, 15); + b22.setForeground( Color.magenta ); + b22.setBackground( Color.lightGray ); + add ( b22 ); + + b23.reshape(0, (23+2)*15+25, 70, 15); + b23.setForeground( Color.magenta ); + b23.setBackground( Color.lightGray ); + add ( b23 ); + + b24.reshape(0, (24+2)*15+25, 70, 15); + b24.setForeground( Color.magenta ); + b24.setBackground( Color.lightGray ); + add ( b24 ); + + b25.reshape(0, (25+2)*15+25, 70, 15); + b25.setForeground( Color.magenta ); + b25.setBackground( Color.lightGray ); + add ( b25 ); + + b26.reshape(0, (26+2)*15+25, 70, 15); + b26.setForeground( Color.magenta ); + b26.setBackground( Color.lightGray ); + add ( b26 ); + + b27.reshape(0, (27+2)*15+25, 70, 15); + b27.setForeground( Color.magenta ); + b27.setBackground( Color.lightGray ); + add ( b27 ); + + b28.reshape(0, (28+2)*15+25, 70, 15); + b28.setForeground( Color.magenta ); + b28.setBackground( Color.lightGray ); + add ( b28 ); + + b29.reshape(0, (29+2)*15+25, 70, 15); + b29.setForeground( Color.magenta ); + b29.setBackground( Color.lightGray ); + add ( b29 ); + + b30.reshape(0, (30+2)*15+25, 70, 15); + b30.setForeground( Color.magenta ); + b30.setBackground( Color.lightGray ); + add ( b30 ); + + b31.reshape(0, (31+2)*15+25, 70, 15); + b31.setForeground( Color.magenta ); + b31.setBackground( Color.lightGray ); + add ( b31 ); + + b32.reshape(140, (0+2)*15+25, 70, 15); + b32.setForeground( Color.magenta ); + b32.setBackground( Color.lightGray ); + add ( b32 ); + + b33.reshape(140, (1+2)*15+25, 70, 15); + b33.setForeground( Color.magenta ); + b33.setBackground( Color.lightGray ); + add ( b33 ); + + b34.reshape(140, (2+2)*15+25, 70, 15); + b34.setForeground( Color.magenta ); + b34.setBackground( Color.lightGray ); + add ( b34 ); + + b35.reshape(140, (3+2)*15+25, 70, 15); + b35.setForeground( Color.magenta ); + b35.setBackground( Color.lightGray ); + add ( b35 ); + + b36.reshape(140, (4+2)*15+25, 70, 15); + b36.setForeground( Color.magenta ); + b36.setBackground( Color.lightGray ); + add ( b36 ); + + b37.reshape(140, (5+2)*15+25, 70, 15); + b37.setForeground( Color.magenta ); + b37.setBackground( Color.lightGray ); + add ( b37 ); + + b38.reshape(140, (6+2)*15+25, 70, 15); + b38.setForeground( Color.magenta ); + b38.setBackground( Color.lightGray ); + add ( b38 ); + + b39.reshape(140, (7+2)*15+25, 70, 15); + b39.setForeground( Color.magenta ); + b39.setBackground( Color.lightGray ); + add ( b39 ); + + b40.reshape(140, (8+2)*15+25, 70, 15); + b40.setForeground( Color.magenta ); + b40.setBackground( Color.lightGray ); + add ( b40 ); + + b41.reshape(140, (9+2)*15+25, 70, 15); + b41.setForeground( Color.magenta ); + b41.setBackground( Color.lightGray ); + add ( b41 ); + + b42.reshape(140, (10+2)*15+25, 70, 15); + b42.setForeground( Color.magenta ); + b42.setBackground( Color.lightGray ); + add ( b42 ); + + b43.reshape(140, (11+2)*15+25, 70, 15); + b43.setForeground( Color.magenta ); + b43.setBackground( Color.lightGray ); + add ( b43 ); + + b44.reshape(140, (12+2)*15+25, 70, 15); + b44.setForeground( Color.magenta ); + b44.setBackground( Color.lightGray ); + add ( b44 ); + + b45.reshape(140, (13+2)*15+25, 70, 15); + b45.setForeground( Color.magenta ); + b45.setBackground( Color.lightGray ); + add ( b45 ); + + b46.reshape(140, (14+2)*15+25, 70, 15); + b46.setForeground( Color.magenta ); + b46.setBackground( Color.lightGray ); + add ( b46 ); + + b47.reshape(140, (15+2)*15+25, 70, 15); + b47.setForeground( Color.magenta ); + b47.setBackground( Color.lightGray ); + add ( b47 ); + + b48.reshape(140, (16+2)*15+25, 70, 15); + b48.setForeground( Color.magenta ); + b48.setBackground( Color.lightGray ); + add ( b48 ); + + b49.reshape(140, (17+2)*15+25, 70, 15); + b49.setForeground( Color.magenta ); + b49.setBackground( Color.lightGray ); + add ( b49 ); + + b50.reshape(140, (18+2)*15+25, 70, 15); + b50.setForeground( Color.magenta ); + b50.setBackground( Color.lightGray ); + add ( b50 ); + + b51.reshape(140, (19+2)*15+25, 70, 15); + b51.setForeground( Color.magenta ); + b51.setBackground( Color.lightGray ); + add ( b51 ); + + b52.reshape(140, (20+2)*15+25, 70, 15); + b52.setForeground( Color.magenta ); + b52.setBackground( Color.lightGray ); + add ( b52 ); + + b53.reshape(140, (21+2)*15+25, 70, 15); + b53.setForeground( Color.magenta ); + b53.setBackground( Color.lightGray ); + add ( b53 ); + + b54.reshape(140, (22+2)*15+25, 70, 15); + b54.setForeground( Color.magenta ); + b54.setBackground( Color.lightGray ); + add ( b54 ); + + b55.reshape(140, (23+2)*15+25, 70, 15); + b55.setForeground( Color.magenta ); + b55.setBackground( Color.lightGray ); + add ( b55 ); + + b56.reshape(140, (24+2)*15+25, 70, 15); + b56.setForeground( Color.magenta ); + b56.setBackground( Color.lightGray ); + add ( b56 ); + + b57.reshape(140, (25+2)*15+25, 70, 15); + b57.setForeground( Color.magenta ); + b57.setBackground( Color.lightGray ); + add ( b57 ); + + b58.reshape(140, (26+2)*15+25, 70, 15); + b58.setForeground( Color.magenta ); + b58.setBackground( Color.lightGray ); + add ( b58 ); + + b59.reshape(140, (27+2)*15+25, 70, 15); + b59.setForeground( Color.magenta ); + b59.setBackground( Color.lightGray ); + add ( b59 ); + + b60.reshape(140, (28+2)*15+25, 70, 15); + b60.setForeground( Color.magenta ); + b60.setBackground( Color.lightGray ); + add ( b60 ); + + b61.reshape(140, (29+2)*15+25, 70, 15); + b61.setForeground( Color.magenta ); + b61.setBackground( Color.lightGray ); + add ( b61 ); + + b62.reshape(140, (30+2)*15+25, 70, 15); + b62.setForeground( Color.magenta ); + b62.setBackground( Color.lightGray ); + add ( b62 ); + + b63.reshape(140, (31+2)*15+25, 70, 15); + b63.setForeground( Color.magenta ); + b63.setBackground( Color.lightGray ); + add ( b63 ); + + statusValueLabel.reshape( 345,0+25,100,15 ); + add( statusValueLabel ); + + timeValueLabel.reshape( 345,15+25,100,15 ); + add( timeValueLabel ); + + instructionValueLabel.reshape( 385,45+25,100,15 ); + add( instructionValueLabel ); + + addressValueLabel.reshape(385,60+25,230,15); + add( addressValueLabel ); + + pageFaultValueLabel.reshape( 385,90+25,100,15 ); + add( pageFaultValueLabel ); + + virtualPageValueLabel.reshape( 395,120+25,200,15 ); + add( virtualPageValueLabel ); + + physicalPageValueLabel.reshape( 395,135+25,200,15 ); + add( physicalPageValueLabel ); + + RValueLabel.reshape( 395,150+25,200,15 ); + add( RValueLabel ); + + MValueLabel.reshape( 395,165+25,200,15 ); + add( MValueLabel ); + + inMemTimeValueLabel.reshape(395,180+25,200,15 ); + add( inMemTimeValueLabel ); + + lastTouchTimeValueLabel.reshape( 395,195+25,200,15 ); + add( lastTouchTimeValueLabel ); + + lowValueLabel.reshape( 395,210+25,230,15 ); + add( lowValueLabel ); + + highValueLabel.reshape( 395,225+25,230,15 ); + add( highValueLabel ); + + Label virtualOneLabel = new Label( "virtual" , Label.CENTER) ; + virtualOneLabel.reshape(0,15+25,70,15); + add(virtualOneLabel); + + Label virtualTwoLabel = new Label( "virtual" , Label.CENTER) ; + virtualTwoLabel.reshape(140,15+25,70,15); + add(virtualTwoLabel); + + Label physicalOneLabel = new Label( "physical" , Label.CENTER) ; + physicalOneLabel.reshape(70,15+25,70,15); + add(physicalOneLabel); + + Label physicalTwoLabel = new Label( "physical" , Label.CENTER) ; + physicalTwoLabel.reshape(210,15+25,70,15); + add(physicalTwoLabel); + + Label statusLabel = new Label("status: " , Label.LEFT) ; + statusLabel.reshape(285,0+25,65,15); + add(statusLabel); + + Label timeLabel = new Label("time: " , Label.LEFT) ; + timeLabel.reshape(285,15+25,50,15); + add(timeLabel); + + Label instructionLabel = new Label("instruction: " , Label.LEFT) ; + instructionLabel.reshape(285,45+25,100,15); + add(instructionLabel); + + Label addressLabel = new Label("address: " , Label.LEFT) ; + addressLabel.reshape(285,60+25,85,15); + add(addressLabel); + + Label pageFaultLabel = new Label("page fault: " , Label.LEFT) ; + pageFaultLabel.reshape(285,90+25,100,15); + add(pageFaultLabel); + + Label virtualPageLabel = new Label("virtual page: " , Label.LEFT) ; + virtualPageLabel.reshape(285,120+25,110,15); + add(virtualPageLabel); + + Label physicalPageLabel = new Label("physical page: " , Label.LEFT) ; + physicalPageLabel.reshape(285,135+25,110,15); + add(physicalPageLabel); + + Label RLabel = new Label("R: ", Label.LEFT) ; + RLabel.reshape(285,150+25,110,15); + add(RLabel); + + Label MLabel = new Label("M: " , Label.LEFT) ; + MLabel.reshape(285,165+25,110,15); + add(MLabel); + + Label inMemTimeLabel = new Label("inMemTime: " , Label.LEFT) ; + inMemTimeLabel.reshape(285,180+25,110,15); + add(inMemTimeLabel); + + Label lastTouchTimeLabel = new Label("lastTouchTime: " , Label.LEFT) ; + lastTouchTimeLabel.reshape(285,195+25,110,15); + add(lastTouchTimeLabel); + + Label lowLabel = new Label("low: " , Label.LEFT) ; + lowLabel.reshape(285,210+25,110,15); + add(lowLabel); + + Label highLabel = new Label("high: " , Label.LEFT) ; + highLabel.reshape(285,225+25,110,15); + add(highLabel); + + l0.reshape( 70, (2)*15+25, 60, 15 ); + l0.setForeground( Color.red ); + l0.setFont( new Font( "Courier", 0, 10 ) ); + add( l0 ); + + l1.reshape( 70, (3)*15+25, 60, 15 ); + l1.setForeground( Color.red ); + l1.setFont( new Font( "Courier", 0, 10 ) ); + add( l1 ); + + l2.reshape( 70, (4)*15+25, 60, 15 ); + l2.setForeground( Color.red ); + l2.setFont( new Font( "Courier", 0, 10 ) ); + add( l2 ); + + l3.reshape( 70, (5)*15+25, 60, 15 ); + l3.setForeground( Color.red ); + l3.setFont( new Font( "Courier", 0, 10 ) ); + add( l3 ); + + l4.reshape( 70, (6)*15+25, 60, 15 ); + l4.setForeground( Color.red ); + l4.setFont( new Font( "Courier", 0, 10 ) ); + add( l4 ); + + l5.reshape( 70, (7)*15+25, 60, 15 ); + l5.setForeground( Color.red ); + l5.setFont( new Font( "Courier", 0, 10 ) ); + add( l5 ); + + l6.reshape( 70, (8)*15+25, 60, 15 ); + l6.setForeground( Color.red ); + l6.setFont( new Font( "Courier", 0, 10 ) ); + add( l6 ); + + l7.reshape( 70, (9)*15+25, 60, 15 ); + l7.setForeground( Color.red ); + l7.setFont( new Font( "Courier", 0, 10 ) ); + add( l7 ); + + l8.reshape( 70, (10)*15+25, 60, 15 ); + l8.setForeground( Color.red ); + l8.setFont( new Font( "Courier", 0, 10 ) ); + add( l8 ); + + l9.reshape( 70, (11)*15+25, 60, 15 ); + l9.setForeground( Color.red ); + l9.setFont( new Font( "Courier", 0, 10 ) ); + add( l9 ); + + l10.reshape( 70, (12)*15+25, 60, 15 ); + l10.setForeground( Color.red ); + l10.setFont( new Font( "Courier", 0, 10 ) ); + add( l10 ); + + l11.reshape( 70, (13)*15+25, 60, 15 ); + l11.setForeground( Color.red ); + l11.setFont( new Font( "Courier", 0, 10 ) ); + add( l11 ); + + l12.reshape( 70, (14)*15+25, 60, 15 ); + l12.setForeground( Color.red ); + l12.setFont( new Font( "Courier", 0, 10 ) ); + add( l12 ); + + l13.reshape( 70, (15)*15+25, 60, 15 ); + l13.setForeground( Color.red ); + l13.setFont( new Font( "Courier", 0, 10 ) ); + add( l13 ); + + l14.reshape( 70, (16)*15+25, 60, 15 ); + l14.setForeground( Color.red ); + l14.setFont( new Font( "Courier", 0, 10 ) ); + add( l14 ); + + l15.reshape( 70, (17)*15+25, 60, 15 ); + l15.setForeground( Color.red ); + l15.setFont( new Font( "Courier", 0, 10 ) ); + add( l15 ); + + l16.reshape( 70, (18)*15+25, 60, 15 ); + l16.setForeground( Color.red ); + l16.setFont( new Font( "Courier", 0, 10 ) ); + add( l16 ); + + l17.reshape( 70, (19)*15+25, 60, 15 ); + l17.setForeground( Color.red ); + l17.setFont( new Font( "Courier", 0, 10 ) ); + add( l17 ); + + l18.reshape( 70, (20)*15+25, 60, 15 ); + l18.setForeground( Color.red ); + l18.setFont( new Font( "Courier", 0, 10 ) ); + add( l18 ); + + l19.reshape( 70, (21)*15+25, 60, 15 ); + l19.setForeground( Color.red ); + l19.setFont( new Font( "Courier", 0, 10 ) ); + add( l19 ); + + l20.reshape( 70, (22)*15+25, 60, 15 ); + l20.setForeground( Color.red ); + l20.setFont( new Font( "Courier", 0, 10 ) ); + add( l20 ); + + l21.reshape( 70, (23)*15+25, 60, 15 ); + l21.setForeground( Color.red ); + l21.setFont( new Font( "Courier", 0, 10 ) ); + add( l21 ); + + l22.reshape( 70, (24)*15+25, 60, 15 ); + l22.setForeground( Color.red ); + l22.setFont( new Font( "Courier", 0, 10 ) ); + add( l22 ); + + l23.reshape( 70, (25)*15+25, 60, 15 ); + l23.setForeground( Color.red ); + l23.setFont( new Font( "Courier", 0, 10 ) ); + add( l23 ); + + l24.reshape( 70, (26)*15+25, 60, 15 ); + l24.setForeground( Color.red ); + l24.setFont( new Font( "Courier", 0, 10 ) ); + add( l24 ); + + l25.reshape( 70, (27)*15+25, 60, 15 ); + l25.setForeground( Color.red ); + l25.setFont( new Font( "Courier", 0, 10 ) ); + add( l25 ); + + l26.reshape( 70, (28)*15+25, 60, 15 ); + l26.setForeground( Color.red ); + l26.setFont( new Font( "Courier", 0, 10 ) ); + add( l26 ); + + l27.reshape( 70, (29)*15+25, 60, 15 ); + l27.setForeground( Color.red ); + l27.setFont( new Font( "Courier", 0, 10 ) ); + add( l27 ); + + l28.reshape( 70, (30)*15+25, 60, 15 ); + l28.setForeground( Color.red ); + l28.setFont( new Font( "Courier", 0, 10 ) ); + add( l28 ); + + l29.reshape( 70, (31)*15+25, 60, 15 ); + l29.setForeground( Color.red ); + l29.setFont( new Font( "Courier", 0, 10 ) ); + add( l29 ); + + l30.reshape( 70, (32)*15+25, 60, 15 ); + l30.setForeground( Color.red ); + l30.setFont( new Font( "Courier", 0, 10 ) ); + add( l30 ); + + l31.reshape( 70, (33)*15+25, 60, 15 ); + l31.setForeground( Color.red ); + l31.setFont( new Font( "Courier", 0, 10 ) ); + add( l31 ); + + l32.reshape( 210, (2)*15+25, 60, 15 ); + l32.setForeground( Color.red ); + l32.setFont( new Font( "Courier", 0, 10 ) ); + add( l32 ); + + l33.reshape( 210, (3)*15+25, 60, 15 ); + l33.setForeground( Color.red ); + l33.setFont( new Font( "Courier", 0, 10 ) ); + add( l33 ); + + l34.reshape( 210, (4)*15+25, 60, 15 ); + l34.setForeground( Color.red ); + l34.setFont( new Font( "Courier", 0, 10 ) ); + add( l34 ); + + l35.reshape( 210, (5)*15+25, 60, 15 ); + l35.setForeground( Color.red ); + l35.setFont( new Font( "Courier", 0, 10 ) ); + add( l35 ); + + l36.reshape( 210, (6)*15+25, 60, 15 ); + l36.setForeground( Color.red ); + l36.setFont( new Font( "Courier", 0, 10 ) ); + add( l36 ); + + l37.reshape( 210, (7)*15+25, 60, 15 ); + l37.setForeground( Color.red ); + l37.setFont( new Font( "Courier", 0, 10 ) ); + add( l37 ); + + l38.reshape( 210, (8)*15+25, 60, 15 ); + l38.setForeground( Color.red ); + l38.setFont( new Font( "Courier", 0, 10 ) ); + add( l38 ); + + l39.reshape( 210, (9)*15+25, 60, 15 ); + l39.setForeground( Color.red ); + l39.setFont( new Font( "Courier", 0, 10 ) ); + add( l39 ); + + l40.reshape( 210, (10)*15+25, 60, 15 ); + l40.setForeground( Color.red ); + l40.setFont( new Font( "Courier", 0, 10 ) ); + add( l40 ); + + l41.reshape( 210, (11)*15+25, 60, 15 ); + l41.setForeground( Color.red ); + l41.setFont( new Font( "Courier", 0, 10 ) ); + add( l41 ); + + l42.reshape( 210, (12)*15+25, 60, 15 ); + l42.setForeground( Color.red ); + l42.setFont( new Font( "Courier", 0, 10 ) ); + add( l42 ); + + l43.reshape( 210, (13)*15+25, 60, 15 ); + l43.setForeground( Color.red ); + l43.setFont( new Font( "Courier", 0, 10 ) ); + add( l43 ); + + l44.reshape( 210, (14)*15+25, 60, 15 ); + l44.setForeground( Color.red ); + l44.setFont( new Font( "Courier", 0, 10 ) ); + add( l44 ); + + l45.reshape( 210, (15)*15+25, 60, 15 ); + l45.setForeground( Color.red ); + l45.setFont( new Font( "Courier", 0, 10 ) ); + add( l45 ); + + l46.reshape( 210, (16)*15+25, 60, 15 ); + l46.setForeground( Color.red ); + l46.setFont( new Font( "Courier", 0, 10 ) ); + add( l46 ); + + l47.reshape( 210, (17)*15+25, 60, 15 ); + l47.setForeground( Color.red ); + l47.setFont( new Font( "Courier", 0, 10 ) ); + add( l47 ); + + l48.reshape( 210, (18)*15+25, 60, 15 ); + l48.setForeground( Color.red ); + l48.setFont( new Font( "Courier", 0, 10 ) ); + add( l48 ); + + l49.reshape( 210, (19)*15+25, 60, 15 ); + l49.setForeground( Color.red ); + l49.setFont( new Font( "Courier", 0, 10 ) ); + add( l49 ); + + l50.reshape( 210, (20)*15+25, 60, 15 ); + l50.setForeground( Color.red ); + l50.setFont( new Font( "Courier", 0, 10 ) ); + add( l50 ); + + l51.reshape( 210, (21)*15+25, 60, 15 ); + l51.setForeground( Color.red ); + l51.setFont( new Font( "Courier", 0, 10 ) ); + add( l51 ); + + l52.reshape( 210, (22)*15+25, 60, 15 ); + l52.setForeground( Color.red ); + l52.setFont( new Font( "Courier", 0, 10 ) ); + add( l52 ); + + l53.reshape( 210, (23)*15+25, 60, 15 ); + l53.setForeground( Color.red ); + l53.setFont( new Font( "Courier", 0, 10 ) ); + add( l53 ); + + l54.reshape( 210, (24)*15+25, 60, 15 ); + l54.setForeground( Color.red ); + l54.setFont( new Font( "Courier", 0, 10 ) ); + add( l54 ); + + l55.reshape( 210, (25)*15+25, 60, 15 ); + l55.setForeground( Color.red ); + l55.setFont( new Font( "Courier", 0, 10 ) ); + add( l55 ); + + l56.reshape( 210, (26)*15+25, 60, 15 ); + l56.setForeground( Color.red ); + l56.setFont( new Font( "Courier", 0, 10 ) ); + add( l56 ); + + l57.reshape( 210, (27)*15+25, 60, 15 ); + l57.setForeground( Color.red ); + l57.setFont( new Font( "Courier", 0, 10 ) ); + add( l57 ); + + l58.reshape( 210, (28)*15+25, 60, 15 ); + l58.setForeground( Color.red ); + l58.setFont( new Font( "Courier", 0, 10 ) ); + add( l58 ); + + l59.reshape( 210, (29)*15+25, 60, 15 ); + l59.setForeground( Color.red ); + l59.setFont( new Font( "Courier", 0, 10 ) ); + add( l59 ); + + l60.reshape( 210, (30)*15+25, 60, 15 ); + l60.setForeground( Color.red ); + l60.setFont( new Font( "Courier", 0, 10 ) ); + add( l60 ); + + l61.reshape( 210, (31)*15+25, 60, 15 ); + l61.setForeground( Color.red ); + l61.setFont( new Font( "Courier", 0, 10 ) ); + add( l61 ); + + l62.reshape( 210, (32)*15+25, 60, 15 ); + l62.setForeground( Color.red ); + l62.setFont( new Font( "Courier", 0, 10 ) ); + add( l62 ); + + + l63.reshape( 210, (33)*15+25, 60, 15 ); + l63.setForeground( Color.red ); + l63.setFont( new Font( "Courier", 0, 10 ) ); + add( l63 ); + + kernel.init( commands , config ); + + show(); + } + + public void paintPage( Page page ) + { + virtualPageValueLabel.setText( Integer.toString( page.id ) ); + physicalPageValueLabel.setText( Integer.toString( page.physical ) ); + RValueLabel.setText( Integer.toString( page.R ) ); + MValueLabel.setText( Integer.toString( page.M ) ); + inMemTimeValueLabel.setText( Integer.toString( page.inMemTime ) ); + lastTouchTimeValueLabel.setText( Integer.toString( page.lastTouchTime ) ); + lowValueLabel.setText(Long.toString( page.low , Kernel.addressradix ) ); + highValueLabel.setText(Long.toString( page.high , Kernel.addressradix ) ); + } + + public void setStatus(String status) { + statusValueLabel.setText(status); + } + + public void addPhysicalPage( int pageNum , int physicalPage ) + { + if ( physicalPage == 0 ) + { + l0.setText( "page " + pageNum ); + } + else if ( physicalPage == 1) + { + l1.setText( "page " + pageNum ); + } + else if ( physicalPage == 2) + { + l2.setText( "page " + pageNum ); + } + else if ( physicalPage == 3) + { + l3.setText( "page " + pageNum ); + } + else if ( physicalPage == 4) + { + l4.setText( "page " + pageNum ); + } + else if ( physicalPage == 5) + { + l5.setText( "page " + pageNum ); + } + else if ( physicalPage == 6) + { + l6.setText( "page " + pageNum ); + } + else if ( physicalPage == 7) + { + l7.setText( "page " + pageNum ); + } + else if ( physicalPage == 8) + { + l8.setText( "page " + pageNum ); + } + else if ( physicalPage == 9) + { + l9.setText( "page " + pageNum ); + } + else if ( physicalPage == 10) + { + l10.setText( "page " + pageNum ); + } + else if ( physicalPage == 11) + { + l11.setText( "page " + pageNum ); + } + else if ( physicalPage == 12) + { + l12.setText( "page " + pageNum ); + } + else if ( physicalPage == 13) + { + l13.setText( "page " + pageNum ); + } + else if ( physicalPage == 14) + { + l14.setText( "page " + pageNum ); + } + else if ( physicalPage == 15) + { + l15.setText( "page " + pageNum ); + } + else if ( physicalPage == 16) + { + l16.setText( "page " + pageNum ); + } + else if ( physicalPage == 17) + { + l17.setText( "page " + pageNum ); + } + else if ( physicalPage == 18) + { + l18.setText( "page " + pageNum ); + } + else if ( physicalPage == 19) + { + l19.setText( "page " + pageNum ); + } + else if ( physicalPage == 20) + { + l20.setText( "page " + pageNum ); + } + else if ( physicalPage == 21) + { + l21.setText( "page " + pageNum ); + } + else if ( physicalPage == 22) + { + l22.setText( "page " + pageNum ); + } + else if ( physicalPage == 23) + { + l23.setText( "page " + pageNum ); + } + else if ( physicalPage == 24) + { + l24.setText( "page " + pageNum ); + } + else if ( physicalPage == 25) + { + l25.setText( "page " + pageNum ); + } + else if ( physicalPage == 26) + { + l26.setText( "page " + pageNum ); + } + else if ( physicalPage == 27) + { + l27.setText( "page " + pageNum ); + } + else if ( physicalPage == 28) + { + l28.setText( "page " + pageNum ); + } + else if ( physicalPage == 29) + { + l29.setText( "page " + pageNum ); + } + else if ( physicalPage == 30) + { + l30.setText( "page " + pageNum ); + } + else if ( physicalPage == 31) + { + l31.setText( "page " + pageNum ); + } + else if ( physicalPage == 32) + { + l32.setText( "page " + pageNum ); + } + else if ( physicalPage == 33) + { + l33.setText( "page " + pageNum ); + } + else if ( physicalPage == 34) + { + l34.setText( "page " + pageNum ); + } + else if ( physicalPage == 35) + { + l35.setText( "page " + pageNum ); + } + else if ( physicalPage == 36) + { + l36.setText( "page " + pageNum ); + } + else if ( physicalPage == 37) + { + l37.setText( "page " + pageNum ); + } + else if ( physicalPage == 38) + { + l38.setText( "page " + pageNum ); + } + else if ( physicalPage == 39) + { + l39.setText( "page " + pageNum ); + } + else if ( physicalPage == 40) + { + l40.setText( "page " + pageNum ); + } + else if ( physicalPage == 41) + { + l41.setText( "page " + pageNum ); + } + else if ( physicalPage == 42) + { + l42.setText( "page " + pageNum ); + } + else if ( physicalPage == 43) + { + l43.setText( "page " + pageNum ); + } + else if ( physicalPage == 44) + { + l44.setText( "page " + pageNum ); + } + else if ( physicalPage == 45) + { + l45.setText( "page " + pageNum ); + } + else if ( physicalPage == 46) + { + l46.setText( "page " + pageNum ); + } + else if ( physicalPage == 47) + { + l47.setText( "page " + pageNum ); + } + else if ( physicalPage == 48) + { + l48.setText( "page " + pageNum ); + } + else if ( physicalPage == 49) + { + l49.setText( "page " + pageNum ); + } + else if ( physicalPage == 50) + { + l50.setText( "page " + pageNum ); + } + else if ( physicalPage == 51) + { + l51.setText( "page " + pageNum ); + } + else if ( physicalPage == 52) + { + l52.setText( "page " + pageNum ); + } + else if ( physicalPage == 53) + { + l53.setText( "page " + pageNum ); + } + else if ( physicalPage == 54) + { + l54.setText( "page " + pageNum ); + } + else if ( physicalPage == 55) + { + l55.setText( "page " + pageNum ); + } + else if ( physicalPage == 56) + { + l56.setText( "page " + pageNum ); + } + else if ( physicalPage == 57) + { + l57.setText( "page " + pageNum ); + } + else if ( physicalPage == 58) + { + l58.setText( "page " + pageNum ); + } + else if ( physicalPage == 59) + { + l59.setText( "page " + pageNum ); + } + else if ( physicalPage == 60) + { + l60.setText( "page " + pageNum ); + } + else if ( physicalPage == 61) + { + l61.setText( "page " + pageNum ); + } + else if ( physicalPage == 62) + { + l62.setText( "page " + pageNum ); + } + else if ( physicalPage == 63) + { + l63.setText( "page " + pageNum ); + } + else + { + return; + } + } + + public void removePhysicalPage( int physicalPage ) + { + if ( physicalPage == 0 ) + { + l0.setText( null ); + } + else if ( physicalPage == 1) + { + l1.setText( null ); + } + else if ( physicalPage == 2) + { + l2.setText(null ); + } + else if ( physicalPage == 3) + { + l3.setText( null ); + } + else if ( physicalPage == 4) + { + l4.setText( null ); + } + else if ( physicalPage == 5) + { + l5.setText( null ); + } + else if ( physicalPage == 6) + { + l6.setText( null ); + } + else if ( physicalPage == 7) + { + l7.setText( null ); + } + else if ( physicalPage == 8) + { + l8.setText( null ); + } + else if ( physicalPage == 9) + { + l9.setText( null ); + } + else if ( physicalPage == 10) + { + l10.setText( null ); + } + else if ( physicalPage == 11) + { + l11.setText( null ); + } + else if ( physicalPage == 12) + { + l12.setText( null ); + } + else if ( physicalPage == 13) + { + l13.setText( null ); + } + else if ( physicalPage == 14) + { + l14.setText( null ); + } + else if ( physicalPage == 15) + { + l15.setText( null ); + } + else if ( physicalPage == 16) + { + l16.setText( null ); + } + else if ( physicalPage == 17) + { + l17.setText( null ); + } + else if ( physicalPage == 18) + { + l18.setText( null ); + } + else if ( physicalPage == 19) + { + l19.setText( null ); + } + else if ( physicalPage == 20) + { + l20.setText( null ); + } + else if ( physicalPage == 21) + { + l21.setText( null ); + } + else if ( physicalPage == 22) + { + l22.setText( null ); + } + else if ( physicalPage == 23) + { + l23.setText( null ); + } + else if ( physicalPage == 24) + { + l24.setText( null ); + } + else if ( physicalPage == 25) + { + l25.setText( null ); + } + else if ( physicalPage == 26) + { + l26.setText( null ); + } + else if ( physicalPage == 27) + { + l27.setText( null ); + } + else if ( physicalPage == 28) + { + l28.setText( null ); + } + else if ( physicalPage == 29) + { + l29.setText( null ); + } + else if ( physicalPage == 30) + { + l30.setText( null ); + } + else if ( physicalPage == 31) + { + l31.setText( null ); + } + else if ( physicalPage == 32) + { + l32.setText( null ); + } + else if ( physicalPage == 33) + { + l33.setText( null ); + } + else if ( physicalPage == 34) + { + l34.setText( null ); + } + else if ( physicalPage == 35) + { + l35.setText( null ); + } + else if ( physicalPage == 36) + { + l36.setText( null ); + } + else if ( physicalPage == 37) + { + l37.setText( null ); + } + else if ( physicalPage == 38) + { + l38.setText( null ); + } + else if ( physicalPage == 39) + { + l39.setText( null ); + } + else if ( physicalPage == 40) + { + l40.setText( null ); + } + else if ( physicalPage == 41) + { + l41.setText( null ); + } + else if ( physicalPage == 42) + { + l42.setText( null ); + } + else if ( physicalPage == 43) + { + l43.setText( null ); + } + else if ( physicalPage == 44) + { + l44.setText( null ); + } + else if ( physicalPage == 45) + { + l45.setText( null ); + } + else if ( physicalPage == 46) + { + l46.setText( null ); + } + else if ( physicalPage == 47) + { + l47.setText( null ); + } + else if ( physicalPage == 48) + { + l48.setText( null ); + } + else if ( physicalPage == 49) + { + l49.setText( null ); + } + else if ( physicalPage == 50) + { + l50.setText( null ); + } + else if ( physicalPage == 51) + { + l51.setText( null ); + } + else if ( physicalPage == 52) + { + l52.setText( null ); + } + else if ( physicalPage == 53) + { + l53.setText( null ); + } + else if ( physicalPage == 54) + { + l54.setText( null ); + } + else if ( physicalPage == 55) + { + l55.setText( null ); + } + else if ( physicalPage == 56) + { + l56.setText( null ); + } + else if ( physicalPage == 57) + { + l57.setText( null ); + } + else if ( physicalPage == 58) + { + l58.setText( null ); + } + else if ( physicalPage == 59) + { + l59.setText( null ); + } + else if ( physicalPage == 60) + { + l60.setText( null ); + } + else if ( physicalPage == 61) + { + l61.setText( null ); + } + else if ( physicalPage == 62) + { + l62.setText( null ); + } + else if ( physicalPage == 63) + { + l63.setText( null ); + } + else + { + return; + } + } + + + public boolean action( Event e, Object arg ) + { + if ( e.target == runButton ) + { + setStatus( "RUN" ); + runButton.disable(); + stepButton.disable(); + resetButton.disable(); + kernel.run(); + setStatus( "STOP" ); + resetButton.enable(); + return true; + } + else if ( e.target == stepButton ) + { + setStatus( "STEP" ); + kernel.step(); + if (kernel.runcycles == kernel.runs) { + stepButton.disable(); + runButton.disable(); + } + setStatus("STOP"); + return true; + } + else if ( e.target == resetButton ) + { + kernel.reset(); + runButton.enable(); + stepButton.enable(); + return true; + } + else if ( e.target == exitButton ) + { + System.exit(0); + return true; + } + else if ( e.target == b0 ) + { + kernel.getPage(0); + return true; + } + else if ( e.target == b1 ) + { + kernel.getPage(1); + return true; + } + else if ( e.target == b2 ) + { + kernel.getPage(2); + return true; + } + else if ( e.target == b3 ) + { + kernel.getPage(3); + return true; + } + else if ( e.target == b4 ) + { + kernel.getPage(4); + return true; + } + else if ( e.target == b5 ) + { + kernel.getPage(5); + return true; + } + else if ( e.target == b6 ) + { + kernel.getPage(6); + return true; + } + else if ( e.target == b7 ) + { + kernel.getPage(7); + return true; + } + else if ( e.target == b8 ) + { + kernel.getPage(8); + return true; + } + else if ( e.target == b9 ) + { + kernel.getPage(9); + return true; + } + else if ( e.target == b10 ) + { + kernel.getPage(10); + return true; + } + else if ( e.target == b11 ) + { + kernel.getPage(11); + return true; + } + else if ( e.target == b12 ) + { + kernel.getPage(12); + return true; + } + else if ( e.target == b13 ) + { + kernel.getPage(13); + return true; + } + else if ( e.target == b14 ) + { + kernel.getPage(14); + return true; + } + else if ( e.target == b15 ) + { + kernel.getPage(15); + return true; + } + else if ( e.target == b16 ) + { + kernel.getPage(16); + return true; + } + else if ( e.target == b17 ) + { + kernel.getPage(17); + return true; + } + else if ( e.target == b18 ) + { + kernel.getPage(18); + return true; + } + else if ( e.target == b19 ) + { + kernel.getPage(19); + return true; + } + else if ( e.target == b20 ) + { + kernel.getPage(20); + return true; + } + else if ( e.target == b21 ) + { + kernel.getPage(21); + return true; + } + else if ( e.target == b22 ) + { + kernel.getPage(22); + return true; + } + else if ( e.target == b23 ) + { + kernel.getPage(23); + return true; + } + else if ( e.target == b24 ) + { + kernel.getPage(24); + return true; + } + else if ( e.target == b25 ) + { + kernel.getPage(25); + return true; + } + else if ( e.target == b26 ) + { + kernel.getPage(26); + return true; + } + else if ( e.target == b27 ) + { + kernel.getPage(27); + return true; + } + else if ( e.target == b28 ) + { + kernel.getPage(28); + return true; + } + else if ( e.target == b29 ) + { + kernel.getPage(29); + return true; + } + else if ( e.target == b30 ) + { + kernel.getPage(30); + return true; + } + else if ( e.target == b31 ) + { + kernel.getPage(31); + return true; + } + else if ( e.target == b32 ) + { + kernel.getPage(32); + return true; + } + else if ( e.target == b33 ) + { + kernel.getPage(33); + return true; + } + else if ( e.target == b34 ) + { + kernel.getPage(34); + return true; + } + else if ( e.target == b35 ) + { + kernel.getPage(35); + return true; + } + else if ( e.target == b36 ) + { + kernel.getPage(36); + return true; + } + else if ( e.target == b37 ) + { + kernel.getPage(37); + return true; + } + else if ( e.target == b38 ) + { + kernel.getPage(38); + return true; + } + else if ( e.target == b39 ) + { + kernel.getPage(39); + return true; + } + else if ( e.target == b40 ) + { + kernel.getPage(40); + return true; + } + else if ( e.target == b41 ) + { + kernel.getPage(41); + return true; + } + else if ( e.target == b42 ) + { + kernel.getPage(42); + return true; + } + else if ( e.target == b43 ) + { + kernel.getPage(43); + return true; + } + else if ( e.target == b44 ) + { + kernel.getPage(44); + return true; + } + else if ( e.target == b45 ) + { + kernel.getPage(45); + return true; + } + else if ( e.target == b46 ) + { + kernel.getPage(46); + return true; + } + else if ( e.target == b47 ) + { + kernel.getPage(47); + return true; + } + else if ( e.target == b48 ) + { + kernel.getPage(48); + return true; + } + else if ( e.target == b49 ) + { + kernel.getPage(49); + return true; + } + else if ( e.target == b50 ) + { + kernel.getPage(50); + return true; + } + else if ( e.target == b51 ) + { + kernel.getPage(51); + return true; + } + else if ( e.target == b52 ) + { + kernel.getPage(52); + return true; + } + else if ( e.target == b53 ) + { + kernel.getPage(53); + return true; + } + else if ( e.target == b54 ) + { + kernel.getPage(54); + return true; + } + else if ( e.target == b55 ) + { + kernel.getPage(55); + return true; + } + else if ( e.target == b56 ) + { + kernel.getPage(56); + return true; + } + else if ( e.target == b57 ) + { + kernel.getPage(57); + return true; + } + else if ( e.target == b58 ) + { + kernel.getPage(58); + return true; + } + else if ( e.target == b59 ) + { + kernel.getPage(59); + return true; + } + else if ( e.target == b60 ) + { + kernel.getPage(60); + return true; + } + else if ( e.target == b61 ) + { + kernel.getPage(61); + return true; + } + else if ( e.target == b62 ) + { + kernel.getPage(62); + return true; + } + else if ( e.target == b63 ) + { + kernel.getPage(63); + return true; + } + else + { + return false; + } + } +} diff --git a/EOPSY/lab4/task4/work/Instruction.class b/EOPSY/lab4/task4/work/Instruction.class new file mode 100644 index 00000000..9f6d3616 Binary files /dev/null and b/EOPSY/lab4/task4/work/Instruction.class differ diff --git a/EOPSY/lab4/task4/work/Instruction.java b/EOPSY/lab4/task4/work/Instruction.java new file mode 100644 index 00000000..3e3bbe3a --- /dev/null +++ b/EOPSY/lab4/task4/work/Instruction.java @@ -0,0 +1,12 @@ +public class Instruction +{ + public String inst; + public long addr; + + public Instruction( String inst, long addr ) + { + this.inst = inst; + this.addr = addr; + } + +} diff --git a/EOPSY/lab4/task4/work/Kernel.class b/EOPSY/lab4/task4/work/Kernel.class new file mode 100644 index 00000000..780ba7da Binary files /dev/null and b/EOPSY/lab4/task4/work/Kernel.class differ diff --git a/EOPSY/lab4/task4/work/Kernel.java b/EOPSY/lab4/task4/work/Kernel.java new file mode 100644 index 00000000..362f227d --- /dev/null +++ b/EOPSY/lab4/task4/work/Kernel.java @@ -0,0 +1,511 @@ +import java.lang.Thread; +import java.io.*; +import java.util.*; + +public class Kernel extends Thread +{ + // The number of virtual pages must be fixed at 63 due to + // dependencies in the GUI + private static int virtPageNum = 63; + + private String output = null; + private static final String lineSeparator = + System.getProperty("line.separator"); + private String command_file; + private String config_file; + private ControlPanel controlPanel ; + private Vector memVector = new Vector(); + private Vector instructVector = new Vector(); + private String status; + private boolean doStdoutLog = false; + private boolean doFileLog = false; + public int runs; + public int runcycles; + public long block = (int) Math.pow(2,12); + public static byte addressradix = 10; + + public void init( String commands , String config ) + { + File f = new File( commands ); + command_file = commands; + config_file = config; + String line; + String tmp = null; + String command = ""; + byte R = 0; + byte M = 0; + int i = 0; + int j = 0; + int id = 0; + int physical = 0; + int physical_count = 0; + int inMemTime = 0; + int lastTouchTime = 0; + int map_count = 0; + double power = 14; + long high = 0; + long low = 0; + long addr = 0; + long address_limit = (block * virtPageNum+1)-1; + + if ( config != null ) + { + f = new File ( config ); + try + { + DataInputStream in = new DataInputStream(new FileInputStream(f)); + while ((line = in.readLine()) != null) + { + if (line.startsWith("numpages")) + { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) + { + tmp = st.nextToken(); + virtPageNum = Common.s2i(st.nextToken()) - 1; + if ( virtPageNum < 2 || virtPageNum > 63 ) + { + System.out.println("MemoryManagement: numpages out of bounds."); + System.exit(-1); + } + address_limit = (block * virtPageNum+1)-1; + } + } + } + in.close(); + } catch (IOException e) { /* Handle exceptions */ } + for (i = 0; i <= virtPageNum; i++) + { + high = (block * (i + 1))-1; + low = block * i; + memVector.addElement(new Page(i, -1, R, M, 0, 0, high, low)); + } + try + { + DataInputStream in = new DataInputStream(new FileInputStream(f)); + while ((line = in.readLine()) != null) + + { + if (line.startsWith("memset")) + { + StringTokenizer st = new StringTokenizer(line); + st.nextToken(); + while (st.hasMoreTokens()) + { + id = Common.s2i(st.nextToken()); + tmp = st.nextToken(); + if (tmp.startsWith("x")) + { + physical = -1; + } + else + { + physical = Common.s2i(tmp); + } + if ((0 > id || id > virtPageNum) || (-1 > physical || physical > ((virtPageNum - 1) / 2))) + { + System.out.println("MemoryManagement: Invalid page value in " + config); + System.exit(-1); + } + R = Common.s2b(st.nextToken()); + if (R < 0 || R > 1) + { + System.out.println("MemoryManagement: Invalid R value in " + config); + System.exit(-1); + } + M = Common.s2b(st.nextToken()); + if (M < 0 || M > 1) + { + System.out.println("MemoryManagement: Invalid M value in " + config); + System.exit(-1); + } + inMemTime = Common.s2i(st.nextToken()); + if (inMemTime < 0) + { + System.out.println("MemoryManagement: Invalid inMemTime in " + config); + System.exit(-1); + } + lastTouchTime = Common.s2i(st.nextToken()); + if (lastTouchTime < 0) + { + System.out.println("MemoryManagement: Invalid lastTouchTime in " + config); + System.exit(-1); + } + Page page = (Page) memVector.elementAt(id); + page.physical = physical; + page.R = R; + page.M = M; + page.inMemTime = inMemTime; + page.lastTouchTime = lastTouchTime; + } + } + if (line.startsWith("enable_logging")) + { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) + { + if ( st.nextToken().startsWith( "true" ) ) + { + doStdoutLog = true; + } + } + } + if (line.startsWith("log_file")) + { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) + { + tmp = st.nextToken(); + } + if ( tmp.startsWith( "log_file" ) ) + { + doFileLog = false; + output = "tracefile"; + } + else + { + doFileLog = true; + doStdoutLog = false; + output = tmp; + } + } + if (line.startsWith("pagesize")) + { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) + { + tmp = st.nextToken(); + tmp = st.nextToken(); + if ( tmp.startsWith( "power" ) ) + { + power = (double) Integer.parseInt(st.nextToken()); + block = (int) Math.pow(2,power); + } + else + { + block = Long.parseLong(tmp,10); + } + address_limit = (block * virtPageNum+1)-1; + } + if ( block < 64 || block > Math.pow(2,26)) + { + System.out.println("MemoryManagement: pagesize is out of bounds"); + System.exit(-1); + } + for (i = 0; i <= virtPageNum; i++) + { + Page page = (Page) memVector.elementAt(i); + page.high = (block * (i + 1))-1; + page.low = block * i; + } + } + if (line.startsWith("addressradix")) + { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) + { + tmp = st.nextToken(); + tmp = st.nextToken(); + addressradix = Byte.parseByte(tmp); + if ( addressradix < 0 || addressradix > 20 ) + { + System.out.println("MemoryManagement: addressradix out of bounds."); + System.exit(-1); + } + } + } + } + in.close(); + } catch (IOException e) { /* Handle exceptions */ } + } + f = new File ( commands ); + try + { + DataInputStream in = new DataInputStream(new FileInputStream(f)); + while ((line = in.readLine()) != null) + { + if (line.startsWith("READ") || line.startsWith("WRITE")) + { + if (line.startsWith("READ")) + { + command = "READ"; + } + if (line.startsWith("WRITE")) + { + command = "WRITE"; + } + StringTokenizer st = new StringTokenizer(line); + tmp = st.nextToken(); + tmp = st.nextToken(); + if (tmp.startsWith("random")) + { + instructVector.addElement(new Instruction(command,Common.randomLong( address_limit ))); + } + else + { + if ( tmp.startsWith( "bin" ) ) + { + addr = Long.parseLong(st.nextToken(),2); + } + else if ( tmp.startsWith( "oct" ) ) + { + addr = Long.parseLong(st.nextToken(),8); + } + else if ( tmp.startsWith( "hex" ) ) + { + addr = Long.parseLong(st.nextToken(),16); + } + else + { + addr = Long.parseLong(tmp); + } + if (0 > addr || addr > address_limit) + { + System.out.println("MemoryManagement: " + addr + ", Address out of range in " + commands); + System.exit(-1); + } + instructVector.addElement(new Instruction(command,addr)); + } + } + } + in.close(); + } catch (IOException e) { /* Handle exceptions */ } + runcycles = instructVector.size(); + if ( runcycles < 1 ) + { + System.out.println("MemoryManagement: no instructions present for execution."); + System.exit(-1); + } + if ( doFileLog ) + { + File trace = new File(output); + trace.delete(); + } + runs = 0; + for (i = 0; i < virtPageNum; i++) + { + Page page = (Page) memVector.elementAt(i); + if ( page.physical != -1 ) + { + map_count++; + } + for (j = 0; j < virtPageNum; j++) + { + Page tmp_page = (Page) memVector.elementAt(j); + if (tmp_page.physical == page.physical && page.physical >= 0) + { + physical_count++; + } + } + if (physical_count > 1) + { + System.out.println("MemoryManagement: Duplicate physical page's in " + config); + System.exit(-1); + } + physical_count = 0; + } + if ( map_count < ( virtPageNum +1 ) / 2 ) + { + for (i = 0; i < virtPageNum; i++) + { + Page page = (Page) memVector.elementAt(i); + if ( page.physical == -1 && map_count < ( virtPageNum + 1 ) / 2 ) + { + page.physical = i; + map_count++; + } + } + } + for (i = 0; i < virtPageNum; i++) + { + Page page = (Page) memVector.elementAt(i); + if (page.physical == -1) + { + controlPanel.removePhysicalPage( i ); + } + else + { + controlPanel.addPhysicalPage( i , page.physical ); + } + } + for (i = 0; i < instructVector.size(); i++) + { + high = block * virtPageNum; + Instruction instruct = ( Instruction ) instructVector.elementAt( i ); + if ( instruct.addr < 0 || instruct.addr > high ) + { + System.out.println("MemoryManagement: Instruction (" + instruct.inst + " " + instruct.addr + ") out of bounds."); + System.exit(-1); + } + } + } + + public void setControlPanel(ControlPanel newControlPanel) + { + controlPanel = newControlPanel ; + } + + public void getPage(int pageNum) + { + Page page = ( Page ) memVector.elementAt( pageNum ); + controlPanel.paintPage( page ); + } + + private void printLogFile(String message) + { + String line; + String temp = ""; + + File trace = new File(output); + if (trace.exists()) + { + try + { + DataInputStream in = new DataInputStream( new FileInputStream( output ) ); + while ((line = in.readLine()) != null) { + temp = temp + line + lineSeparator; + } + in.close(); + } + catch ( IOException e ) + { + /* Do nothing */ + } + } + try + { + PrintStream out = new PrintStream( new FileOutputStream( output ) ); + out.print( temp ); + out.print( message ); + out.close(); + } + catch (IOException e) + { + /* Do nothing */ + } + } + + public void run() + { + step(); + while (runs != runcycles) + { + try + { + Thread.sleep(2000); + } + catch(InterruptedException e) + { + /* Do nothing */ + } + step(); + } + } + + public void step() + { + int i = 0; + + Instruction instruct = ( Instruction ) instructVector.elementAt( runs ); + controlPanel.instructionValueLabel.setText( instruct.inst ); + controlPanel.addressValueLabel.setText( Long.toString( instruct.addr , addressradix ) ); + getPage( Virtual2Physical.pageNum( instruct.addr , virtPageNum , block ) ); + if ( controlPanel.pageFaultValueLabel.getText() == "YES" ) + { + controlPanel.pageFaultValueLabel.setText( "NO" ); + } + if ( instruct.inst.startsWith( "READ" ) ) + { + Page page = ( Page ) memVector.elementAt( Virtual2Physical.pageNum( instruct.addr , virtPageNum , block ) ); + if ( page.physical == -1 ) + { + if ( doFileLog ) + { + printLogFile( "READ " + Long.toString(instruct.addr , addressradix) + " ... page fault" ); + } + if ( doStdoutLog ) + { + System.out.println( "READ " + Long.toString(instruct.addr , addressradix) + " ... page fault" ); + } + PageFault.replacePage( memVector , virtPageNum , Virtual2Physical.pageNum( instruct.addr , virtPageNum , block ) , controlPanel ); + controlPanel.pageFaultValueLabel.setText( "YES" ); + } + else + { + page.R = 1; + page.lastTouchTime = 0; + if ( doFileLog ) + { + printLogFile( "READ " + Long.toString( instruct.addr , addressradix ) + " ... okay" ); + } + if ( doStdoutLog ) + { + System.out.println( "READ " + Long.toString( instruct.addr , addressradix ) + " ... okay" ); + } + } + } + if ( instruct.inst.startsWith( "WRITE" ) ) + { + Page page = ( Page ) memVector.elementAt( Virtual2Physical.pageNum( instruct.addr , virtPageNum , block ) ); + if ( page.physical == -1 ) + { + if ( doFileLog ) + { + printLogFile( "WRITE " + Long.toString(instruct.addr , addressradix) + " ... page fault" ); + } + if ( doStdoutLog ) + { + System.out.println( "WRITE " + Long.toString(instruct.addr , addressradix) + " ... page fault" ); + } + PageFault.replacePage( memVector , virtPageNum , Virtual2Physical.pageNum( instruct.addr , virtPageNum , block ) , controlPanel ); controlPanel.pageFaultValueLabel.setText( "YES" ); + } + else + { + page.M = 1; + page.lastTouchTime = 0; + if ( doFileLog ) + { + printLogFile( "WRITE " + Long.toString(instruct.addr , addressradix) + " ... okay" ); + } + if ( doStdoutLog ) + { + System.out.println( "WRITE " + Long.toString(instruct.addr , addressradix) + " ... okay" ); + } + } + } + for ( i = 0; i < virtPageNum; i++ ) + { + Page page = ( Page ) memVector.elementAt( i ); + if ( page.R == 1 && page.lastTouchTime == 10 ) + { + page.R = 0; + } + if ( page.physical != -1 ) + { + page.inMemTime = page.inMemTime + 10; + page.lastTouchTime = page.lastTouchTime + 10; + } + } + runs++; + controlPanel.timeValueLabel.setText( Integer.toString( runs*10 ) + " (ns)" ); + } + + public void reset() { + memVector.removeAllElements(); + instructVector.removeAllElements(); + controlPanel.statusValueLabel.setText( "STOP" ) ; + controlPanel.timeValueLabel.setText( "0" ) ; + controlPanel.instructionValueLabel.setText( "NONE" ) ; + controlPanel.addressValueLabel.setText( "NULL" ) ; + controlPanel.pageFaultValueLabel.setText( "NO" ) ; + controlPanel.virtualPageValueLabel.setText( "x" ) ; + controlPanel.physicalPageValueLabel.setText( "0" ) ; + controlPanel.RValueLabel.setText( "0" ) ; + controlPanel.MValueLabel.setText( "0" ) ; + controlPanel.inMemTimeValueLabel.setText( "0" ) ; + controlPanel.lastTouchTimeValueLabel.setText( "0" ) ; + controlPanel.lowValueLabel.setText( "0" ) ; + controlPanel.highValueLabel.setText( "0" ) ; + init( command_file , config_file ); + } +} diff --git a/EOPSY/lab4/task4/work/Makefile b/EOPSY/lab4/task4/work/Makefile new file mode 100644 index 00000000..59bad64c --- /dev/null +++ b/EOPSY/lab4/task4/work/Makefile @@ -0,0 +1,24 @@ + +default: info + + +help: + less README.tjk + +compile: + javac -nowarn *.java + +run: + java MemoryManagement commands memory.conf + +setup: + ./setUp + +info: + @echo "" + @echo "Use 'make' with one argument:" + @echo "" + @echo " make help" + @echo " make compile" + @echo " make run" + @echo "" diff --git a/EOPSY/lab4/task4/work/MemoryManagement.class b/EOPSY/lab4/task4/work/MemoryManagement.class new file mode 100644 index 00000000..485d9585 Binary files /dev/null and b/EOPSY/lab4/task4/work/MemoryManagement.class differ diff --git a/EOPSY/lab4/task4/work/MemoryManagement.java b/EOPSY/lab4/task4/work/MemoryManagement.java new file mode 100644 index 00000000..7e3e6387 --- /dev/null +++ b/EOPSY/lab4/task4/work/MemoryManagement.java @@ -0,0 +1,61 @@ +// The main MemoryManagement program, created by Alexander Reeder, 2000 Nov 19 + +import java.applet.*; +import java.awt.*; +import java.io.*; +import java.util.*; + +public class MemoryManagement +{ + public static void main(String[] args) + { + ControlPanel controlPanel; + Kernel kernel; + + if ( args.length < 1 || args.length > 2 ) + { + System.out.println( "Usage: 'java MemoryManagement '" ); + System.exit( -1 ); + } + + File f = new File( args[0] ); + + if ( ! ( f.exists() ) ) + { + System.out.println( "MemoryM: error, file '" + f.getName() + "' does not exist." ); + System.exit( -1 ); + } + if ( ! ( f.canRead() ) ) + { + System.out.println( "MemoryM: error, read of " + f.getName() + " failed." ); + System.exit( -1 ); + } + + if ( args.length == 2 ) + { + f = new File( args[1] ); + + if ( ! ( f.exists() ) ) + { + System.out.println( "MemoryM: error, file '" + f.getName() + "' does not exist." ); + System.exit( -1 ); + } + if ( ! ( f.canRead() ) ) + { + System.out.println( "MemoryM: error, read of " + f.getName() + " failed." ); + System.exit( -1 ); + } + } + + kernel = new Kernel(); + controlPanel = new ControlPanel( "Memory Management" ); + if ( args.length == 1 ) + { + controlPanel.init( kernel , args[0] , null ); + } + else + { + controlPanel.init( kernel , args[0] , args[1] ); + } + } +} diff --git a/EOPSY/lab4/task4/work/Page.class b/EOPSY/lab4/task4/work/Page.class new file mode 100644 index 00000000..bb3b1cab Binary files /dev/null and b/EOPSY/lab4/task4/work/Page.class differ diff --git a/EOPSY/lab4/task4/work/Page.java b/EOPSY/lab4/task4/work/Page.java new file mode 100644 index 00000000..2e9ec1ff --- /dev/null +++ b/EOPSY/lab4/task4/work/Page.java @@ -0,0 +1,24 @@ +public class Page +{ + public int id; + public int physical; + public byte R; + public byte M; + public int inMemTime; + public int lastTouchTime; + public long high; + public long low; + + public Page( int id, int physical, byte R, byte M, int inMemTime, int lastTouchTime, long high, long low ) + { + this.id = id; + this.physical = physical; + this.R = R; + this.M = M; + this.inMemTime = inMemTime; + this.lastTouchTime = lastTouchTime; + this.high = high; + this.low = low; + } + +} diff --git a/EOPSY/lab4/task4/work/PageFault.class b/EOPSY/lab4/task4/work/PageFault.class new file mode 100644 index 00000000..d212c127 Binary files /dev/null and b/EOPSY/lab4/task4/work/PageFault.class differ diff --git a/EOPSY/lab4/task4/work/PageFault.java b/EOPSY/lab4/task4/work/PageFault.java new file mode 100644 index 00000000..546ef4f9 --- /dev/null +++ b/EOPSY/lab4/task4/work/PageFault.java @@ -0,0 +1,92 @@ +/* It is in this file, specifically the replacePage function that will + be called by MemoryManagement when there is a page fault. The + users of this program should rewrite PageFault to implement the + page replacement algorithm. +*/ + + // This PageFault file is an example of the FIFO Page Replacement + // Algorithm as described in the Memory Management section. + +import java.util.*; + +public class PageFault { + + /** + * The page replacement algorithm for the memory management sumulator. + * This method gets called whenever a page needs to be replaced. + *

+ * The page replacement algorithm included with the simulator is + * FIFO (first-in first-out). A while or for loop should be used + * to search through the current memory contents for a canidate + * replacement page. In the case of FIFO the while loop is used + * to find the proper page while making sure that virtPageNum is + * not exceeded. + *

+   *   Page page = ( Page ) mem.elementAt( oldestPage )
+   * 
+ * This line brings the contents of the Page at oldestPage (a + * specified integer) from the mem vector into the page object. + * Next recall the contents of the target page, replacePageNum. + * Set the physical memory address of the page to be added equal + * to the page to be removed. + *
+   *   controlPanel.removePhysicalPage( oldestPage )
+   * 
+ * Once a page is removed from memory it must also be reflected + * graphically. This line does so by removing the physical page + * at the oldestPage value. The page which will be added into + * memory must also be displayed through the addPhysicalPage + * function call. One must also remember to reset the values of + * the page which has just been removed from memory. + * + * @param mem is the vector which contains the contents of the pages + * in memory being simulated. mem should be searched to find the + * proper page to remove, and modified to reflect any changes. + * @param virtPageNum is the number of virtual pages in the + * simulator (set in Kernel.java). + * @param replacePageNum is the requested page which caused the + * page fault. + * @param controlPanel represents the graphical element of the + * simulator, and allows one to modify the current display. + */ + public static void replacePage ( Vector mem , int virtPageNum , int replacePageNum , ControlPanel controlPanel ) + { + int count = 0; + int oldestPage = -1; + int oldestTime = 0; + int firstPage = -1; + int map_count = 0; + boolean mapped = false; + + while ( ! (mapped) || count != virtPageNum ) { + Page page = ( Page ) mem.elementAt( count ); + if ( page.physical != -1 ) { + if (firstPage == -1) { + firstPage = count; + } + if (page.inMemTime > oldestTime) { + oldestTime = page.inMemTime; + oldestPage = count; + mapped = true; + } + } + count++; + if ( count == virtPageNum ) { + mapped = true; + } + } + if (oldestPage == -1) { + oldestPage = firstPage; + } + Page page = ( Page ) mem.elementAt( oldestPage ); + Page nextpage = ( Page ) mem.elementAt( replacePageNum ); + controlPanel.removePhysicalPage( oldestPage ); + nextpage.physical = page.physical; + controlPanel.addPhysicalPage( nextpage.physical , replacePageNum ); + page.inMemTime = 0; + page.lastTouchTime = 0; + page.R = 0; + page.M = 0; + page.physical = -1; + } +} diff --git a/EOPSY/lab4/task4/work/README.tjk b/EOPSY/lab4/task4/work/README.tjk new file mode 100644 index 00000000..e77b9a16 --- /dev/null +++ b/EOPSY/lab4/task4/work/README.tjk @@ -0,0 +1,45 @@ + + + WORKPLACE ORGANIZATION: +mkdir ../work +cd ../work +cp ../ftp/* . +gzip -d memory.tgz +tar -xvf memory.tar +rm memory.tar + + + READING: +more/less/vi/vim README.tjk +netscape/lynx/links install_unix.html +netscape/lynx/links user_guide.html + + + COMPILE: +javac -nowarn *.java + + + RUN: +java MemoryManagement commands memory.conf + + + FILES: +input file name: commands +initial content of the VM map: memory.conf +output file name: tracefile + + +--[ YOUR TASK ]------------------------------------------------------- + +Create a command file that maps any 8 pages of physical memory to the +first 8 pages of virtual memory, and then reads from one virtual memory +address on each of the 64 virtual pages. Step through the simulator one +operation at a time and see if you can predict which virtual memory +addresses cause page faults. What page replacement algorithm is being +used? + +Locate in the sources and describe to the instructor the page +replacement algorithm. + +---------------------------------------------------------------------- + diff --git a/EOPSY/lab4/task4/work/Virtual2Physical.class b/EOPSY/lab4/task4/work/Virtual2Physical.class new file mode 100644 index 00000000..c6d4da99 Binary files /dev/null and b/EOPSY/lab4/task4/work/Virtual2Physical.class differ diff --git a/EOPSY/lab4/task4/work/Virtual2Physical.java b/EOPSY/lab4/task4/work/Virtual2Physical.java new file mode 100644 index 00000000..8affc2e3 --- /dev/null +++ b/EOPSY/lab4/task4/work/Virtual2Physical.java @@ -0,0 +1,22 @@ +import java.util.Vector; + +public class Virtual2Physical +{ + public static int pageNum ( long memaddr , int numpages , long block ) + { + int i = 0; + long high = 0; + long low = 0; + + for (i = 0; i <= numpages; i++) + { + low = block * i; + high = block * ( i + 1 ); + if ( low <= memaddr && memaddr < high ) + { + return i; + } + } + return -1; + } +} diff --git a/EOPSY/lab4/task4/work/commands b/EOPSY/lab4/task4/work/commands new file mode 100644 index 00000000..f80c6f81 --- /dev/null +++ b/EOPSY/lab4/task4/work/commands @@ -0,0 +1,11 @@ +// Enter READ/WRITE commands into this file +// READ +// WRITE +READ bin 100 +READ 19 +WRITE hex CC32 +READ bin 100000000000000 +READ bin 100000000000000 +WRITE bin 110000000000001 +WRITE random + diff --git a/EOPSY/lab4/task4/work/copying.txt b/EOPSY/lab4/task4/work/copying.txt new file mode 100644 index 00000000..60549be5 --- /dev/null +++ b/EOPSY/lab4/task4/work/copying.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/EOPSY/lab4/task4/work/install_unix.html b/EOPSY/lab4/task4/work/install_unix.html new file mode 100644 index 00000000..926e240a --- /dev/null +++ b/EOPSY/lab4/task4/work/install_unix.html @@ -0,0 +1,410 @@ + + +MOSS | Memory Management Simlulator | Installation | + + +Unix + + + + + +

MOSS Memory Management Simulator + + +
Installation on Unix/Linux/Solaris/HP-UX Systems

+ + +

Purpose

+ +

+This document provides instructions for the installation +of the MOSS Memory Management Simulator on + + +Unix + +operating systems. This procedure should be the same or similar on + + +Unix, Linux, Solaris, HP-UX and other Unix-compatible + +systems. +The MOSS software +is designed for use with +Andrew S. Tanenbaum, +Modern Operating Systems, 2nd Edition +(Prentice Hall, 2001). +The Memory Management Simulator was written by +Alex Reeder +(alexr@e-sa.org). +This installation guide was written by +Ray Ontko +(rayo@ontko.com). + +

+This installation guide only provides information about +installing the software and testing the configuration for + +Unix-like operating systems. To install on Windows +operating systems, please read the +Installation Guide for Win95/98/Me/NT/2000 Systems. + + +For more detailed information about the simulator, please +read the User Guide. +

+ +

Requirements

+ +The following software components are required +to install and use the MOSS Memory Management +Simulator. +
    + + +
  • X-windows environment for running Java Application Window Toolkit (AWT) programs + +
  • Java Development Kit (JDK) 1.0 or greater +
  • Text program editor (e.g., notepad) +
+ +

Pre-Installation

+

+Before installation, you should verify: +

+
    +
  • that you have a working java runtime environment, +
  • that you have a working java development environment, and +
  • that the working directory is in the classpath for the runtime environment. +
+

+If you're using a standard command-line java compiler, the following +instructions will help determine if your environment is configured +correctly. +

+
    +
  1. Verify that you have java installed and configured in your environment. + + +
    +$ java -version
    +
    + +You should see a message like this with possibly a different version number. +
    +java version "1.1.8"
    +
    +If you get a message like: + + +
    +java: Command not found.
    +
    + +Then java may not be installed on your system, or may not be configured +for your use. +

    +If you think that Java may already be installed on your system +but may not be in your "path", you can find it by + + +

    +$ find /usr -name java -print
    +
    +On my system, for example, the following is returned. +
    +/usr/lib/netscape/477/communicator/java
    +/usr/lib/netscape/477/netscape/java
    +/usr/lib/jdk1.1/bin/java
    +/usr/lib/jdk1.1/bin/ia32/green_threads/java
    +/usr/share/java
    +/usr/bin/java
    +/usr/src/kernel-source-2.2.17/include/config/binfmt/java
    +
    +On my system, I also searched for "javac" and found +that it exists in /usr/bin/java. I'll use this jdk for my +installation. + +

    +If Java isn't available on your system, you should check with +your instructor or system administrator. If you administer your +own system, then you should be able to find a copy of Java +for your operating system. +

    +If you find that java is installed but not configured for +your use, then perhaps you need to add it to your path. Consult +your instructor or system administrator if you need help adding this +to your path. +

    +

    + +
  2. Verify that the java compiler is installed and configured in +your environment. + + +
    +$ javac
    +
    + +If you're using a standard java command-line compiler, you should +see a message similar to this. +
    +use: javac [-g][-O][-debug][-depend][-nowarn][-verbose][-classpath path][-nowrite][-deprecation][-d dir][-J] file.java...
    +
    +If you get a message like: + + +
    +javac: Command not found.
    +
    + +then the java compiler may not be installed on your system, or +may not be configured for your use. Consult your instructor +or system administrator. +

    + +
  3. Verify that that the current directory is in your classpath. + + +
    +$ echo $CLASSPATH
    +
    +You should see a list of directories separated by colons (":") +or possibly just a blank line. If you don't see the directory +"." (a single period, which stands for the current directory), then +you should add it to the claspath. +

    +Determine which shell you're using: +

    +
    +$ echo $SHELL
    +
    + +

    +If you're using sh, ksh, or bash: +

    +
    +$ CLASSPATH=.:$CLASSPATH
    +$ export CLASSPATH
    +
    + +

    +If you're using csh, or tcsh: +

    +
    +% set CLASSPATH=.:$CLASSPATH
    +
    + +

    + +
+

+If you have a working java runtime environment, a working java +compiler, and the current directory is in your path, then you're +ready to proceed with the installation. +

+ + +

Installation

+ +Installation of the software can be accomplished with +these simple steps: +
    +
  1. + + +Create a directory in which you wish to install the +simulator (e.g., "moss/memory"). +
    +$ cd
    +$ mkdir moss
    +$ cd moss
    +$ mkdir memory
    +$ cd memory
    +
    + +

    + +
  2. + + +Download the compressed tar archive (memory.tgz) into +the directory. +The latest release for this file can always be found at +http://www.ontko.com/moss/memory/memory.tgz. + +

    + +
  3. + + +Expand the compressed tar archive. +
    +$ tar -xzf memory.tgz
    +
    +or +
    +$ gunzip memory.tgz
    +$ tar xf memory.tar
    +
    + +

    + +
+ +

Files

+

+The directory should now contain the following files: +

+ + + + + + + + + + +
Files +Description +
+ + +memory.tgz +Compressed tar + +archive which contains all the other files. +
Common.java +
ControlPanel.java +
Instruction.java +
Kernel.java +
MemoryManagement.java +
PageFault.java +
Page.java +
Virtual2Physical.java +
+Java source files (*.java) +
Common.class +
ControlPanel.class +
Instruction.class +
Kernel.class +
MemoryManagement.class +
PageFault.class +
Page.class +
Virtual2Physical.class +
+Compiled Java class files (*.class) +
commands +Sample input command file +
memory.conf +Sample configuration file +
install_unix.html +
install_windows.html +
user_guide.html +
user_guide_1.gif +
+Documentation and associated images +
copying.txtGnu General Public License: Terms and Conditions +for Copying, Distribution, and Modification +
+ +

Compilation

+ +

+The distribution includes compiled class files as +well as the source java files. You should not need +to recompile unless you decide to change the code. +If you wish to compile the code, +the following commands should work if you're using +a Java compiler that accepts the normal "javac" command +line. + + +

+$ javac -nowarn *.java
+
+ + +The -nowarn flag supresses warning messges, of which +there may be several. For backward compatability we use only +those features of Java which have been present from the beginning, +some of which are deprecated and are usually reported by the +compiler with warning messages. + +

Test

+ +

+To test the program, enter the following command line. + + + +

+$ java MemoryManagement commands memory.conf
+
+ + +

+The program will display a window allowing you to run the +simulator. +When the window presents itself, click on the Run +button. +You should see the +program "execute" 7 memory operations, about one per second. +When the simulation completes, click the +Exit button. +

+The memory operation commands are read from a file called +"commands", +and the initial configuration and various options are +specified in the file "memory.conf". +The program also produces a log file called "tracefile" +in the working directory. + +

+The "commands" file looks something like this: +

+// Enter READ/WRITE commands into this file
+// READ <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
+// WRITE <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
+READ bin 100
+READ 19
+WRITE hex CC32
+READ bin 10000000000000000
+READ bin 10000000000000000
+WRITE bin 11000000000000001
+WRITE random
+
+ +

+If things are working correctly, the "tracefile" should look +something like this: + +

+READ 4 ... okay
+READ 13 ... okay
+WRITE 3acc32 ... okay
+READ 10000000 ... okay
+READ 10000000 ... okay
+WRITE c0001000 ... page fault
+WRITE 1ff82cdc ... okay
+
+ +

+The program and its input and output files are described +more fully in the MOSS Memory Management Simulator +User Guide. +

+© Copyright 2001, Prentice-Hall, Inc. +This program is free software; it is distributed under the +terms of the Gnu General Public License. +See copying.txt, +included with this distribution. +

+Please send suggestions, corrections, and comments to +Ray Ontko (rayo@ontko.com). +

+Last updated: July 28, 2001 + + diff --git a/EOPSY/lab4/task4/work/install_windows.html b/EOPSY/lab4/task4/work/install_windows.html new file mode 100644 index 00000000..d3c3ffd0 --- /dev/null +++ b/EOPSY/lab4/task4/work/install_windows.html @@ -0,0 +1,385 @@ + + +MOSS | Memory Management Simlulator | Installation | + +Windows + + + + + + +

MOSS Memory Management Simulator + +
Installation on Windows 95/98/Me/NT/2000 Systems

+ + + +

Purpose

+ +

+This document provides instructions for the installation +of the MOSS Memory Management Simulator on + +Microsoft Windows + + +operating systems. This procedure should be the same or similar on + +Windows 95, 98, Me, NT, and 2000 + + +systems. +The MOSS software +is designed for use with +Andrew S. Tanenbaum, +Modern Operating Systems, 2nd Edition +(Prentice Hall, 2001). +The Memory Management Simulator was written by +Alex Reeder +(alexr@e-sa.org). +This installation guide was written by +Ray Ontko +(rayo@ontko.com). + +

+This installation guide only provides information about +installing the software and testing the configuration for + + +Windows operating systems. To install on Unix-like +operating systems, please read the +Installation Guide for Unix/Linux/Solaris/HP-UX Systems. + +For more detailed information about the simulator, please +read the User Guide. +

+ +

Requirements

+ +The following software components are required +to install and use the MOSS Memory Management +Simulator. +
    + +
  • Microsoft Windows 95, 98, Me, NT, or 2000 + + +
  • Java Development Kit (JDK) 1.0 or greater +
  • Text program editor (e.g., notepad) +
+ +

Pre-Installation

+

+Before installation, you should verify: +

+
    +
  • that you have a working java runtime environment, +
  • that you have a working java development environment, and +
  • that the working directory is in the classpath for the runtime environment. +
+

+If you're using a standard command-line java compiler, the following +instructions will help determine if your environment is configured +correctly. +

+
    +
  1. Verify that you have java installed and configured in your environment. + +
    +C:\WINDOWS> java -version
    +
    + + +You should see a message like this with possibly a different version number. +
    +java version "1.1.8"
    +
    +If you get a message like: + +
    +Bad command or file name
    +
    + + +Then java may not be installed on your system, or may not be configured +for your use. +

    +If you think that Java may already be installed on your system +but may not be in your "path", you can find it by + +choosing Start -> Find -> Files or Folders +and enter "java.exe" in the "Named:" field and click the Find Now button. +If found, make note of the directory folder in which it resides (e.g., +"C:\jdk1.1.8\bin"). +

    +While you're at it, also seach for javac.exe to see if the Java +compiler is installed and whether it's in the same directory as +the java.exe file. + + +

    +If Java isn't available on your system, you should check with +your instructor or system administrator. If you administer your +own system, then you should be able to find a copy of Java +for your operating system. +

    +If you find that java is installed but not configured for +your use, then perhaps you need to add it to your path. Consult +your instructor or system administrator if you need help adding this +to your path. +

    +

    + +
  2. Verify that the java compiler is installed and configured in +your environment. + +
    +C:\WINDOWS> javac
    +
    + + +If you're using a standard java command-line compiler, you should +see a message similar to this. +
    +use: javac [-g][-O][-debug][-depend][-nowarn][-verbose][-classpath path][-nowrite][-deprecation][-d dir][-J] file.java...
    +
    +If you get a message like: + +
    +Bad command or file name
    +
    + + +then the java compiler may not be installed on your system, or +may not be configured for your use. Consult your instructor +or system administrator. +

    + +
  3. Verify that that the current directory is in your classpath. + +
    +C:\WINDOWS> echo "%CLASSPATH%"
    +
    +You should see a list of directories separated by semi-colons (";") +or possibly just "". If you don't see the directory "." (a single +period, which stands for the current directory), then you should +add it to the classpath. +
    +C:\WINDOWS> set CLASSPATH=.;%CLASSPATH%
    +
    + + +

    + +
+

+If you have a working java runtime environment, a working java +compiler, and the current directory is in your path, then you're +ready to proceed with the installation. +

+ + +

Installation

+ +Installation of the software can be accomplished with +these simple steps: +
    +
  1. + +Create a directory folder in which you wish to install +the simulator (e.g., "C:\moss\memory"). You can do +this using the Windows explorer, or from the MS-DOS +prompt. To create the directory from the MS-DOS +prompt: +
    +C:\WINDOWS> cd \ 
    +C:\> mkdir moss
    +C:\> cd moss
    +C:\moss> mkdir memory
    +C:\moss> cd memory
    +C:\moss\memory>
    +
    + + +

    + +
  2. + +Download the self-extracting ZIP archive (memory.exe) into +the directory folder. +The latest release for this file can always be found at +http://www.ontko.com/moss/memory/memory.exe. + + +

    + +
  3. + +Double-click on the file you downloaded (memory.exe), +or invoke it using Start -> Run..., or invoke it +from an MS-DOS command prompt: +
    +C:\moss\memory> memory.exe
    +
    + + +

    + +
+ +

Files

+

+The directory should now contain the following files: +

+ + + + + + + + + + +
Files +Description +
+ +memory.exe +Self-extracting ZIP + + +archive which contains all the other files. +
Common.java +
ControlPanel.java +
Instruction.java +
Kernel.java +
MemoryManagement.java +
PageFault.java +
Page.java +
Virtual2Physical.java +
+Java source files (*.java) +
Common.class +
ControlPanel.class +
Instruction.class +
Kernel.class +
MemoryManagement.class +
PageFault.class +
Page.class +
Virtual2Physical.class +
+Compiled Java class files (*.class) +
commands +Sample input command file +
memory.conf +Sample configuration file +
install_unix.html +
install_windows.html +
user_guide.html +
user_guide_1.gif +
+Documentation and associated images +
copying.txtGnu General Public License: Terms and Conditions +for Copying, Distribution, and Modification +
+ +

Compilation

+ +

+The distribution includes compiled class files as +well as the source java files. You should not need +to recompile unless you decide to change the code. +If you wish to compile the code, +the following commands should work if you're using +a Java compiler that accepts the normal "javac" command +line. + +

+C:\moss\memory> javac -nowarn *.java
+
+ + + +The -nowarn flag supresses warning messges, of which +there may be several. For backward compatability we use only +those features of Java which have been present from the beginning, +some of which are deprecated and are usually reported by the +compiler with warning messages. + +

Test

+ +

+To test the program, enter the following command line. + + +

+C:\moss\memory> java MemoryManagement commands memory.conf
+
+ + + +

+The program will display a window allowing you to run the +simulator. +When the window presents itself, click on the Run +button. +You should see the +program "execute" 7 memory operations, about one per second. +When the simulation completes, click the +Exit button. +

+The memory operation commands are read from a file called +"commands", +and the initial configuration and various options are +specified in the file "memory.conf". +The program also produces a log file called "tracefile" +in the working directory. + +

+The "commands" file looks something like this: +

+// Enter READ/WRITE commands into this file
+// READ <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
+// WRITE <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
+READ bin 100
+READ 19
+WRITE hex CC32
+READ bin 10000000000000000
+READ bin 10000000000000000
+WRITE bin 11000000000000001
+WRITE random
+
+ +

+If things are working correctly, the "tracefile" should look +something like this: + +

+READ 4 ... okay
+READ 13 ... okay
+WRITE 3acc32 ... okay
+READ 10000000 ... okay
+READ 10000000 ... okay
+WRITE c0001000 ... page fault
+WRITE 1ff82cdc ... okay
+
+ +

+The program and its input and output files are described +more fully in the MOSS Memory Management Simulator +User Guide. +

+© Copyright 2001, Prentice-Hall, Inc. +This program is free software; it is distributed under the +terms of the Gnu General Public License. +See copying.txt, +included with this distribution. +

+Please send suggestions, corrections, and comments to +Ray Ontko (rayo@ontko.com). +

+Last updated: July 28, 2001 + + diff --git a/EOPSY/lab4/task4/work/javadoc/AllNames.html b/EOPSY/lab4/task4/work/javadoc/AllNames.html new file mode 100644 index 00000000..a7dce024 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/AllNames.html @@ -0,0 +1,274 @@ + + + + + + + Index of all Fields and Methods + + + + +

All Packages  Class Hierarchy

+A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z + +
+

+ Index of all Fields and Methods +

+ +

+ A +

+
+
action(Event, Object). +Method in class ControlPanel +
+
addPhysicalPage(int, int). +Method in class ControlPanel +
+
addr. +Variable in class Instruction +
+
addressradix. +Static variable in class Kernel +
+
+ +
+

+ B +

+
+
block. +Variable in class Kernel +
+
+ +
+

+ C +

+
+
Common(). +Constructor for class Common +
+
ControlPanel(). +Constructor for class ControlPanel +
+
ControlPanel(String). +Constructor for class ControlPanel +
+
+ + + + +
+

+ G +

+
+
getPage(int). +Method in class Kernel +
+
+ +
+

+ H +

+
+
high. +Variable in class Page +
+
+ +
+

+ I +

+
+
id. +Variable in class Page +
+
init(Kernel, String, String). +Method in class ControlPanel +
+
init(String, String). +Method in class Kernel +
+
inMemTime. +Variable in class Page +
+
inst. +Variable in class Instruction +
+
Instruction(String, long). +Constructor for class Instruction +
+
+ + +
+

+ K +

+
+
Kernel(). +Constructor for class Kernel +
+
+ +
+

+ L +

+
+
lastTouchTime. +Variable in class Page +
+
low. +Variable in class Page +
+
+ +
+

+ M +

+
+
M. +Variable in class Page +
+
main(String[]). +Static method in class MemoryManagement +
+
MemoryManagement(). +Constructor for class MemoryManagement +
+
+ + + +
+

+ P +

+
+
Page(int, int, byte, byte, int, int, long, long). +Constructor for class Page +
+
PageFault(). +Constructor for class PageFault +
+
pageNum(long, int, long). +Static method in class Virtual2Physical +
+
paintPage(Page). +Method in class ControlPanel +
+
physical. +Variable in class Page +
+
+ + +
+

+ R +

+
+
R. +Variable in class Page +
+
randomLong(long). +Static method in class Common +
+
removePhysicalPage(int). +Method in class ControlPanel +
+
replacePage(Vector, int, int, ControlPanel). +Static method in class PageFault +
The page replacement algorithm for the memory management sumulator. +
reset(). +Method in class Kernel +
+
run(). +Method in class Kernel +
+
runcycles. +Variable in class Kernel +
+
runs. +Variable in class Kernel +
+
+ +
+

+ S +

+
+
s2b(String). +Static method in class Common +
+
s2i(String). +Static method in class Common +
+
s2l(String). +Static method in class Common +
+
setControlPanel(ControlPanel). +Method in class Kernel +
+
setStatus(String). +Method in class ControlPanel +
+
step(). +Method in class Kernel +
+
+ + + +
+

+ V +

+
+
Virtual2Physical(). +Constructor for class Virtual2Physical +
+
+ + + + + + diff --git a/EOPSY/lab4/task4/work/javadoc/Common.html b/EOPSY/lab4/task4/work/javadoc/Common.html new file mode 100644 index 00000000..5eb90559 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/Common.html @@ -0,0 +1,87 @@ + + + + + + + Class Common + + + + +

+ Class Common +

+
+java.lang.Object
+   |
+   +----Common
+
+
+
+
public class Common +
extends Object +
+
+ +

+ Constructor Index +

+
+
 o + Common() +
+
+

+ Method Index +

+
+
 o + randomLong(long) +
+
 o + s2b(String) +
+
 o + s2i(String) +
+
 o + s2l(String) +
+
+ +

+ Constructors +

+ + o +Common +
+ public Common()
+
+ +

+ Methods +

+ o +s2l +
+ public static long s2l(String s)
+
+ o +s2i +
+ public static int s2i(String s)
+
+ o +s2b +
+ public static byte s2b(String s)
+
+ o +randomLong +
+ public static long randomLong(long MAX)
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/ControlPanel.html b/EOPSY/lab4/task4/work/javadoc/ControlPanel.html new file mode 100644 index 00000000..9a26c9b6 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/ControlPanel.html @@ -0,0 +1,129 @@ + + + + + + + Class ControlPanel + + + + +

+ Class ControlPanel +

+
+java.lang.Object
+   |
+   +----java.awt.Component
+           |
+           +----java.awt.Container
+                   |
+                   +----java.awt.Window
+                           |
+                           +----java.awt.Frame
+                                   |
+                                   +----ControlPanel
+
+
+
+
public class ControlPanel +
extends Frame +
+
+ +

+ Constructor Index +

+
+
 o + ControlPanel() +
+
 o + ControlPanel(String) +
+
+

+ Method Index +

+
+
 o + action(Event, Object) +
+
 o + addPhysicalPage(int, int) +
+
 o + init(Kernel, String, String) +
+
 o + paintPage(Page) +
+
 o + removePhysicalPage(int) +
+
 o + setStatus(String) +
+
+ +

+ Constructors +

+ + o +ControlPanel +
+ public ControlPanel()
+
+ o +ControlPanel +
+ public ControlPanel(String title)
+
+ +

+ Methods +

+ o +init +
+ public void init(Kernel useKernel,
+                  String commands,
+                  String config)
+
+ o +paintPage +
+ public void paintPage(Page page)
+
+ o +setStatus +
+ public void setStatus(String status)
+
+ o +addPhysicalPage +
+ public void addPhysicalPage(int pageNum,
+                             int physicalPage)
+
+ o +removePhysicalPage +
+ public void removePhysicalPage(int physicalPage)
+
+ o +action +
+ public boolean action(Event e,
+                       Object arg)
+
+
+
+
Overrides: +
action in class Component +
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/Instruction.html b/EOPSY/lab4/task4/work/javadoc/Instruction.html new file mode 100644 index 00000000..ecfaea39 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/Instruction.html @@ -0,0 +1,72 @@ + + + + + + + Class Instruction + + + + +

+ Class Instruction +

+
+java.lang.Object
+   |
+   +----Instruction
+
+
+
+
public class Instruction +
extends Object +
+
+ +

+ Variable Index +

+
+
 o + addr +
+
 o + inst +
+
+

+ Constructor Index +

+
+
 o + Instruction(String, long) +
+
+ +

+ Variables +

+ o +inst +
+ public String inst
+
+ o +addr +
+ public long addr
+
+ +

+ Constructors +

+ + o +Instruction +
+ public Instruction(String inst,
+                    long addr)
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/Kernel.html b/EOPSY/lab4/task4/work/javadoc/Kernel.html new file mode 100644 index 00000000..4c1aee21 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/Kernel.html @@ -0,0 +1,153 @@ + + + + + + + Class Kernel + + + + +

+ Class Kernel +

+
+java.lang.Object
+   |
+   +----java.lang.Thread
+           |
+           +----Kernel
+
+
+
+
public class Kernel +
extends Thread +
+
+ +

+ Variable Index +

+
+
 o + addressradix +
+
 o + block +
+
 o + runcycles +
+
 o + runs +
+
+

+ Constructor Index +

+
+
 o + Kernel() +
+
+

+ Method Index +

+
+
 o + getPage(int) +
+
 o + init(String, String) +
+
 o + reset() +
+
 o + run() +
+
 o + setControlPanel(ControlPanel) +
+
 o + step() +
+
+ +

+ Variables +

+ o +runs +
+ public int runs
+
+ o +runcycles +
+ public int runcycles
+
+ o +block +
+ public long block
+
+ o +addressradix +
+ public static byte addressradix
+
+ +

+ Constructors +

+ + o +Kernel +
+ public Kernel()
+
+ +

+ Methods +

+ o +init +
+ public void init(String commands,
+                  String config)
+
+ o +setControlPanel +
+ public void setControlPanel(ControlPanel newControlPanel)
+
+ o +getPage +
+ public void getPage(int pageNum)
+
+ o +run +
+ public void run()
+
+
+
+
Overrides: +
run in class Thread +
+
+ o +step +
+ public void step()
+
+ o +reset +
+ public void reset()
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/MemoryManagement.html b/EOPSY/lab4/task4/work/javadoc/MemoryManagement.html new file mode 100644 index 00000000..5fc5f815 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/MemoryManagement.html @@ -0,0 +1,63 @@ + + + + + + + Class MemoryManagement + + + + +

+ Class MemoryManagement +

+
+java.lang.Object
+   |
+   +----MemoryManagement
+
+
+
+
public class MemoryManagement +
extends Object +
+
+ +

+ Constructor Index +

+
+
 o + MemoryManagement() +
+
+

+ Method Index +

+
+
 o + main(String[]) +
+
+ +

+ Constructors +

+ + o +MemoryManagement +
+ public MemoryManagement()
+
+ +

+ Methods +

+ o +main +
+ public static void main(String args[])
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/Page.html b/EOPSY/lab4/task4/work/javadoc/Page.html new file mode 100644 index 00000000..2862fe45 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/Page.html @@ -0,0 +1,126 @@ + + + + + + + Class Page + + + + +

+ Class Page +

+
+java.lang.Object
+   |
+   +----Page
+
+
+
+
public class Page +
extends Object +
+
+ +

+ Variable Index +

+
+
 o + high +
+
 o + id +
+
 o + inMemTime +
+
 o + lastTouchTime +
+
 o + low +
+
 o + M +
+
 o + physical +
+
 o + R +
+
+

+ Constructor Index +

+
+
 o + Page(int, int, byte, byte, int, int, long, long) +
+
+ +

+ Variables +

+ o +id +
+ public int id
+
+ o +physical +
+ public int physical
+
+ o +R +
+ public byte R
+
+ o +M +
+ public byte M
+
+ o +inMemTime +
+ public int inMemTime
+
+ o +lastTouchTime +
+ public int lastTouchTime
+
+ o +high +
+ public long high
+
+ o +low +
+ public long low
+
+ +

+ Constructors +

+ + o +Page +
+ public Page(int id,
+             int physical,
+             byte R,
+             byte M,
+             int inMemTime,
+             int lastTouchTime,
+             long high,
+             long low)
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/PageFault.html b/EOPSY/lab4/task4/work/javadoc/PageFault.html new file mode 100644 index 00000000..091f5c60 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/PageFault.html @@ -0,0 +1,107 @@ + + + + + + + Class PageFault + + + + +

+ Class PageFault +

+
+java.lang.Object
+   |
+   +----PageFault
+
+
+
+
public class PageFault +
extends Object +
+
+ +

+ Constructor Index +

+
+
 o + PageFault() +
+
+

+ Method Index +

+
+
 o + replacePage(Vector, int, int, ControlPanel) +
The page replacement algorithm for the memory management sumulator. +
+ +

+ Constructors +

+ + o +PageFault +
+ public PageFault()
+
+ +

+ Methods +

+ o +replacePage +
+ public static void replacePage(Vector mem,
+                                int virtPageNum,
+                                int replacePageNum,
+                                ControlPanel controlPanel)
+
+
+
The page replacement algorithm for the memory management sumulator. + This method gets called whenever a page needs to be replaced. +

+ The page replacement algorithm included with the simulator is + FIFO (first-in first-out). A while or for loop should be used + to search through the current memory contents for a canidate + replacement page. In the case of FIFO the while loop is used + to find the proper page while making sure that virtPageNum is + not exceeded. +

+   Page page = ( Page ) mem.elementAt( oldestPage )
+ 
+ This line brings the contents of the Page at oldestPage (a + specified integer) from the mem vector into the page object. + Next recall the contents of the target page, replacePageNum. + Set the physical memory address of the page to be added equal + to the page to be removed. +
+   controlPanel.removePhysicalPage( oldestPage )
+ 
+ Once a page is removed from memory it must also be reflected + graphically. This line does so by removing the physical page + at the oldestPage value. The page which will be added into + memory must also be displayed through the addPhysicalPage + function call. One must also remember to reset the values of + the page which has just been removed from memory. +

+

+
Parameters: +
mem - is the vector which contains the contents of the pages + in memory being simulated. mem should be searched to find the + proper page to remove, and modified to reflect any changes. +
virtPageNum - is the number of virtual pages in the + simulator (set in Kernel.java). +
replacePageNum - is the requested page which caused the + page fault. +
controlPanel - represents the graphical element of the + simulator, and allows one to modify the current display. +
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/Virtual2Physical.html b/EOPSY/lab4/task4/work/javadoc/Virtual2Physical.html new file mode 100644 index 00000000..5b99bc98 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/Virtual2Physical.html @@ -0,0 +1,65 @@ + + + + + + + Class Virtual2Physical + + + + +

+ Class Virtual2Physical +

+
+java.lang.Object
+   |
+   +----Virtual2Physical
+
+
+
+
public class Virtual2Physical +
extends Object +
+
+ +

+ Constructor Index +

+
+
 o + Virtual2Physical() +
+
+

+ Method Index +

+
+
 o + pageNum(long, int, long) +
+
+ +

+ Constructors +

+ + o +Virtual2Physical +
+ public Virtual2Physical()
+
+ +

+ Methods +

+ o +pageNum +
+ public static int pageNum(long memaddr,
+                           int numpages,
+                           long block)
+
+ + diff --git a/EOPSY/lab4/task4/work/javadoc/images/BaseObject.gif b/EOPSY/lab4/task4/work/javadoc/images/BaseObject.gif new file mode 100644 index 00000000..66d51d5d Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/BaseObject.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Category.gif b/EOPSY/lab4/task4/work/javadoc/images/Category.gif new file mode 100644 index 00000000..3982845e Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Category.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Class.gif b/EOPSY/lab4/task4/work/javadoc/images/Class.gif new file mode 100644 index 00000000..a47963e8 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Class.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Collection.gif b/EOPSY/lab4/task4/work/javadoc/images/Collection.gif new file mode 100644 index 00000000..305420d4 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Collection.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/DataObject.gif b/EOPSY/lab4/task4/work/javadoc/images/DataObject.gif new file mode 100644 index 00000000..6a749587 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/DataObject.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Group.gif b/EOPSY/lab4/task4/work/javadoc/images/Group.gif new file mode 100644 index 00000000..d6911e76 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Group.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Interface.gif b/EOPSY/lab4/task4/work/javadoc/images/Interface.gif new file mode 100644 index 00000000..dbd7235e Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Interface.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Job.gif b/EOPSY/lab4/task4/work/javadoc/images/Job.gif new file mode 100644 index 00000000..6967a3dd Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Job.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/JobOutput.gif b/EOPSY/lab4/task4/work/javadoc/images/JobOutput.gif new file mode 100644 index 00000000..b2bae24e Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/JobOutput.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/JobParameter.gif b/EOPSY/lab4/task4/work/javadoc/images/JobParameter.gif new file mode 100644 index 00000000..0c6ee7b2 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/JobParameter.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/ObjectID.gif b/EOPSY/lab4/task4/work/javadoc/images/ObjectID.gif new file mode 100644 index 00000000..a79b42ea Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/ObjectID.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/ObjectType.gif b/EOPSY/lab4/task4/work/javadoc/images/ObjectType.gif new file mode 100644 index 00000000..00e40411 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/ObjectType.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/OpenBookIcon.gif b/EOPSY/lab4/task4/work/javadoc/images/OpenBookIcon.gif new file mode 100644 index 00000000..86384f77 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/OpenBookIcon.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Permissions.gif b/EOPSY/lab4/task4/work/javadoc/images/Permissions.gif new file mode 100644 index 00000000..5c44ad87 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Permissions.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Query.gif b/EOPSY/lab4/task4/work/javadoc/images/Query.gif new file mode 100644 index 00000000..e398de53 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Query.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/QueryVector.gif b/EOPSY/lab4/task4/work/javadoc/images/QueryVector.gif new file mode 100644 index 00000000..2d5511c7 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/QueryVector.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/ReportMartEntity.gif b/EOPSY/lab4/task4/work/javadoc/images/ReportMartEntity.gif new file mode 100644 index 00000000..42e45311 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/ReportMartEntity.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/ReportMartException.gif b/EOPSY/lab4/task4/work/javadoc/images/ReportMartException.gif new file mode 100644 index 00000000..bd0746be Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/ReportMartException.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Repository.gif b/EOPSY/lab4/task4/work/javadoc/images/Repository.gif new file mode 100644 index 00000000..274e6292 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Repository.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/SPFSet.gif b/EOPSY/lab4/task4/work/javadoc/images/SPFSet.gif new file mode 100644 index 00000000..22404774 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/SPFSet.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/SQRJob.gif b/EOPSY/lab4/task4/work/javadoc/images/SQRJob.gif new file mode 100644 index 00000000..08518736 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/SQRJob.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/SQRJobOutput.gif b/EOPSY/lab4/task4/work/javadoc/images/SQRJobOutput.gif new file mode 100644 index 00000000..873ecbc4 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/SQRJobOutput.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/Session.gif b/EOPSY/lab4/task4/work/javadoc/images/Session.gif new file mode 100644 index 00000000..afa3ce41 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/Session.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/SessionFactory.gif b/EOPSY/lab4/task4/work/javadoc/images/SessionFactory.gif new file mode 100644 index 00000000..e4376c1d Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/SessionFactory.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/UnimplementedMethodException.gif b/EOPSY/lab4/task4/work/javadoc/images/UnimplementedMethodException.gif new file mode 100644 index 00000000..efa20dd6 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/UnimplementedMethodException.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/UnknownReportMartException.gif b/EOPSY/lab4/task4/work/javadoc/images/UnknownReportMartException.gif new file mode 100644 index 00000000..5e60d9f1 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/UnknownReportMartException.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/User.gif b/EOPSY/lab4/task4/work/javadoc/images/User.gif new file mode 100644 index 00000000..6b0ac9ca Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/User.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/UserValidationException.gif b/EOPSY/lab4/task4/work/javadoc/images/UserValidationException.gif new file mode 100644 index 00000000..b77e2ab3 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/UserValidationException.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/blue-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/blue-ball-small.gif new file mode 100644 index 00000000..d4c5cde5 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/blue-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/blue-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/blue-ball.gif new file mode 100644 index 00000000..edc29b78 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/blue-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/class-index.gif b/EOPSY/lab4/task4/work/javadoc/images/class-index.gif new file mode 100644 index 00000000..7f276bcb Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/class-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/constructor-index.gif b/EOPSY/lab4/task4/work/javadoc/images/constructor-index.gif new file mode 100644 index 00000000..435cac42 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/constructor-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/constructors.gif b/EOPSY/lab4/task4/work/javadoc/images/constructors.gif new file mode 100644 index 00000000..d1a6ae50 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/constructors.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/cyan-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/cyan-ball-small.gif new file mode 100644 index 00000000..7f743574 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/cyan-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/cyan-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/cyan-ball.gif new file mode 100644 index 00000000..97ca1f2b Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/cyan-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/error-index.gif b/EOPSY/lab4/task4/work/javadoc/images/error-index.gif new file mode 100644 index 00000000..22835ff8 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/error-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/exception-index.gif b/EOPSY/lab4/task4/work/javadoc/images/exception-index.gif new file mode 100644 index 00000000..e3830d9c Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/exception-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/green-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/green-ball-small.gif new file mode 100644 index 00000000..17fea5b3 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/green-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/green-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/green-ball.gif new file mode 100644 index 00000000..71e1b2ec Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/green-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/interface-index.gif b/EOPSY/lab4/task4/work/javadoc/images/interface-index.gif new file mode 100644 index 00000000..bf93dda9 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/interface-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/magenta-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/magenta-ball-small.gif new file mode 100644 index 00000000..bd0584b3 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/magenta-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/magenta-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/magenta-ball.gif new file mode 100644 index 00000000..5da03b84 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/magenta-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/method-index.gif b/EOPSY/lab4/task4/work/javadoc/images/method-index.gif new file mode 100644 index 00000000..a05e7051 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/method-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/methods.gif b/EOPSY/lab4/task4/work/javadoc/images/methods.gif new file mode 100644 index 00000000..949e01b8 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/methods.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/package-index.gif b/EOPSY/lab4/task4/work/javadoc/images/package-index.gif new file mode 100644 index 00000000..f894d421 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/package-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/red-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/red-ball-small.gif new file mode 100644 index 00000000..f6b3c372 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/red-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/red-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/red-ball.gif new file mode 100644 index 00000000..dca92960 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/red-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/variable-index.gif b/EOPSY/lab4/task4/work/javadoc/images/variable-index.gif new file mode 100644 index 00000000..65cc029e Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/variable-index.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/variables.gif b/EOPSY/lab4/task4/work/javadoc/images/variables.gif new file mode 100644 index 00000000..e8a73539 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/variables.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/yellow-ball-small.gif b/EOPSY/lab4/task4/work/javadoc/images/yellow-ball-small.gif new file mode 100644 index 00000000..8e5f57cd Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/yellow-ball-small.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/images/yellow-ball.gif b/EOPSY/lab4/task4/work/javadoc/images/yellow-ball.gif new file mode 100644 index 00000000..2b8c0bb3 Binary files /dev/null and b/EOPSY/lab4/task4/work/javadoc/images/yellow-ball.gif differ diff --git a/EOPSY/lab4/task4/work/javadoc/packages.html b/EOPSY/lab4/task4/work/javadoc/packages.html new file mode 100644 index 00000000..2bfd63f8 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/packages.html @@ -0,0 +1,17 @@ + + + + + + + Package Index + + + + +
API User's Guide  Class Hierarchy  Index

+

+Package Index +

+ + diff --git a/EOPSY/lab4/task4/work/javadoc/tree.html b/EOPSY/lab4/task4/work/javadoc/tree.html new file mode 100644 index 00000000..a1975141 --- /dev/null +++ b/EOPSY/lab4/task4/work/javadoc/tree.html @@ -0,0 +1,45 @@ + + + + + + + Class Hierarchy + + + + +
All Packages  Index

+

+ Class Hierarchy +

+
    +
  • class java.lang.Object +
      +
    • class Common +
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • class java.awt.Container +
          +
        • class java.awt.Window +
            +
          • class java.awt.Frame (implements java.awt.MenuContainer) + +
          +
        +
      +
    • class Instruction +
    • class MemoryManagement +
    • class Page +
    • class PageFault +
    • class java.lang.Thread (implements java.lang.Runnable) + +
    • class Virtual2Physical +
    +
+ + diff --git a/EOPSY/lab4/task4/work/memory.conf b/EOPSY/lab4/task4/work/memory.conf new file mode 100644 index 00000000..b8e40ab2 --- /dev/null +++ b/EOPSY/lab4/task4/work/memory.conf @@ -0,0 +1,33 @@ +// memset virt page # physical page # R (read from) M (modified) inMemTime (ns) lastTouchTime (ns) +memset 0 0 0 0 0 0 +memset 1 1 0 0 0 0 +memset 2 2 0 0 0 0 +memset 3 3 0 0 0 0 +memset 4 4 0 0 0 0 +memset 5 5 0 0 0 0 +memset 6 6 0 0 0 0 +memset 7 7 0 0 0 0 + +// enable_logging 'true' or 'false' +// When true specify a log_file or leave blank for stdout +enable_logging true + +// log_file +// Where is the name of the file you want output +// to be print to. +log_file tracefile + +// page size, defaults to 2^14 and cannot be greater than 2^26 +// pagesize or <'power' num (base 2)> +pagesize 16384 + +// addressradix sets the radix in which numerical values are displayed +// 2 is the default value +// addressradix +addressradix 16 + +// numpages sets the number of pages (physical and virtual) +// 64 is the default value +// numpages must be at least 2 and no more than 64 +// numpages +numpages 64 diff --git a/EOPSY/lab4/task4/work/setUp b/EOPSY/lab4/task4/work/setUp new file mode 100755 index 00000000..8a9877bb --- /dev/null +++ b/EOPSY/lab4/task4/work/setUp @@ -0,0 +1,9 @@ +echo "Creating ../work subdirectory" +mkdir ../work 2>/dev/null +cd ../work +cp ../ftp/* . +gzip -d memory.tgz +tar -xvf memory.tar +rm memory.tar +echo "" +echo "Now, go to the directory ../work and submit 'make'" diff --git a/EOPSY/lab4/task4/work/user_guide.html b/EOPSY/lab4/task4/work/user_guide.html new file mode 100644 index 00000000..7dad10de --- /dev/null +++ b/EOPSY/lab4/task4/work/user_guide.html @@ -0,0 +1,460 @@ + + +Moss | Memory Management Simulator | User Guide + + +

+MOSS +Memory Management Simulator +
User Guide

+ +

Purpose

+ +

+This document is a user guide for the MOSS +Memory Management Simulator. It explains how to use the simulator and +describes the display and the various input files used by and output files +produced by the simulator. The MOSS software +is designed for use with +Andrew S. Tanenbaum, +Modern Operating Systems, 2nd Edition +(Prentice Hall, 2001). +The Memory Management Simulator was written by +Alex Reeder +(alexr@e-sa.org). +This user guide was written by +Ray Ontko +(rayo@ontko.com). +

+This user guide assumes that you have already installed and tested +the simulator. If you are looking for installation information, +please read the +Installation Guide for +Unix/Linux/Solaris/HP-UX Systems or the +Installation Guide for +Win95/98/Me/NT/2000 Systems. +

+ +

Introduction

+

+The memory management simulator illustrates page fault behavior +in a paged virtual memory system. The program reads the initial +state of the page table and a sequence of virtual memory +instructions and writes a trace log indicating the effect of each +instruction. It includes a graphical user interface so that +students can observe page replacement algorithms at work. Students +may be asked to implement a particular page replacement algorithm +which the instructor can test by comparing the output from the +student's algorithm to that produced by a working implementation. + +

+ +

Running the Simulator

+ +

+The program reads a command file, optionally reads +a configuration file, displays a GUI window which +allows you to execute the command file, and optionally +writes a trace file. +

+To run the program, enter the following command line. + +

+$ java MemoryManagement commands memory.conf
+
+ +

+The program will display a window allowing you to run the +simulator. You will notice a row of command buttons across +the top, two columns of "page" buttons at the left, and an +informational display at the right. +

+ +

+Typically you will +use the step button to execute a command from the +input file, examine information about any pages by clicking +on a page button, and when you're done, quit the +simulation using the exit button. + +

+The buttons: +

+ + +
Button +Description
run +runs the simulation to completion. Note that the simulation +pauses and updates the screen between each step. +
step +runs a single setup of the simulation and updates the display. +
reset +initializes the simulator and starts from the beginning of +the command file. +
exit +exits the simulation. +
page n +display information about this virtual page in the display +area at the right. +
+ +

+The informational display: +

+ + +
Field +Description
status: +RUN, STEP, or STOP. This indicates whether the current +run or step is completed. +
time: +number of "ns" since the start of the simulation. +
instruction: +READ or WRITE. The operation last performed. +
address: +the virtual memory address of the operation last performed. +
page fault: +whether the last operation caused a page fault to occur. +
virtual page: +the number of the virtual page being displayed in the +fields below. This is the last virtual page accessed by the simulator, +or the last page n button pressed. +
physical page: +the physical page for this virtual page, if any. -1 +indicates that no physical page is associated with this virtual page. +
R: +whether this page has been read. (1=yes, 0=no) +
M: +whether this page has been modified. (1=yes, 0=no) +
inMemTime: +number of ns ago the physical page was allocated to this virtual +page. +
lastTouchTime: +number of ns ago the physical page was last modified. +
low: +low virtual memory address of the virtual page. +
high: +high virtual memory address of the virtual page. +
+ +

The Command File

+ +

+The command file for the simulator specifies a sequence +of memory instructions to be performed. Each instruction +is either a memory READ or WRITE operation, and includes +a virtual memory address to be read or written. Depending on whether +the virtual page for the address is present in physical +memory, the operation will succeed, or, if not, a page fault +will occur. + +

Operations on Virtual Memory

+ +

+There are two operations one can carry out on pages in memory: +READ and WRITE. +

+The format for each command is +

+operation address
+
+or +
+operation random
+
+where operation is READ or WRITE, +and address is the numeric virtual memory address, optionally +preceeded by one of the radix keywords bin, oct, +or hex. If no radix is supplied, the number is assumed +to be decimal. +The keyword random will generate a random virtual +memory address +(for those who want to experiment quickly) +rather than having to type an address. + +

+For example, the sequence + +

+READ bin 01010101
+WRITE bin 10101010
+READ random
+WRITE random
+
+ +causes the virtual memory manager to: + +
    +
  1. read from virtual memory address 85 +
  2. write to virtual memory address 170 +
  3. read from some random virtual memory address +
  4. write to some random virtual memory address +
+ +

Sample Command File

+

+The "commands" input file looks like this: + +

+// Enter READ/WRITE commands into this file
+// READ  
+// WRITE  
+READ bin 100
+READ 19
+WRITE hex CC32
+READ bin 100000000000000
+READ bin 100000000000000
+WRITE bin 110000000000001
+WRITE random
+
+
+
+ +

The Configuration File

+ +The configuration file memory.conf is used to specify the +the initial content of the virtual memory map +(which pages of virtual +memory are mapped to which pages in physical memory) +and provide other configuration information, such +as whether operation should be logged to a file. + +

Setting Up the Virtual Memory Map

+

+The memset command is used to initialize each +entry in the virtual page map. +memset is followed by six integer values: + +

    +
  1. The virtual page # to initialize +
  2. The physical page # associated with this virtual page +(-1 if no page assigned) +
  3. If the page has been read from (R) (0=no, 1=yes) +
  4. If the page has been modified (M) (0=no, 1=yes) +
  5. The amount of time the page has been in memory (in ns) +
  6. The last time the page has been modified (in ns) +
+The first two parameters define the mapping between +the virtual page and a physical page, if any. +The last four parameters are values that might be used +by a page replacement algorithm. +

+For example, + +

+memset 34 23 0 0 0 0
+
+ +specifies that virtual page 34 maps to physical page 23, +and that the page has not been read or modified. +

+Note: +

    +
  • Each physical page should be mapped to exactly one virtual page. +
  • The number of virtual pages is fixed at 64 (0..63). +
  • The number of physical pages cannot exceed 64 (0..63). +
  • If a virtual page is not specified by any memset command, +it is assumed that the page is not mapped. +
+ +

Other Configuration File Options

+ +

There are a number of other options which can +be specified in the configuration file. These are +summarized in the table below. +

+ + +
KeywordValuesDescription +
enable_loggingtrue
false +
Whether logging of the operations should be enabled. If logging +is enabled, then the program writes a one-line message for each +READ or WRITE operation. By default, no logging is enabled. +See also the log_file option. + +
log_file +trace-file-name +The name of the file to which log messages should be written. +If no filename is given, then log messages are written to stdout. +This option has no effect if enable_logging is false +or not specified. + +
pagesizen
+power p +
The size of the page in bytes as a power of two. +This can be given as a decimal number which is a +power of two (1, 2, 4, 8, etc.) or as a power of two using +the power keyword. The maximum page size is +67108864 or power 26. The default +page size is power 26. + +
addressradixn +The radix in which numerical values are displayed. +The default radix is 2 (binary). You may prefer radix +8 (octal), 10 (decimal), or 16 (hexadecimal). +
+ +

Sample Configuration File

+

+The "memory.conf" configuration file looks like this: + +

+// memset  virt page #  physical page #  R (read from)  M (modified) inMemTime (ns) lastTouchTime (ns)
+memset 0 0 0 0 0 0      
+memset 1 1 0 0 0 0      
+memset 2 2 0 0 0 0      
+memset 3 3 0 0 0 0      
+memset 4 4 0 0 0 0      
+memset 5 5 0 0 0 0      
+memset 6 6 0 0 0 0      
+memset 7 7 0 0 0 0      
+memset 8 8 0 0 0 0      
+memset 9 9 0 0 0 0      
+memset 10 10 0 0 0 0            
+memset 11 11 0 0 0 0            
+memset 12 12 0 0 0 0            
+memset 13 13 0 0 0 0            
+memset 14 14 0 0 0 0            
+memset 15 15 0 0 0 0            
+memset 16 16 0 0 0 0            
+memset 17 17 0 0 0 0            
+memset 18 18 0 0 0 0            
+memset 19 19 0 0 0 0            
+memset 20 20 0 0 0 0            
+memset 21 21 0 0 0 0            
+memset 22 22 0 0 0 0            
+memset 23 23 0 0 0 0            
+memset 24 24 0 0 0 0            
+memset 25 25 0 0 0 0            
+memset 26 26 0 0 0 0            
+memset 27 27 0 0 0 0            
+memset 28 28 0 0 0 0            
+memset 29 29 0 0 0 0            
+memset 30 30 0 0 0 0            
+memset 31 31 0 0 0 0            
+
+// enable_logging 'true' or 'false'
+// When true specify a log_file or leave blank for stdout
+enable_logging true
+
+// log_file 
+// Where  is the name of the file you want output
+// to be print to.
+log_file tracefile
+
+// page size, defaults to 2^14 and cannot be greater than 2^26
+// pagesize  or <'power' num (base 2)>
+pagesize 16384
+
+// addressradix sets the radix in which numerical values are displayed
+// 2 is the default value
+// addressradix 
+addressradix 16
+
+// numpages sets the number of pages (physical and virtual)
+// 64 is the default value
+// numpages must be at least 2 and no more than 64
+// numpages 
+numpages 64
+
+
+ +

The Output File

+ +

+The output file contains a log of the operations +since the simulation started (or since the last reset). +It lists the command that was attempted and what happened +as a result. You can review this file after executing +the simulation. +

+The output file contains one line per operation +executed. The format of each line is: +

+command address ... status
+
+where: +
    +
  • command is READ or WRITE, +
  • address is a number corresponding to a virtual memory address, and +
  • status is okay or page fault. +
+ +

Sample Output

+The output "tracefile" looks something like this: + +
+READ 4 ... okay
+READ 13 ... okay
+WRITE 3acc32 ... okay
+READ 10000000 ... okay
+READ 10000000 ... okay
+WRITE c0001000 ... page fault
+WRITE 2aeea2ef ... okay
+
+ + +

Suggested Exercises

+ +
    +
  1. Create a command file that maps any 8 pages of physical memory to +the first 8 pages of virtual memory, and then reads from one virtual +memory address on each +of the 64 virtual pages. Step through +the simulator one operation at a time and see if you can predict +which virtual memory addresses cause page faults. What page replacement +algorithm is being used? +

    +
  2. Modify replacePage() in +PageFault.java to implement a round robin +page replacement algorithm +(i.e., first page fault +replaces page 0, next one replaces page 1, next one replaces page 2, +etc.). +

    +
  3. Modify replacePage() in +PageFault.java to implement a least recently used +(LRU) page replacement algorithm. +

    +
+ +

To Do

+
    +
  1. +The user guide should tell a little bit about how replacePage works, e.g. +what data structures it uses, what the arguments are, +how it operates, how it makes it choice known, etc. +Add a section of documentation on how to implement a new +page replacement algorithm. This should explain a little about +what changes are needed in the GUI, what to call the page replacement +class, what fields and methods it needs to provide, and what +other changes might be needed. +
+ +

Copyright

+ +© Copyright 2001, Prentice-Hall, Inc. +

+This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +

+This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +

+You should have received a copy of the GNU General Public License +along with this program (see copying.txt); +if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +

+ +Please send suggestions, corrections, and comments to +Ray Ontko +(rayo@ontko.com). +

+Last updated: July 28, 2001 + + diff --git a/EOPSY/lab4/task4/work/user_guide_1.gif b/EOPSY/lab4/task4/work/user_guide_1.gif new file mode 100644 index 00000000..1c34506e Binary files /dev/null and b/EOPSY/lab4/task4/work/user_guide_1.gif differ