Solved

Kernel  module loading problrm

Posted on 2000-03-05
8
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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