subject

Design a kernel module that iterates through all task in the system using the for_each_process() macro. In particular, output the task name (known as executable name), state, and process id of each task. (You will probably have to read through the task_struct structure in to obtain the names of these fields.) write this code in the module entry point so that its contents will appear in the kernel log buffer, which can be viewed using the dmesg command. To verify that your code is working correctly, compare the contents of the kernel log buffer with the output of the following command, which lists all tasks in the systemps -el
The two values should be very similar. Because tasks are dynamic, however, it is possible that a few tasks may appear in one listing but not the other.

#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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Does read theory have answers keys ?
Answers: 1
You know the right answer?
Design a kernel module that iterates through all task in the system using the for_each_process() mac...
Questions
question
Mathematics, 31.01.2020 00:57
question
Computers and Technology, 31.01.2020 00:57
question
History, 31.01.2020 00:57
Questions on the website: 13722362