-   Linux - Kernel (
-   -   Where is LKM's text and data segment once it is loaded into kernel? (

tommy24 07-22-2008 03:03 AM

Where is LKM's text and data segment once it is loaded into kernel?
Hi all,

I read the article about the internal of LKM. But I still don't know where is the location of the text and data segment of LKM once LKM loaded into kernel. As far as I know, sys_init_module copies the `module` structure into the allocated space in kernel. Does the whole object comes with that structure or allocated in other place? Which kernel function makes such allocation? Does it have a range about the LKM locations in Any response is appreciated. Thanks in advance.

Nijie 07-23-2008 12:37 AM

I've just posted another interesting question regarding the LKM's position in the kernel space, and it looks something similiar to this. :)

As far as i know, the sys_init_module allocates the kernel memory to hold a module by utilizing the vmalloc, and then it copies the module text into that memory region, resolves the kernel reference in the module via the kernel symbol table and also register its new exported symbols. As for the range of the sysmap, i am not so sure, maybe others can give a comment.


tommy24 07-24-2008 10:11 PM

Thanks for your answer. I got it.
By the way, Do you know where the sys_init_module is. I mean in which file, since I want to objdump to see the assembly of it. Thanks again.

Nijie 07-25-2008 12:31 AM

Should be in module.c

tommy24 07-25-2008 10:13 PM

Thanks for response.
I mean in which object file, such like .o or .so.
Thanks again.

All times are GMT -5. The time now is 08:50 PM.