Question: SYSTEM CALLS IN C (LINUX KERNEL) * write a system call to report the current status of a specific address. The system call takes a
SYSTEM CALLS IN C (LINUX KERNEL)
* write a system call to report the current status of a specific address. The system call takes a virtual address of a process and outputs the following information:
1. If the data in this address is in memory or on disk.
2. If the page which this address belongs to has been referenced or not.
3. If the page which this address belongs to is dirty or not.
Hints: It is helpful to read subsection of Chapter 2: Page table handling of the reference book Understanding the Linux Kernel (ULK) (3rd edition). The page descriptor struct page defined in linux/mm_types.h contains information (i.e., the flags field) about the page. You need to figure out how to obtain a reference to the page descriptor given a virtual address and read to information from the page descriptor. To test if an address is in memory, you need to test the present flag of the addresss corresponding page table entry. Note that Linux uses multi-level page tables, you might need multiple steps to reach the page table entry of a given virtual addres
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
