Question: Need to write program code in C language Your task is to implement two simplified PageFaultHandlers for an OS. Your program references ovided on the

Need to write program code in C language

Need to write program code in C language Your task is toimplement two simplified PageFaultHandlers for an OS. Your program references ovided onthe standard input, and will react to the sequen( of the virtual

Your task is to implement two simplified PageFaultHandlers for an OS. Your program references ovided on the standard input, and will react to the sequen( of the virtual page implement: local page replacement algorithm using Clock replacement strategy; and global page replacement algorithm using FIFO strategy as deseribed in lecture notes and text book. virtual page reference has the following format: process id where . process id> is a nonnegative integer, unique for each process is a nonnegative integer The first line of input contas the word LOCAL or GLOBAL. The second ne of input contains an integer M2 (number of frames given to a single process for use in local replacements, or total number of frames in the system in global replacement) Here is an example ofve fist lines of the input (comments are here for explanation on LOCAL I process 1 gonerates access to Virtual Page 0 I process 1 gonerates access to VP 1 I process 1 gonerates access to VP 4 I process 2 gonerates access to VP 0 I process 1 gonerates access to VP 0 1 4 1 4 2 1 3 0 Your PageFaultHandler will change processes page tables, if a particular page reference is a PageFault. It will also acumulate information on the number of page replacements per process When all lines of the input are processed (empty line is the signal of the end of input), your program will print the following information for each process: process id> and content of cach process Page Table (valid entrics only!! thend of processing. You can assume that at the beginning a frames (frame numbers start with 0) are free and in the case of local replacement there are enough free frames to admit all processes mentioned in the input For example, if the input is LOCAL 3 1 0 1 2 2 0 2 1 your program will print PID Page Faults 1 3 2 3 Process 1 page table Page Frame Process 2 page table Page Frame 0 3 2 5 If the same input starts with line GLOBAL your program will print (note that the process 1 page table is empty procss 1 sno valid page-table entries as the reslt of global replacement in this case PID Page Faults 2 3 Process 1 page table Page Frame Process 2 page table Page Frame More test cases be posted on course web-site. Do not assume any limit on the number of lines in the input! Do not assume that process IDs appear in the input in any particular order, or that process IDs form a sequence of consequtive numbers. You can have processes with IDs 20, 11, 3, and 5 in the input, and only these need to be handled and printed Your task is to implement two simplified PageFaultHandlers for an OS. Your program references ovided on the standard input, and will react to the sequen( of the virtual page implement: local page replacement algorithm using Clock replacement strategy; and global page replacement algorithm using FIFO strategy as deseribed in lecture notes and text book. virtual page reference has the following format: process id where . process id> is a nonnegative integer, unique for each process is a nonnegative integer The first line of input contas the word LOCAL or GLOBAL. The second ne of input contains an integer M2 (number of frames given to a single process for use in local replacements, or total number of frames in the system in global replacement) Here is an example ofve fist lines of the input (comments are here for explanation on LOCAL I process 1 gonerates access to Virtual Page 0 I process 1 gonerates access to VP 1 I process 1 gonerates access to VP 4 I process 2 gonerates access to VP 0 I process 1 gonerates access to VP 0 1 4 1 4 2 1 3 0 Your PageFaultHandler will change processes page tables, if a particular page reference is a PageFault. It will also acumulate information on the number of page replacements per process When all lines of the input are processed (empty line is the signal of the end of input), your program will print the following information for each process: process id> and content of cach process Page Table (valid entrics only!! thend of processing. You can assume that at the beginning a frames (frame numbers start with 0) are free and in the case of local replacement there are enough free frames to admit all processes mentioned in the input For example, if the input is LOCAL 3 1 0 1 2 2 0 2 1 your program will print PID Page Faults 1 3 2 3 Process 1 page table Page Frame Process 2 page table Page Frame 0 3 2 5 If the same input starts with line GLOBAL your program will print (note that the process 1 page table is empty procss 1 sno valid page-table entries as the reslt of global replacement in this case PID Page Faults 2 3 Process 1 page table Page Frame Process 2 page table Page Frame More test cases be posted on course web-site. Do not assume any limit on the number of lines in the input! Do not assume that process IDs appear in the input in any particular order, or that process IDs form a sequence of consequtive numbers. You can have processes with IDs 20, 11, 3, and 5 in the input, and only these need to be handled and printed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!