subject

Design a kernel module that iterates through all tasks 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 system:ps -elThe 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 02:30
The can be used to paste text in any order
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 24.06.2019 07:40
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Which best describes the condition under which the unicode output is the same as plain text ?
Answers: 1
You know the right answer?
Design a kernel module that iterates through all tasks in the system using the for_each_process() ma...
Questions
question
Biology, 06.01.2021 01:00
question
Mathematics, 06.01.2021 01:00
question
Mathematics, 06.01.2021 01:00
question
Mathematics, 06.01.2021 01:00
question
English, 06.01.2021 01:00