Question: Follow the instructions below and implement a module print_self. This module identifies the current process at the user-level and print out various information of the
Follow the instructions below and implement a module print_self. This module identifies the current process at the user-level and print out various information of the process.
Implement the print_self module and print out the following:
• Process name, id, and state;
• The same above information of its parent processes until init.
To keep things clean, I recommend that you create different sub-directories for different modules and create a different Makefile
1. The macro current returns a pointer to the task struct of the current running process. When you load your module, which process is recognized as current?
2. In old kernels the mother of all processes is called init. In newer kernels, what is it called and what do you see from your module’s output?
3. To see the different states of a process, Map the numeric state to its string state, e.g., print TASK RUNNING if state is 0. From your module’s output, which state(s) are observed?
Step by Step Solution
3.47 Rating (154 Votes )
There are 3 Steps involved in it
1 Kernel Module Implementation Firstly its important to note that kernel modules need to be written in C and require a good understanding of the Linux ... View full answer
Get step-by-step solutions from verified subject matter experts
