Shot step by step. When a running process experiences a page fault, the frame to hold the missing page can only come from those frames allocated to that process, not from frames used by any other process. The memory system chooses which frame to use using a simple first-in-first-out technique. That is, the first time it must choose a frame to use to hold a page being loaded to resolve a page fault, it chooses the first frame it loaded originally. The second-page fault then uses the now ‘oldest’ frame (the second one that had been loaded originally), and so on: the first frame (originally) loaded becomes the first frame ‘out’ (i.e., to be reused). Each page fault causes only the one missing page to be loaded. Pages in this system are 4 Kbytes in size.
a) Suppose a program is executing a straight, linear sequence of instructions that is 100 KB long. This process is allocated 20 frames when put into memory. How many page faults will there be to completely execute this sequence of instruction?
b) Suppose the 100 KB block of instructions is a loop that repeats infinitely. How many page faults are there on the second iteration of the loop?
Shot step by step. When a running process experiences a page fault, the frame to hold...
Implement the frame replacement algorithm for virtual memory Assume a computer system have 10 memory frames available inside the physical memory and is required to execute a process containing 20 pages. Assume a process P has been executed in the system and produced a sequence of 40 page demands as follows: Page demands trace of process P Demand 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 cont. Page...
Instructions: Consider the following C++ program. It reads a sequence of strings from the user and uses "rot13" encryption to generate output strings. Rot13 is an example of the "Caesar cipher" developed 2000 years ago by the Romans. Each letter is rotated 13 places forward to encrypt or decrypt a message. For more information see the rot13 wiki page. #include <iostream> #include <string> using namespace std; char rot13(char ch) { if ((ch >= 'a') && (ch <= 'z')) return char((13...
LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to a function and returning values. Everything is stored on the runtime stack so that space is used only when the function is executing. As a result the actual address of arguments and locals may change from call to call. However, the layout of the stack frame (activation record) is constant. Thus, the offests from the frame pointer (FP) to the parameters/locals are constant. All...