Solved

Kernel  module loading problrm

Posted on 2000-03-05
8
272 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
what is Amazon Linux AMI 6 57
How to trace the cause of Out Of Memory issues 8 68
Understanding curl command 1 50
Shell script for mvn build 2 69
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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 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

13 Experts available now in Live!

Get 1:1 Help Now