Good day. I am writing a kernel module that displays all processes from the kernel. The problem is that only part of the process is output. Here is the code:
#include <linux/kernel.h> #include <linux/module.h> #include <linux/sched.h> MODULE_LICENSE("GPL"); int init_module( void ) { /* Выбираем отправную точку */ struct task_struct *task = &init_task; /* Перебираем элементы списка задач, пока снова не встретим init_task */ do { printk( KERN_INFO "Process: %s pid:[%d] \n", task->comm, task->pid); } while ( (task = next_task(task)) != &init_task ); return 0; } void cleanup_module( void ) { return; }