Welcome! Log In Create A New Profile

Advanced

Compiling kernel module

Posted by iceone 
Compiling kernel module
September 26, 2010 09:45AM
Hi,

I am trying to get an MSI US300EX Lite W-Lan-Stick running on the dockstar. To do so I am trying to compile the kernel module rt2870sta directly on the device. The compilation runs fine and I get an rt2870sta.ko file, but when I try to load the module gives the following error message:

insmod: error inserting 'rt2870sta.ko': -1 Invalid module format


As far as I understand, the module was not correctly compiled for the ARM architecture. The CFLAG-Option -march=armv5 does not change anything.

Additionally I noticed that there is an arm-linux-gnueabi-gcc compiler installed, but there are no binutils for the platform.

What do I have to do, to compile a kernel module for the platform? Or do I have to cross-compile from another machine?

This is my uname -a output:

Linux debian 2.6.32-5-kirkwood #1 Sat Sep 18 15:20:08 UTC 2010 armv5tel GNU/Linux

EDIT:

The following is the output of modinfo rt2870sta.ko:

filename:       rt2870sta.ko
version:        2.4.0.0
license:        GPL
description:    RT2870 Wireless Lan Linux Driver
author:         Paul Lin <paul_lin@ralinktech.com>
srcversion:     5598BFE60F8B720D8D64062
alias:          usb:v0DB0p6899d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v100Dp9031d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v050Dp815Cd*dc*dsc*dp*ic*isc*ip*
{ ... }
alias:          usb:v148Fp2870d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v148Fp2770d*dc*dsc*dp*ic*isc*ip*
depends:        usbcore
vermagic:       2.6.32-5-kirkwood mod_unload modversions ARMv5 
parm:           mac:rt28xx: wireless mac addr (charp)



Edited 2 time(s). Last edit at 09/26/2010 02:18PM by iceone.
ecc
Re: Compiling kernel module
September 26, 2010 10:38AM
iceone Wrote:
-------------------------------------------------------
> Additionally I noticed that there is an arm-linux-gnueabi-gcc compiler installed,
> but there are no binutils for the platform.

That does seem suspicious. Make sure you can at least compile and run a "hello world" program before trying a kernel.

> What do I have to do, to compile a kernel module for the platform?

You need the exact same headers and build infrastructure as the kernel you're going to load the module into. On Debian, the easiest way to do this is to use the module-assistant program.

> Or do I have to cross-compile from another machine?

That works (and can be much faster), but it isn't required.
Re: Compiling kernel module
September 26, 2010 12:02PM
Will rt2800usb work? It is already available in 2.6.35.4.
Re: Compiling kernel module
September 26, 2010 02:11PM
Thank you for your answers. Compiling and running a simple hello world c-program using the standard gcc-command on the dockstar works fine.

After the installation of the debian system I installed the package linux-headers-2.6.32-5-kirkwood which should be appropriate for the kernel Linux debian 2.6.32-5-kirkwood.

rt2800usb does not work with the stick. It recognizes the stick, but no communication is possible. I've read that it is even necessary to blacklist this module.

I am now installing a virtual machine to cross-compile the kernel and the module. Maybe that works..
Re: Compiling kernel module
September 26, 2010 02:36PM
http://rt2x00.serialmonkey.com/phpBB/viewtopic.php?f=5&t=6065

problem with this kernel and this driver 2.6.32 is not optimal for rt2x
Re: Compiling kernel module
September 26, 2010 10:27PM
new kernel with ur wlan driver online
Re: Compiling kernel module
September 27, 2010 01:33AM
Great, thank you very much! I will try it out immediately when I get home from work.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: