Closed toddkuhreng closed 6 years ago
depends on ARM
You're not activating your code/driver using the CONFIG_HELLO_APP
flag atm? Regardless, for correctness sake, this should be ARM64
.
obj-m +=hello.o
Not sure if this matters but just to be safe, have a space between "+" and "h".
I'm not really sure either but after that, try: make TARGET_BUILD_KERNEL=true BUILD_KERNEL_MODULES=true android_kernel_modules
Hi @vchong
So I just triedmake TARGET_BUILD_KERNEL=true BUILD_KERNEL_MODULES=true android_kernel_modules
. It says make complete and nothing got compiled.
However,
make TARGET_BUILD_KERNEL=true BUILD_KERNEL_MODULES=true
is compiling something now. This is gonna take a while now. Do you think that there is something wrong? (android_kernel_modules
is not recognizing any modules?)
Now I added CONFIG_HELLO_APP=m
to kernel/linaro/hisilicon/arch/arm64/configs/hikey_defconfig
and changed:
obj-m += hello.o
toobj-$(CONFIG_HELLO_APP) += hello.o
.
depends on ARM
to depends on ARM64
obj-m += hello/
to obj-$(CONFIG_HELLO_APP) += hello/
Then make TARGET_BUILD_KERNEL=true BUILD_KERNEL_MODULES=true
Should work, isn't it?
Thank you,
Hi @vchong
I think I have to enable loadable module
support in the Hikey Android kernel too. Do you know how to enable it?
I tried to add CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y
to
linaro/hisilicon/arch/arm64/configs/hikey_defconfig
. Is this the correct config file for hikey android kernel config file?
Everything looks ok to me in the 2 previous comments. Were you able to get it to work?
I'm a bit confused here, is the question how to create and compile a normal module in Linux (but using the kernel from Android)? If that is what you're asking for, then there must be tons of tutorials on the net already for that. https://hardikpatelblogs.wordpress.com/2010/11/19/8/ https://www.linuxvoice.com/be-a-kernel-hacker/ https://kernelnewbies.org/FAQ/LinuxKernelModuleCompile http://www.thegeekstuff.com/2013/07/write-linux-kernel-module/
What has this to do with OP-TEE?
@zhengfish Thanks!
Hi @vchong
I added this line in kernel/linaro/hisilicon/drivers/Makefile:
Added following in kernel/linaro/hisilicon/drivers/hello/Kconfig
Added following in kernel/linaro/hisilicon/drivers/hello/Makefile
obj-m +=hello.o
Added following in kernel/linaro/hisilicon/drivers/hello/hello.c
After compilation I only see following file in out/target/product/hikey/obj/kernel/drivers/hello:
built-in.o
I can't find
hello.ko
orhello.o
. How do I create a sample normal world hello.ko driver module in this AOSP+OPTEE repo?