The objective of this exercise is to count the number of page faults generated b
ID: 3717760 • Letter: T
Question
The objective of this exercise is to count the number of page faults generated by a program. We assume a pure on demand paging system with a page size of 128 bytes. We also assume that the counter variable I is in a register and that the code must be loaded in a separate frame. The size of the code is 172 bytes. We assume that 4 frames are allocated to this program. The program is: char aString[1024]; int main0 int i for (i 0; i 1024) String 'a; i. What is the string of references that this program will generate when accessing data? li. How many page faults in total (code and data) will happen? JustifyExplanation / Answer
As per your requirement i have written answers for both your questions please follow it step by step.
Solution:
i)
Explanation for Question 1:
Actually by the related information the string of references that is program will generate when accessing data is request will be made to the fetch 'a' from the memory to initialize it in aString[] array.
ii)
Explanation for Question 2:
Actually by the related information the number of page faults in total is the loop is running 1025 times, that is nothing but 1025 write operations will be done.
Here mainly what we observe that actually first access will be page fault and then after that, all 1024 accesses will be a hit.
The above both are solutions for your questions.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.