LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-28-2005, 08:04 AM   #1
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Rep: Reputation: 16
Loading module compiled on differenet version in 2.6 kernel


Hi,

I have query on module insertions.

While inserting the module with only a release version mismatch *2.6.5-<release version>), the kernel gives the following error:

Unresoved symbols in ...

In 2.4, we used to compile the module setting the module version (CONFIG_MODVERSIONS - MOdule versioning ) off, and forcefully inserting and it used to insert giving warnings. This does not work with 2.6.

I read a little about this and it said that earlier insmod used to relocate the addresses, wheras now, this is the responsibility of the kernel. (modutils has been changed to module-init-tools)
Reference: http://howtos.linux.com/howtos/Modul...s.shtml#AEN899

Is there any workaround, by which we can a module compiled in a different version in a kernel of a different version (with respect to the last release number only)?

Shrey
 
Old 07-29-2005, 02:30 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Did you compile your kernel with module versioning support (off by default)? I think that's the first step.
ta0kira
 
Old 07-29-2005, 02:52 AM   #3
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Original Poster
Rep: Reputation: 16
Hi ta0kira,

I did compile the code with module versioning supportoff, but it did not help. I am still receiveing the same error :

shrey
 
Old 07-29-2005, 03:50 AM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Try `nm <module name>.ko | grep "(\t| )U "` and post the output. The only things that should show up are the functions that interface with the kernel, such as the module loading/unloading functions. Has the module successfully loaded (as currently built) with the old kernel? If you are using gcc 4.0.x, that has a problem compiling modules.
ta0kira
 
Old 08-03-2005, 01:12 AM   #5
shrey_j
Member
 
Registered: Jul 2004
Location: Delhi
Distribution: FC3, RH 9.0
Posts: 39

Original Poster
Rep: Reputation: 16
Hi Ta0kira,

here Is the output I got from the module.
Could you please let me know, what to interpret from it.?

# nm main_mod.ko | grep U
U __copy_user
U __divsi3
U __kmalloc
U __mod_timer
U __register_filesystem
U __tasklet_schedule
U __wake_up
U allow_signal
U autoremove_wake_function
U bio_add_page
U bio_alloc
U bio_put
U call_rcu
U class_simple_create
U class_simple_destroy
U class_simple_device_add
U class_simple_device_remove
U close_bdev_excl
U daemonize
U finish_wait
U free_pages
U generic_file_read
U generic_file_write
U get_fs_type
U get_zeroed_page
U ia64_spinlock_contention
U jiffies
U kernel_flag
U kernel_thread
U kfree
U kill_anon_super
U kmem_cache_alloc
U malloc_sizes
U memcpy
U memset
U open_bdev_excl
U prepare_to_wait
U printk
U recalc_sigpending
U register_chrdev
U schedule
U sock_create
U sock_recvmsg
U sock_release
U sock_sendmsg
U sock_setsockopt
U strncmp
U strncpy
U submit_bio
U tasklet_init
U truncate_inode_pages
U unregister_chrdev
U unregister_filesystem
U vmem_map
U wake_up_process

regards
Shrey
 
Old 08-04-2005, 03:22 AM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I can see several things:

1) It looks like you have some sort of 64 bit numerical operation somewhere (__divsi3)
2) It looks like you need to link with a standard lib (memcpy, memset, etc.)
3) You might need to link with some other .o file that is part of the package

2.6 modules compile a lot differently than 2.4 modules; with 2.6, you pretty much say "do whatever the kernel makefile does, but with my module", and with 2.4 you actually write out the commands. Also, with 2.4 you can't link things because the module really is just an object file, whereas the .ko files for 2.6 are linked.

If you do `ls -A` in your make directory then you should see 3 hidden files (after building); one for .o, one for .ko, and one for ...mod.o (I think). Each of these files shows the command used to compile.

Can you post the compilation command used in the makefile for a build that worked and could be loaded (or the whole file if it's short, as in 20 lines or less)? I don't think you can just "build as usual" with this; I think you'll need to write out the command line and link with libstdc.a (the static version as opposed to the .so dynamic version); AFAIK modules don't dynamically link automatically. If you actually do have a 64 bit operation, I don't know what to do about that other than to convert it to a 32 bit operation.
ta0kira
 
Old 01-02-2006, 04:56 AM   #7
bluejon67
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
I was reading this thread with interest, as I have been trying unsuccessfully to enable hardware acceleration in my 2.6.12-12mdk kernel under Mandriva.

My graphics card is a Hercules Prophet 4500 64MB with the Kyro II chip.

Powervr supported this card with the 2.4 kernels, however, they didnt release the source, and do not support this card under 2.6 kernels.

Trying to force the loading of powervr.o into a 2.6 kernel isn't working (I think) because Powervr inserted some of their own 'specifics' into their Makefiles, and 2.6 doesnt recognise them.

Apart from buy a new card, what options do you think I have? Have been looking into the possibilities of reverse engineering the old module to obtain source. Is this feasable/do-able you think?

Thanks in advance
 
Old 09-03-2006, 04:39 PM   #8
macubo
Member
 
Registered: Mar 2004
Posts: 36

Rep: Reputation: 15
googleing i could find the 2.1 version of the sources. the readme reports that this version should work on 2.4.x kernels and 2.5.8 and above as well.

i dont really know if this means that even 2.6 kernel could run that module, but the sources are there to be hacked by someone (i hope)

bye
 
Old 09-04-2006, 08:03 AM   #9
macubo
Member
 
Registered: Mar 2004
Posts: 36

Rep: Reputation: 15
go read this post, a fb device driver for kyro is natively included in 2.6 kernel tree:
http://www.linuxquestions.org/questi...d.php?t=480102
 
  


Reply


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
couldn't find the kernel version the module was compiled for darai Linux - Newbie 1 09-12-2004 04:47 PM
couldn't find the kernel version the module was compiled for darai Linux - General 2 09-12-2004 02:56 PM
couldn't find the kernel version the module was compiled for famewolf Linux - Software 0 03-21-2004 09:52 PM
error loading a kernel module, "compiled using gcc2" taozilla Linux - Software 0 11-21-2003 03:23 PM
Couldn't find the kernel version the module was compiled for iannou Linux - General 2 06-27-2003 08:00 AM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration