c - Not able to build the kernel driver natively -


i building kernel on test machine on have insert module. makefile :

obj-m += my-driver-module.o  all:          make -c /lib/modules/$(shell uname -r)/build m=$(pwd) modules  clean:         make -c /lib/modules/$(shell uname -r)/build m=$(pwd) clean 

but getting error :

make[1]: *** /lib/modules/4.4.16-bone11/build: no such file or directory.  stop. makefile:4: recipe target 'all' failed make: *** [all] error 2 

i checked in /lib/modules/4.4.16-bone11/ directory in test machine , found build symbolically linked sources(path development machine) built kernel test machine :

 build -> path-in-my-development_machine-kernel-location-for-test-machine>/bb-kernel/kernel 

i downloaded headers using command : sudo apt-get install linux-headers-uname -r , able build module same makefile when trying insert it says :

insmod: error: not insert module my-driver-module.ko: invalid module format 

how can resolve it. driver works expected when cross-compiled , inserted.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -