Question
write a kernel module named xyz that lists current processes/tasks in a Linux system based on given selection criteria. Remember that the Process Control Block
write a kernel module named xyz that lists current processes/tasks in a Linux system based on given selection criteria. Remember that the Process Control Block (PCB) in Linux is represented by the structure task_struct, which is found in the include file. In your code, you are required to iterate over all the current processes in the system using a Depth-First Search (DFS) tree. Also, use list_for_each(…) macro in your solution in order to direct your DFS.
Your code output should appear in the kernel log buffer that can be viewed by using the dmesg command. Verify your code by comparing the contents of the kernel log buffer with the output of the following command ps -eLf that lists all processes including threads in the system.
i. Print name and ID of all current processes in the system.
ii. Print information about of the processes into the kernel log that fits to below queries
a. What are the name, ID and priority value of the processes having ID < 100 ?
b. If the process named “gedit” exist in the system, what is its parent process name and ID ?
c. What are the name and ID of the processes whose states are runnable ?
Step by Step Solution
3.40 Rating (150 Votes )
There are 3 Steps involved in it
Step: 1
the kernel module named xyz in C that lists current processestasks in a Linux system based on given ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started