Question: Programming Project #2 Linux Kernel Module for Listing Tasks In this project, you will write a kernel module that lists all current tasks in a
Programming Project #2 Linux Kernel Module for Listing Tasks In this project, you will write a kernel module that lists all current tasks in a Linux system. You will iterate through the tasks both linearly and depth first. Part IIterating over Tasks Linearly In the Linux kernel, the for_each_process() macro easily allows iteration over all current tasks in the system:
#include
struct task_struct *task; for_each_process(task) {
/* on each iteration task points to the next task */
}
The various fields in task_struct can then be displayed as the program loops through the for_each_process() macro. Assignment Design a kernel module that iterates through all tasks in the system using the for_each_process() macro. In particular, output the task command, state, and process id of each task. (You will probably have to read through the task_struct structure in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
