Solved

Kernel  module loading problrm

Posted on 2000-03-05
8
271 Views
Last Modified: 2012-05-04
I have written one module for vfs and
compiled agenist kernel 2.2.12. compilation and linking the object files are done fine. I am getting some errors while insert the module via insmod command. I am mentioning the error messages below.
--------------
#insmod XXX
unresolved symbol lock_super
unresolved symbol unlock_super
unresolved symbol bcopy
--------------

I don't know which library is using and which version.

Could please help out to thing do proprely ..and how to find out the library version?

Note : jlevie was asked about the compiler and linker options , I am listing below.

CC=gcc
MODCFLAGS :=  -DMODULE -D__KERNEL__  -I XXX/include

$(CC) $(MODCFLAGS) -c xxx1.c
$(CC) $(MODCFLAGS) -c xxx2.c
......     ......    .....
$(CC) $(MODCFLAGS) -c xxxn.c

ld -m elf_i386 -r -Map xxx.map -o XXX xxx1.o xxx2.o ... xxxn.o
0
Comment
Question by:hay123
8 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2587312
Can I see the compile & link commands you used?
0
 

Author Comment

by:hay123
ID: 2591292
Edited text of question.
0
 

Author Comment

by:hay123
ID: 2591293
Note : jlevie was asked about the compiler and linker options , I am listing below.

CC=gcc
MODCFLAGS :=  -DMODULE -D__KERNEL__  -I XXX/include

$(CC) $(MODCFLAGS) -c xxx1.c
$(CC) $(MODCFLAGS) -c xxx2.c
.......     ......    .....
$(CC) $(MODCFLAGS) -c xxxn.c

ld -m elf_i386 -r -Map xxx.map -o XXX
0
 

Author Comment

by:hay123
ID: 2591298
Edited text of question.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Expert Comment

by:kiffney
ID: 2649642
Did you put the new module in the modules directory and then do
depmod -a
before trying to load it?  
0
 

Expert Comment

by:ghins76
ID: 2707653
Hey,

I am not too sure abt the symbols lock_super and unlock_super. But as for bcopy, it is a symbol that comes as part of standard C library glibc or libc5 ..whichever u r using.

Now, when u insmod, the object file is linked against the kernel. The kernel DOES NOT have these functions/symbols and hence the error messages. You must be knowing that in the kernel modules  we do not use printf(), instead we use printk(). This is because printf is part of the standard ANSI library whereas printk is a function defined in the kernel itself.


So what you need to do is write your own bcopy, lock_super ... functions

Hope that helps
0
 

Accepted Solution

by:
ghins76 earned 50 total points
ID: 2730236
This is actually a continuation of my previous comment.

You could refer the book "Linux Device Drivers" by Alessandro Rubini for all that you need to know.
0
 

Author Comment

by:hay123
ID: 2730757
Hi qhins76

    The lock_super and unlock_super are the inline functions in locks.h. These are get resolved when
I compiled the my module code along with linux source.. Ths bcopy is not defined in kernel image..
We had changed to memcpy insted bcopy...

        Now the it is not giving any error like unresolved sybols...  Now it is giving as follows

#insmod XXX.o
(some thing like this..)
This module you compiled for which kernel version.
#

    If u have any IDEA....
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now