Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > Linux
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 12th, 2006, 02:24 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default linux kernel compilation problem

i have compile a module for linux . i have red-hat linux 2.4.20-8 somewhat like this version kernel. and when i compile that module for
linux, the module version is 2.4.20 only so when i insert the module it
gives the error version of module is differt from the kernel version .
so can anybody tell me how i could compile that module so that its version is similar to my kernel version as i compile that module on my
kernel version 2.4.20-8 but module is compiled with differnt version.

Reply With Quote
  #2 (permalink)  
Old May 23rd, 2006, 04:55 AM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

after you make your kernel do
make modules

HTH

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote
  #3 (permalink)  
Old June 5th, 2006, 05:03 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

z
Quote:
quote:Originally posted by ciderpunx
 after you make your kernel do
make modules

HTH
--
Don't Stand on your head - you'll get footprints in your hair
                                         http://charlieharvey.org.uk
                                             http://charlieharvey.com
i have not make the kernel . the kernel is of red -hat
i have only make the module but the version in which it is compiled is not same as the kernel version


Reply With Quote
  #4 (permalink)  
Old June 19th, 2006, 06:27 AM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by abhishekshrivastav
 z
Quote:
quote:Originally posted by ciderpunx
Quote:
 after you make your kernel do
make modules

HTH
--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
i have not make the kernel . the kernel is of red -hat
i have only make the module but the version in which it is compiled is not same as the kernel version


Ah OK,

Then you'll want to install the module for the same version of the kernel that you're running. You should be able to download it from the kernel archive:

http://kernel.org/

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote
  #5 (permalink)  
Old October 13th, 2006, 06:47 AM
Registered User
 
Join Date: Oct 2006
Location: Bangalore, Karanataka, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shyjumon.n
Default

 Hi, new here, and having trouble with hello-1.c compliling.
I am using Fedora Core 4 (2.6.11 kernel version), and here is my hello-1.c
/*
 * hello#8722;1.c #8722; The simplest kernel module
 */
#define KERN_INFO
        module_LICENSE("GPL"); //also tried MODULE_LINCENSE("GPL");

#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
int init_module(void)
{
        printk(KERN_INFO "Hello world 1.\n");
        /*
         * A non 0 return means init_module failed; module can't be loaded.
         */
        return 0;
}
void cleanup_module(void)
{
        printk(KERN_INFO "Goodbye world 1.\n");
}
 here is my make file
CFLAGS = -D __KERNEL__ -D MODULE -isystem /lib/modules/`uname -r`/build/include/
$ hello-1.o: hello-1.c
        gcc $(CFLAGS) -O2 -Wall -c hello-1.c
.PHONY: clean
clean:
        rm -rf *.o a.out

gcc -D __KERNEL__ -D MODULE -isystem /lib/modules/`uname -r`/build/include/ -O2 -Wall -c hello-1.c
hello-1.c:5: error: syntax error before string constant
hello-1.c:5: warning: type defaults to ‘int’ in declaration of ‘module_LICENSE’
hello-1.c:5: warning: data definition has no type or storage class
In file included from /usr/include/linux/module.h:10,
                 from hello-1.c:7:
/usr/include/linux/config.h:5:2: error: #error Incorrectly using glibc headers for a kernel module
hello-1.c: In function ‘init_module’:
hello-1.c:11: warning: implicit declaration of function ‘printk’
make: *** [hello-1.o] Error 1

Here is the output from the screen.

Thanks for the help.


smn
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compilation error on linux GIGI BOOK: Ivor Horton's Beginning Visual C++ 2005 1 November 5th, 2007 12:37 PM
DLL registration/compilation problem DarrenMelling Pro VB 6 0 October 12th, 2007 02:35 AM
Kernel compilation probelm shyjumon.n Linux 1 October 24th, 2006 07:49 AM
JSP Compilation Problem devteam JSP Basics 1 January 13th, 2006 02:13 PM
Linux kernel configuration to include SCSI drivers manitu Linux 0 August 9th, 2005 11:40 AM



All times are GMT -4. The time now is 09:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.