It's UWAweek 44 (2nd semester, 1st exam week)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 820 articles.
Currently 9 other people reading this forum.


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported

Login to reply

👍?
helpful
12:25pm Mon 7th Oct, Kristiaan M.

page: {process_id,page_num,time} before input: RAM pages: {0,0,0},{0,1,0},{0,2,0},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} DISC pages: {0,99,0},{0,99,0},{0,99,0},{0,99,0},{1,99,0},{1,99,0},{1,99,0},{1,99,0},{2,99,0},{2,99,0},{2,99,0},{2,99,0},{3,99,0},{3,99,0},{3,99,0},{3,99,0} input: "0 2 1 3 3 2 2 0 2 1 0 2 3 0" process 0 process 0 page table: {0,0,0},{0,1,0},{0,2,0},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} process 0 page table: {0,0,0 -> {0,99,0->1}},{0,1,0},{0,2,0},{0,3,0} // evict and replace smallest time step in RAM process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{0,1,0},{0,2,0},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} process 2 process 2 page table: {2,99,0},{2,99,0},{2,99,0},{2,99,0} RAM total: {0,99,1},{0,1,0},{0,2,0},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{0,2,0},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM process 2 page table: {2,99,1},{2,99,0},{2,99,0},{2,99,0} process 1 process 1 page table: {1,4,0},{1,5,0},{1,6,0},{1,7,0} RAM total: {0,99,1},{2,99,1},{0,2,0 -> 1,4,0->1},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{0,3,0},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM process 1 page table: {1,4,1},{1,5,0},{1,6,0},{1,7,0} process 3 process 3 page table: {3,99,0},{3,99,0},{3,99,0},{3,99,0} RAM total: {0,99,1},{2,99,1},{1,4,1},{0,3,0 -> 3,99,0->1},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{1,4,0},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM process 3 page table: {3,99,1},{3,99,0},{3,99,0},{3,99,0} process 3 process 3 page table: {3,99,1},{3,99,0},{3,99,0},{3,99,0} RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{1,4,0 -> 3,99,0->1},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{1,5,0},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM process 3 page table: {3,99,1},{3,99,1},{3,99,0},{3,99,0} process 2 process 2 page table: {2,99,0},{2,99,0},{2,99,0},{2,99,0} RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{1,5,0 -> 2,99,0->1},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{1,6,0},{1,7,0} // evict and replace smallest time step in RAM process 2 page table: {2,99,1},{2,99,1},{2,99,0},{2,99,0} process 2 process 2 page table: {2,99,1},{2,99,1},{2,99,0},{2,99,0} RAM total: {0,99,1},{2,99,1},{1,99,1},{3,99,1},{3,99,1},{2,99,1},{1,6,0 -> {2,99,0->1}},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{1,7,0} // evict and replace smallest time step in RAM process 2 page table: {2,99,1},{2,99,1},{2,99,1},{2,99,0} process 0 process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} RAM total: {0,99,1},{2,99,1},{1,99,1},{3,99,1},{3,99,1},{2,99,1},{1,6,0 -> {0,99,0->1}},{1,7,0} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{1,7,0} // evict and replace smallest time step in RAM process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} process 2 process 2 page table: {2,99,1},{2,99,1},{2,99,1},{2,99,0} RAM total: {0,99,1},{2,99,1},{1,99,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{1,7,0 -> {2,99,0->1}} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} // evict and replace smallest time step in RAM process 2 page table: {2,99,1},{2,99,1},{2,99,1},{2,99,1} process 1 process 1 page table: {1,4,1},{1,5,0},{1,6,0},{1,7,0} RAM total: {0,99,1 -> {1,5,0->1}},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{2,99,1} // evict and replace smallest time step in RAM RAM total: {1,5,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} process 1 page table: {1,4,1},{1,5,1},{1,6,0},{1,7,0} process 0 process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} RAM total: {{1,5,1} -> {0,99,0->1}},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{2,99,1} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} process 2 process 2 page table: {2,99,1},{2,99,1},{2,99,1},{2,99,1} RAM total: {0,99,1 -> {2,99,0->1}},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} // evict and replace smallest time step in RAM RAM total: {2,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} process 2 page table: {2,99,1},{2,99,1},{2,99,1},{2,99,1} process 3 process 3 page table: {3,99,1},{3,99,1},{3,99,0},{3,99,0} RAM total: {2,99,1 -> {3,99,0->1}},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} // evict smallest time step from RAM RAM total: {3,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{0,99,1},{2,99,1} // bring in least recently used page into RAM process 3 page table: {3,99,1},{3,99,1},{3,99,1},{3,99,0} process 0 process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} RAM total: {3,99,1 -> {0,99,0->1}},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{2,99,1} // evict and replace smallest time step in RAM RAM total: {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{2,99,1} // evict and replace smallest time step in RAM process 0 page table: {0,99,1},{0,1,0},{0,2,0},{0,3,0} {0,99,1},{2,99,1},{1,4,1},{3,99,1},{3,99,1},{2,99,1},{2,99,1},{2,99,1} my output 0 99 1 2 3 1 4 5 6 7 2 99 99 99 99 3 99 99 99 99 0,99,1;2,99,1;1,4,1;3,99,1;3,99,1;2,99,1;2,99,1;2,99,1; correct output 0 99 99 99 1 99 99 99 2 99 99 99 3 99 99 99 0,0,0;0,0,0;1,0,1;1,0,1;2,0,2;2,0,2;3,0,3;3,0,3;Empty;Empty;Empty;Empty;Empty;Empty;Empty;Empty;

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy