Pandora Help compiling a module for the pandora (with ivanovic's crosscompiler)


asimov-solensan

Very Active Member
Joined
Jan 8, 2010
Messages
733
I want to make my usb-to-psx adapter work in the pandora. I have looked in my desktop linux and the module needed is hid-sjoy, found the module here:


http://lxr.free-electrons.com/source/drivers/hid/hid-sjoy.c?v=3.2;a=arm


Now I have got the ivanovic's corsscompiler set up, I also downloaded the kernel sources from:


git://git.openpandora.org/pandora-kernel.git


And here begin the problems, seeing the README inside the folder downloaded from the git it says that kernel version is 2.6. Not sure if it's only the README which is not updated or I really have the sources for the 2.6 kernel.


Anyhow I tried to go ahead and then copied the folder include to /usr/include in my crosscompiler. Also made sure that all .h files needed by the code I have were in the foder /usr/include/linux.


Still when I try to compile it says that can't find the file linux/slab.h.


I never coded for the pandora and don't know how to use this crosscompiler so it's for sure that I'm doing something wrong.
 
The procedure to get the new kernel is:



Code:
git clone git://openpandora.org/pandora-kernel.git

cd pandora-kernel

git checkout --track -b pandora-3.2 origin/pandora-3.2
 
Ok, didn't use the second command (never used git before).


I also solved the problem with the missing files forcing the full path in the .c file. The error it gives me now is related to the files included in the sources. Can it be that they have some errors in them? Do I need to edit those files by hand?



Code:
asimov@debian:~/pandora_cross_compiler$ arm-2011.09/bin/arm-none-linux-gnueabi-gcc hid-sjoy.c

In file included from hid-sjoy.c:29:0:

/home/asimov/pandora_cross_compiler/arm-2011.09/usr/include/linux/input.h:1035:15: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token

In file included from hid-sjoy.c:30:0:

/home/asimov/pandora_cross_compiler/arm-2011.09/usr/include/linux/slab.h:12:23: fatal error: linux/gfp.h: No such file or directory

compilation terminated.

asimov@debian:~/pandora_cross_compiler$
 
Last edited by a moderator:
One other thing:


Is ivanovics toolchain even able to compile modules? Isn't the djwillis and sebt3 one the one which can do it?


Have you copied the kernelconfig from nand and built the kernel?
 
You can't compile kernel modules by just running gcc on them, they have to be compiled with special options and linker scripts. Proper way to do it is to use kernel's build system, something like:



Code:
export PATH=$PATH:$HOME/pandora_cross_compiler/arm-2011.09/bin/

export ARCH=arm

export CROSS_COMPILE=arm-none-linux-gnueabi

cd pandora-kernel

make omap3_pandora_defconfig

make menuconfig # select the missing module here

make


Or you can wait for next firmware build, where that module will be included.

Have you copied the kernelconfig from nand and built the kernel?
You don't have to do that, "make omap3_pandora_defconfig" generates compatible config for you.
 
Well, it doesn't matter if it will be included or not, I'm doing this just to improve my knowledge. I don't have work at the moment and find this kind of things entertaining.


Now I have a few things to look at and try. Sadly (or not) I will spend the week at my sister's home and I don't have my computer here.


Thanks.
 
Well, let's give this another try.


I'm trying what notaz said but I'm having problems with this. Once I run the make the process ends with this message:



Code:
/tmp/ccsJWyZm.s:540: Error: selected processor does not support ARM mode `smc #0'

/tmp/ccsJWyZm.s:611: Error: selected processor does not support ARM mode `smc #0'

make[1]: *** [arch/arm/kernel/sysfs_v7.o] Error 1

make: *** [arch/arm/kernel] Error 2

asimov@debian:~/pandora_cross_compiler/pandora-kernel$


Besides this I'm not sure what I'm doing here, what I can see is that I'm compiling the same kernel I have on the pandora but adding support for extra devices. Once I do that where will be the file .ko that i need to load in the pandora?
 
Back
Top