-   Linux - Newbie (
-   -   Diff between /sys/module and /proc/modules (

shariefbe 12-05-2009 10:49 PM

Diff between /sys/module and /proc/modules
May i know what is the difference between /sys/modules and /proc/modules?

I know this /proc/modules is a file and this /sys/module is a directory. But i am confused. why this both is having similar information about currently running driver modules. sorry if i am wrong.

Simon Bridge 12-06-2009 07:12 AM

/proc and /sys are usef for different purposes.

/proc/modules does not actually exist until you call it, at which point it is generated. For instance, if you query lsmod.

/sys/module is a directory which contains other directories. These directories contain files which have information about many things, which may include currently running modules as well as, without burdening you with technical jargon, other stuff. It is used by the kernel to figure out what to do.


simon@indigo-prime:~$ cat /proc/modules | grep processor
simon@indigo-prime:~$ ls /sys/module/processor

Here you see that there is information in /sys/module which is not in /proc/modules.

Of course, I can be more specific if I understand what prompted the question.

All times are GMT -5. The time now is 06:44 PM.