Question: int FUNCTION(unsigned int process_id) { task_t processes[MAX_PROCESSES]; task_ process = &processes[process_id]; unsigned int pagesfreed =0; (...) (...) (...) } Complete the above function (in C)
![int FUNCTION(unsigned int process_id) \{ task_t processes[MAX_PROCESSES]; task_ process = \&processes[process_id];](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c3fdc2336_45366f3c3fd5e96f.jpg)
int FUNCTION(unsigned int process_id) \{ task_t processes[MAX_PROCESSES]; task_ process = \&processes[process_id]; unsigned int pagesfreed =0; (...) (...) (...) \} Complete the above function (in C) to deallocate page table memory (page replacement) used by a process in termination (e.g. due to a segmentation or protection fault). (Structs for Reference): task: int: process_id, pagecount pde_t: "pagetable \} task_t pte: unsigned int: is_frame_in_use, ref, dirty, op, frame, page \} pte_t pde: pte_t ptepage; \} pde_t Hint: You can travel the page directory and find allocated pages (stored in ptepage) for freeing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
