LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-22-2008, 02:03 AM   #1
tommy24
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Rep: Reputation: 0
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 System.map? Any response is appreciated. Thanks in advance.
^_^
 
Old 07-22-2008, 11:37 PM   #2
Nijie
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
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.

Regards
Jason
 
Old 07-24-2008, 09:11 PM   #3
tommy24
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-24-2008, 11:31 PM   #4
Nijie
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
Should be in module.c
 
Old 07-25-2008, 09:13 PM   #5
tommy24
LQ Newbie
 
Registered: Nov 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks for response.
I mean in which object file, such like .o or .so.
Thanks again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the virtual address of the .data segment ravi Linux - Newbie 0 01-31-2006 01:35 AM
gDeslets: The display file contains invalid data and could not be loaded. Correador Mandriva 1 08-24-2004 04:54 AM
kernel: No module symbols loaded - kernel modules not enabled. Qucho Debian 9 05-26-2004 02:50 AM
Do I need an /etc/modules.conf to use LKM's behmjose Linux - Newbie 0 03-08-2004 09:59 AM
Some prob's getting LKM's to compile right hadding Programming 1 11-06-2003 06:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration