LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-15-2010, 05:14 AM   #16
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50

Code:
grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=0

splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu

title Fedora (2.6.32.3)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32.3 ro root=UUID=21d34cba-e758-4a3d-8f2f-e98988868a68 rhgb quiet
initrd /boot/initrd-2.6.32.3.img

title Fedora (2.6.27.5-117.fc10.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.5-117.fc10.i686 ro root=UUID=21d34cba-e758-4a3d-8f2f-e98988868a68 rhgb quiet
initrd /boot/initrd-2.6.27.5-117.fc10.i686.img
"default" is set to 1 (grub start counting to 0), and it's the standard fedora kernel. More over, you have a time out of 0, that means that the menu to choose the kernel is not displayed, add 5 or 10 to display it 5 (or 10) seconds before booting with the default kernel.

Last edited by jf.argentino; 01-15-2010 at 05:15 AM. Reason: fixing end code block
 
Old 01-15-2010, 05:20 AM   #17
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
@ anishakaul
compiled the code it is generating .ko file but when i do
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
insmod kernel
insmod: can't read 'kernel': No such file or directory
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


new kernel is latest one 2.6.32.3
old kernel is my fedor10 2.6.27.5


++++++++++++++++++++++++++++++++++++
grub.conf
++++++++++++++++++++++++++++++++++++
title Fedora (2.6.32.3)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32.3 ro root=UUID=21d34cba-e758-4a3d-8f2f-e98988868a68 rhgb quiet
initrd /boot/initrd-2.6.32.3.img
title Fedora (2.6.27.5-117.fc10.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.5-117.fc10.i686 ro root=UUID=21d34cba-e758-4a3d-8f2f-e98988868a68 rhgb quiet
initrd /boot/initrd-2.6.27.5-117.fc10.i686.img
~
 
Old 01-15-2010, 05:21 AM   #18
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by rachilmeth
@ anishakaul
compiled the code it is generating .ko file but when i do
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
insmod kernel
insmod: can't read 'kernel': No such file or directory
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
try from root:
Code:
insmod kernel.ko

Last edited by TheIndependentAquarius; 01-15-2010 at 05:24 AM.
 
Old 01-15-2010, 05:25 AM   #19
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
insmod kernel.ko
insmod: error inserting 'kernel.ko': -1 Invalid module format
 
Old 01-15-2010, 05:28 AM   #20
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by rachilmeth
insmod kernel.ko
insmod: error inserting 'kernel.ko': -1 Invalid module format
That's quite surprising . I tried it on my terminal now, it worked fine !!

Kindly post the output of 'make' command !
 
1 members found this post helpful.
Old 01-15-2010, 05:33 AM   #21
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
Makefile output :make
make -C /lib/modules/2.6.32.3/build M=/root/abc modules
make[1]: Entering directory `/root/linux-2.6.32.3'
CC [M] /root/abc/kernel.o
Building modules, stage 2.
MODPOST 1 modules
CC /root/abc/kernel.mod.o
LD [M] /root/abc/kernel.ko
make[1]: Leaving directory `/root/linux-2.6.32.3'

File generated are

-rw-r--r-- 1 root root 236 kernel.c
-rw-r--r-- 1 root root 140 Makefile
-rw-r--r-- 1 root root 0 Module.symvers
-rw-r--r-- 1 root root 31 modules.order
-rw-rw-r-- 1 root root 35064 kernel.o
-rw-rw-r-- 1 root root 35088 kernel.mod.o
-rw-r--r-- 1 root root 497 kernel.mod.c
-rw-r--r-- 1 root root 69195 kernel.ko
 
Old 01-15-2010, 05:37 AM   #22
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Remove ONLY the following files from your folder and then do make and insmod again:


Code:
rm Module.symvers modules.order kernel.o kernel.mod.o kernel.mod.c kernel.ko
 
Old 01-15-2010, 05:41 AM   #23
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
@Anisha
still same
insmod kernel.ko
insmod: error inserting 'kernel.ko': -1 Invalid module format
 
Old 01-15-2010, 05:46 AM   #24
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
It never happened like this with me !!

Now my last question, have u properly inserted tabs in u r makefile ?

I am asking this because this program is working very fine on my computer !!

Last edited by TheIndependentAquarius; 01-15-2010 at 06:17 AM.
 
Old 01-15-2010, 05:48 AM   #25
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
yeah ...otherwise make won't work properly ..can u show me your output of make & files created , thanks ...
 
Old 01-15-2010, 05:55 AM   #26
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Code:
linux:/home/anisha/t # make
make -C /lib/modules/2.6.31.8-0.1-desktop/build M=/home/anisha/t modules
make[1]: Entering directory `/usr/src/linux-2.6.31.8-0.1-obj/x86_64/desktop'
make -C ../../../linux-2.6.31.8-0.1 O=/usr/src/linux-2.6.31.8-0.1-obj/x86_64/desktop/. modules
  CC [M]  /home/anisha/t/ker.o
  Building modules, stage 2.
  MODPOST 1 modules
  LD [M]  /home/anisha/t/ker.ko
make[1]: Leaving directory `/usr/src/linux-2.6.31.8-0.1-obj/x86_64/desktop'
Code:
linux:/home/anisha/t # ls -l
total 240
-rw-r--r-- 1 root root   237 2010-01-15 16:21 ker.c
-rw-r--r-- 1 root root   236 2010-01-15 16:20 ker.c~
-rw-r--r-- 1 root root 82299 2010-01-15 16:21 ker.ko
-rw-r--r-- 1 root root   132 2010-01-15 16:21 .ker.ko.cmd
-rw-r--r-- 1 root root   700 2010-01-15 16:21 ker.mod.c
-rw-r--r-- 1 root root 46864 2010-01-15 16:21 ker.mod.o
-rw-r--r-- 1 root root 19362 2010-01-15 16:21 .ker.mod.o.cmd
-rw-r--r-- 1 root root 36992 2010-01-15 16:21 ker.o
-rw-r--r-- 1 root root 19239 2010-01-15 16:21 .ker.o.cmd
-rw-r--r-- 1 root root   153 2010-01-15 16:20 Makefile
-rw-r--r-- 1 root root     0 2010-01-15 16:21 Module.markers
-rw-r--r-- 1 root root    29 2010-01-15 16:21 modules.order
-rw-r--r-- 1 root root     0 2010-01-15 16:21 Module.symvers
drwxr-xr-x 2 root root  4096 2010-01-15 16:21 .tmp_versions
Code:
linux:/home/anisha/t # insmod ker.ko
linux:/home/anisha/t #

Last edited by TheIndependentAquarius; 01-15-2010 at 05:57 AM.
 
Old 01-15-2010, 06:02 AM   #27
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
@anisha
hiw many kernels you have installed in your system.
 
Old 01-15-2010, 06:06 AM   #28
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
I didn't install any special kernel on my comp.

I am working with the default kernel on OpenSuse 11.2

I suppose u should fix your kernel problem (uname -r) first and then try anything else, coz. now kernel problem is the only difference between your comp and my comp w.r.t insmod !
 
1 members found this post helpful.
Old 01-15-2010, 06:06 AM   #29
rachilmeth
LQ Newbie
 
Registered: Jan 2010
Posts: 19

Original Poster
Rep: Reputation: 0
yes very true ...thanks
 
Old 01-15-2010, 06:11 AM   #30
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,674
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
1. Try whatever jf.argentino has said.
2. Also read the links I pointed to.


If still u r unable to solve the version problem then u can start a new thread for it !

Good Luck

Last edited by TheIndependentAquarius; 01-15-2010 at 06:13 AM.
 
  


Reply

Tags
kernel, module


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile basic hello.c kernel program Suse Linux 9.3 pat_and_cami Programming 2 02-25-2006 02:13 PM
Kernel compile tips needed Tim Johnson Slackware 6 09-08-2005 06:30 PM
what ports needed to compile kernel? joroxx *BSD 13 12-01-2004 09:58 PM
Special things needed to compile a program? thw Linux - Newbie 4 03-27-2004 04:43 PM
how much space needed to compile a kernel? e1000 Linux - General 1 12-22-2003 04:17 PM


All times are GMT -5. The time now is 10:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration