Solved

Kernel  module loading problrm

Posted on 2000-03-05
8
274 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

861 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