problem with creating a kernel module program for angstrom os

hello,

i recently purchased beagle bone black . my bbb come with pre compiled angstrom os( Angstrom v2012.12 - Kernel 3.8.13) still i didn’t updated my os
i try to test my board with simple hello module program . but when i insert a module i got the error message

root@beaglebone:~# insmod hello.ko
Error: could not insert module hello.ko: Invalid module format
root@beaglebone:~#

i compiled the module program from my host pc against arm-angstrom-linux-gcc compiler…and i transferred the hello.ko file via scp protocol.

my question is
[1] Is it possible to add a module program with my available angstrom os…if yes what should i do to insert modules???
[2] what are all the basic things needed to insert a module??

help me to better understand the beagle bone black!!!

dmesg will give you more details.

This usually means you compiled the kernel modules against a different build of the kernel. So, the kernel source you used didn’t match what was on the beaglebone.

You can install the kernel-headers and kernel-dev packages and build directly on the beaglebone. For some time, these packages weren’t in sync with the actual kernel installed…as always, good luck with Angstrom.

thanks for your reply

yes , u r right i compiled the module against arm-angstrom-linux-gnueabi-gcc but my angstrom os comes with Linaro gcc

root@beaglebone:~# opkg list_installed | grep gcc
gcc - linaro-4.7-r9.2
gcc-symlinks - linaro-4.7-r9.2
libgcc-s-dev - linaro-4.7-r9.0
libgcc1 - linaro-4.7-r9.0
perl-module-extutils-cbuilder-platform-windows-gcc - 5.14.2-r13.1

root@beaglebone:~# dmesg | head

[ 0.000000] Booting Linux on physical CPU 0×0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.8.13 (koen@rrMBP) (gcc version 4.7.3 20130205 (prerelease) (Linaro GCC 4.7-2013.02-01) ) #1 SMP Tue Jun 18 02:11:09 EDT 2013
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=50c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Generic AM33XX (Flattened Device Tree), model: TI AM335x BeagleBone
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 130816
[ 0.000000] free_area_init_node: node 0, pgdat c0688d80, node_mem_map c06e4000
[ 0.000000] Normal zone: 1024 pages used for memmap

i done the following steps to update my modules for my board .but it says my kernel headers are up to date.

root@beaglebone:~# opkg install kernel-headers
Package kernel-headers (3.8.13-r23a.22) installed in root is up to date.

[1] what should i do to get my modules to work with??

Just a regular kernel type makefile. For examlpe, here’s mine for a file phyaccess.c

Missed first line on that copy paste. Should be

hai,
thank u!!
but my folder structure from my board looks like

root@beaglebone:/usr/src# ls
backfire linux-3.8.13
root@beaglebone:/usr/src# cd linux-3.8.13/
root@beaglebone:/usr/src/linux-3.8.13# ls
include
root@beaglebone:/usr/src/linux-3.8.13/include# ls

asm asm-generic drm linux mtd rdma scsi sound uapi video xen

root@beaglebone:/usr/src/linux-3.8.13/include/linux# ls

byteorder dvb isdn netfilter_arp netfilter_ipv6 spi tc_ematch
caif hdlc mmc netfilter_bridge nfsd sunrpc usb
can hsi netfilter netfilter_ipv4 raid tc_act wimax

root@beaglebone:/usr/src/linux-3.8.13/include/linux#

this info shows that my board shipped with no module support by default …!!!

now question is
[1] still i didn’t update or upgraded my angstrom os …shall i need to do or is there any other way to insert my hello_world.ko module into my board??
i found 1 more link for installing the module libs sturcture and soure into the running os . here the link

http://wiki.replicape.com/index.php?title=Compiling_the_kernel
will this link help me to insert also to create a modules without fail …

can you suggest your opinion…pls…

regards
siva

Did you install the kernel-dev package?