MajorasKid MajorasKid - 3 years ago 72
Linux Question

Where is the List with all loaded Kernel Moduls located

I need help with one of my task. I'm writing a Linux Kernel Module which should print all loaded modules (just like print_modules but each one in a different line). I'm not allowed to read files (like /proc/modules).

My Problem is that I'm not able to find the corresponding List in the Kernel so that I can access it with my C code.

I already search Modules.c/.h and found the Modul struct where a doubly-linked list is stored, but I cant access the other moduls with that one.

Hope my problem is clear and somebody can help me. Thanks in advance

Answer Source

Copy from my comment:

The list can be found within the own Kernel Module (with a function get_module). There is an object Module->List, which is a doubly-linked list. With list.h we can get the Module of list.next/.prev

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download