Solved

Kernel  module loading problrm

Posted on 2000-03-05
8
273 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:hay123
ID: 2591298
Edited text of question.
0
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux rpm install 5 215
Help Linux centos 5.7 3 89
Optimize bash script 20 464
Linux Hanging with disable Error Output 4 83
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

815 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

11 Experts available now in Live!

Get 1:1 Help Now