kernel module/driver cross-compilation


eyecreate

Member
Joined
Feb 3, 2009
Messages
253
Website
git.eyecreate.org
I've seen lots of threads about compiling custom kernels and a few marginally useful ones in which people were trying to compile their own drivers/modules. Using that knowledge and some experience I've had in the past compiling kernels, I got the driver source from the cd-rom that came with this:


http://www.dealextreme.com/p/usb-10-100-rj45-ethernet-network-adapter-dongle-2797


Problem is trying to insert it with insmod just got me an incompatibility message. Now I need to figure out if the driver is wrong, the way I compiled it was wrong, or the kernel I picked out was wrong. Anybody have some debugging steps to help here?


1. To kernel I got from git.openpandora.org, I make oldconfig && make prepare scripts. I mostly hit enter when it asked for options, hoping the defaults were correct.(may be wrong..I did select one thing non-default...I made sure ti-omap was selected for arm processor.) I had to remove rpath option from ld_flags set by setprj or else the kernel makefile complained.


2. modifed makefile of driver to point to kernel_dir and cross_compile to have the right gcc prefix. Went through and output a .ko.
 
Last edited by a moderator:
To get a compatible kernel module you need :


- a compatible compiler (_same_ compiler version)


- the right kernel tree.


You seems to be using yactfeau which is the same compiler OE use to build the kernel in the firmware, so it should works (for what I know nobody that tryed got that to work)


So do you have applied all the OE patches for the kernel ? (patches, order to apply them)
 
To get a compatible kernel module you need :


- a compatible compiler (_same_ compiler version)


- the right kernel tree.


You seems to be using yactfeau which is the same compiler OE use to build the kernel in the firmware, so it should works (for what I know nobody that tryed got that to work)


So do you have applied all the OE patches for the kernel ? (patches, order to apply them)
I guess I thought the git branch I used was pre-patched. Still, after patching, it still isn't accepting it. Does it matter if the options I selected when asked are different than those selected to make the actual pandora kernel? I'd think it would, and if it does, is there a way to list/autoconfigure kernel so that those items are selected. Also, I hope I'm also correct in that the kernel itself doesn't have to be built in order to make a driver/module.
 
I guess I thought the git branch I used was pre-patched. Still, after patching, it still isn't accepting it.
(for what I know nobody that tryed got that to work)
Also, I hope I'm also correct in that the kernel itself doesn't have to be built in order to make a driver/module.
What you have sshould be enough. Debian module-assistant only use the kernel headers ;)
I've been trying to read the README that came with the driver, but don't understand this part from Google Translate:


3.1 determine whether the file has been included into the kernel mii.c code, specific processes such as the attached picture mii-1, 2,3,4


3.2 determine whether the file has been included into the kernel usbnet.c code, specific processes such as the attached picture usbnet-1, 2,3,4


3.1 确定文件mii.c已经被包含入kernel代码中,具体过程如附件中的图片mii-1,2,3,4


3.2 确定文件usbnet.c已经被包含入kernel的代码中,具体过程如附件中的图片usbnet-1,2,3,4


I ask because I also have now tried using the c++ tools pnd to compile the driver on the Pandora itself, but I'm getting boatloads of errors, most seeming to surround those classes/files.
 
Back
Top