Finding the kernel address of a loadable kernel module

I am trying to find the kernel address space in which my loadable kernel module is moved using insmod.

I learned that using the -m, -O-switches, while insmod'ing the module, we can only see the table of characters and addresses of the executable sections from the point of view of the module, and not their moved addresses, since this process of moving takes place when we do insmod.

Can someone tell me how to find the moved address of the module in the kernel-memory, that is, the address associated in the kernel where the loaded module is located?

Thank!

PS Please note that I am using the Linux Redhat 2.4 kernel, in which the / proc / modules list does not display the virtual addresses of the loaded modules.

+5
source share
2 answers

You can get a pointer to the main partition (a virtual address, not a physical memory address, but it can be converted to a physical address) and the size of the disk space of the module from the / proc / modules file.

As part of the file on my Linux server:

autofs4 29253 3 - Live 0xf9014000
hidp 23105 2 - Live 0xf900d000
rfcomm 42457 0 - Live 0xf8f84000
+7
source

Go to the directory /sys/module/<module-name>/sections/.text- it will show where the code is loaded, /sys/module/<module-name>/sections/.datadisplay the data section and .bss for the bss section of the module.

+10
source

All Articles