04-19-04 02:34 PM
I am very new to linux kernel and just have basic programming
knowledge on linux machine and donot have much knowledege of linux
kernel compiling. SOrry if this would be very basic question, But i
have already tried lot doing it myself and not succeeded and hence
need ur help
I want to get write a device driver for the URAT. hence I started
reading " Linux Device Drivers, 2nd Edition By Alessandro Rubini &
Jonathan Corbet 2nd Edition June 2001" which is freely availavble on
the net at the URL "http://www.xml.com/ldd/chapter/book/ "
I want to compile a kernel without version support? [ie- one that
won't
complain if a module with a different version number is loaded]
Basically, I want a kernel that allows me to
# insmod ./hello.o
without this:
# insmod hello.o
hello.o: kernel-module version mismatch
hello.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8.
as described in the first couple of paragraphs in chapter 2 of
oreilly's
"Linux device drivers, which can be found here:
http://www.xml.com/ldd/chapter/book/ch02.html
I've tried the following:
# insmod -f hello.o
and found that it works fine with a warning.
Warning: kernel-module version mismatch
hellomodule.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.20-8
Warning: loading hellomodule.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about
tainted
modules
Warning: loading hellomodule.o will taint the kernel: forced load
Hello, world
Module hellomodule loaded, with warnings
# rmmod hellomodule
Goodbye cruel world
so that's great
#define MODULE
#include <linux/module.h>
int init_module(void) { printk("<1>Hello, world\n"); return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }
as hello.c (or whatever name), then
root# gcc -c hello.c
root# insmod ./hello.o
Hello, world
root# rmmod hello
Goodbye cruel world
root#
THE MAIN PROBLEM IS HERE
I have REDHAT LINUX 9.0 installed on my machine and i tried
recompiling the kernel for diaabling module version support.
When doing a make config, it's about the 3rd question in, "Set version
information on all module symbols"
I tried selecting 'Y' as well as 'N', compiled and created an image
file and later booted from that image, But was unable to disable the
module version support and still got the warning (
which option should i be selecting ??? 'Y' or 'N'
actually i have two source directories ie
"/usr/src/Linux 2.4" and "/usr/src/Linux 2.4.20" why do i have two
source directories ??? and which one should i use ???
I tried the following steps in both the directories ... plz let me
know where i committed the mistake
# cd /usr/src/Linux 2.4.20
#make xconfig
/* selected the third option, and all the options */
#make dep
#make clean
#make bzImage
#make modules
#make modules_install
/*after this step i got an Image file created in "/usr/src/Linux
2.4.20/arch/i386/boot/" named bzImage */
#cp /usr/src/Linux 2.4.20/arch/i386/boot/bzImage /boot/bzImage
then finally i made changes in the grub config file and added
another stanza in order to boot from the newly commpiled kernel and i
booted through the new image file
and i got a series of errors
some being
USB keybord failed
USB mouse failed
USB HID ... failed
IP... failed
and
many more, however i got the login promt ... and i succesfully logged
in as root
then i recommpiled the hello.c using
#gcc -f hello.c
then i tried
#insmod hello.o
but i got the same version warning
also can i know why i got all those booting errors when i have already
selected USB keybord/mouse/HID support during make xconfig???
waiting eagerly for ur reply ... please if u could send me a mail also
to shri_gajare@yahoo.com it would be a great help to me as i am not
subscribed to this group.
Many thanks (in advance) for your help!
[ Post a follow-up to this message ]
|