[android-kernel] Re: Loadable Kernel Module
Sorry, I assumed since you were posting to a kernel-related email list that you had a dev phone, or a rooted one which allows access to things such as insmod. You aren't going to be able to do any of this without root access. On Aug 12, 10:51 pm, perumal316 perumal...@gmail.com wrote: Hi Andrew, My main doubt is after changing how do I update the phone with the new config? The only way is to recompile the kernel and using a developer phone flash the new kernel image in. But how do update kernel of locked phones (those bought from telcos)? Thanks and Regards, Perumal On Aug 12, 10:51 pm, andrew_esh andrew.c@gmail.com wrote: gunzip config.gz, and edit it with a text editor. If you have a kernel source tree, put it in there named .config, and do make menuconfig to use the menu system to edit it. The latter method is probably the easiest, but requires a kernel source tree. On Aug 10, 5:06 am, perumal316 perumal...@gmail.com wrote: Hi Sven, If I adb pull /proc/config.gz, I gets the config file. But how is it possible for me to modify the configurations from the config file. Just use wordpad to chnage the settings and adb push the new config? Regards, Perumal On Aug 10, 5:33 pm, Sven Killig s...@killig.de wrote: -Original Message- From: android-kernel@googlegroups.com [mailto:android- ker...@googlegroups.com] On Behalf Of Sven Killig Sent: Tuesday, August 10, 2010 11:31 AM To: android-kernel@googlegroups.com Subject: RE: [android-kernel] Loadable Kernel Module adb pull /proc/config.gz ... insmod module.ko The module certainly can't use any API that's absent in the phone kernel.- Hide quoted text - - Show quoted text - -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
gunzip config.gz, and edit it with a text editor. If you have a kernel source tree, put it in there named .config, and do make menuconfig to use the menu system to edit it. The latter method is probably the easiest, but requires a kernel source tree. On Aug 10, 5:06 am, perumal316 perumal...@gmail.com wrote: Hi Sven, If I adb pull /proc/config.gz, I gets the config file. But how is it possible for me to modify the configurations from the config file. Just use wordpad to chnage the settings and adb push the new config? Regards, Perumal On Aug 10, 5:33 pm, Sven Killig s...@killig.de wrote: -Original Message- From: android-kernel@googlegroups.com [mailto:android- ker...@googlegroups.com] On Behalf Of Sven Killig Sent: Tuesday, August 10, 2010 11:31 AM To: android-kernel@googlegroups.com Subject: RE: [android-kernel] Loadable Kernel Module adb pull /proc/config.gz ... insmod module.ko The module certainly can't use any API that's absent in the phone kernel. -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
Hi Andrew, My main doubt is after changing how do I update the phone with the new config? The only way is to recompile the kernel and using a developer phone flash the new kernel image in. But how do update kernel of locked phones (those bought from telcos)? Thanks and Regards, Perumal On Aug 12, 10:51 pm, andrew_esh andrew.c@gmail.com wrote: gunzip config.gz, and edit it with a text editor. If you have a kernel source tree, put it in there named .config, and do make menuconfig to use the menu system to edit it. The latter method is probably the easiest, but requires a kernel source tree. On Aug 10, 5:06 am, perumal316 perumal...@gmail.com wrote: Hi Sven, If I adb pull /proc/config.gz, I gets the config file. But how is it possible for me to modify the configurations from the config file. Just use wordpad to chnage the settings and adb push the new config? Regards, Perumal On Aug 10, 5:33 pm, Sven Killig s...@killig.de wrote: -Original Message- From: android-kernel@googlegroups.com [mailto:android- ker...@googlegroups.com] On Behalf Of Sven Killig Sent: Tuesday, August 10, 2010 11:31 AM To: android-kernel@googlegroups.com Subject: RE: [android-kernel] Loadable Kernel Module adb pull /proc/config.gz ... insmod module.ko The module certainly can't use any API that's absent in the phone kernel.- Hide quoted text - - Show quoted text - -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
I mean kernel version can be known from the phone and it can then be used to compile the module accordingly. But now how to load it in. Does it mean that in all phone sold from telcos, kernel modules cannot be loaded? Thanks In Advance, Perumal On Aug 10, 3:26 pm, Chong Yang fbf...@gmail.com wrote: that's impossible , a loadable kernel module depend on both kernel version and kernel configure. On Tue, Aug 10, 2010 at 3:14 PM, perumal316 perumal...@gmail.com wrote: Hi All, The current way to load a kernel module into an Android phone is to rebuilt the kernel enabling loadable module support, then flashing the new kernel image into the phone so it must be a developer phone and then using the console to insmod the kernel module. I want to load kernel modules into an non developer Android phone (my personal phone). Is it possible? If yes, how can this be done? I search online but couldn't find any information regarding this. Thanks In Advance, Perumal -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website:http://groups.google.com/group/android-kernel- Hide quoted text - - Show quoted text - -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
Hi Sven, If I adb pull /proc/config.gz, I gets the config file. But how is it possible for me to modify the configurations from the config file. Just use wordpad to chnage the settings and adb push the new config? Regards, Perumal On Aug 10, 5:33 pm, Sven Killig s...@killig.de wrote: -Original Message- From: android-kernel@googlegroups.com [mailto:android- ker...@googlegroups.com] On Behalf Of Sven Killig Sent: Tuesday, August 10, 2010 11:31 AM To: android-kernel@googlegroups.com Subject: RE: [android-kernel] Loadable Kernel Module adb pull /proc/config.gz ... insmod module.ko The module certainly can't use any API that's absent in the phone kernel. -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
Re: [android-kernel] Re: loadable kernel module...
On Thu, May 27, 2010 at 11:34 AM, rohan raizada rohan.raiza...@gmail.com wrote: Hi, I am unable to run my LKM on the Google Dev Phone2. The thing that i tried was that I sent the .ko file to the phone using adb push .ko file /sdcard/module and when i tried executing it it simply said: Permission denied. How do i get my module to work on the phone that I have. You do not execute a kernel module, how would that work? You do know how to load a kernel module, right? What are you expecting your kernel module to do? greg k-h -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
Re: [android-kernel] Re: loadable kernel module...
Yes I did insmod .ko but it gave me Permission denied. I am trying to load the module into the kernel and see the output of it using dmesg. Thanks, Rohan. On Thu, May 27, 2010 at 4:04 PM, Greg KH gre...@gmail.com wrote: On Thu, May 27, 2010 at 11:34 AM, rohan raizada rohan.raiza...@gmail.com wrote: Hi, I am unable to run my LKM on the Google Dev Phone2. The thing that i tried was that I sent the .ko file to the phone using adb push .ko file /sdcard/module and when i tried executing it it simply said: Permission denied. How do i get my module to work on the phone that I have. You do not execute a kernel module, how would that work? You do know how to load a kernel module, right? What are you expecting your kernel module to do? greg k-h -- unsubscribe: android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: loadable kernel module...
Hi Rohan, You can try using the below code in the Makefile: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /home/AndroidKernelDirectory PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m :=hello.o endif Regards, Perumal On May 25, 1:57 pm, rohan raizada rohan.raiza...@gmail.com wrote: Hi, I have written a small LKM for android. Now when i try to build it I get the following error: make ARCH=arm CROSS_COMPILE=../../../prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- -C /home/roaan/mydroid/common/kernel/ M=`pwd` modules make: Entering directory `/home/roaan/mydroid/common/kernel' make: *** No rule to make target `modules'. Stop. make: Leaving directory `/home/roaan/mydroid/common/kernel The module that i want to build is hello.c in the current directory. Thanks, Rohan. -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website:http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
Re: [android-kernel] Re: loadable kernel module...
Thanks Greg, Perumal and Pavan for your inputs .. finally i got it working :-) Thanks, Rohan. On Wed, May 26, 2010 at 12:46 PM, Pavan Savoy pavan.sa...@gmail.com wrote: M=`pwd` should work from your present working directory .. On Wed, May 26, 2010 at 10:07 PM, rohan raizada rohan.raiza...@gmail.com wrote: Hi, I created a Makefile as Greg suggested but even then it doesnt seem to work and now it seems to be giving me this error. The Makefile that I have is as follows: /**/ myhome=/home/roaan compiler=${myhome}/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin moduledir=/home/roaan/junk obj-m := hello.o all: make ARCH=arm CROSS_COMPILE=${compiler}/arm-eabi- -C ${myhome}/mydroid/common/kernel M= ${moduledir}/ modules The error that i seem to get is as follows: make[1]: Entering directory `/home/roaan/mydroid/common/kernel' make[1]: Nothing to be done for `/home/roaan/junk/'. make[1]: *** No rule to make target `modules'. Stop. make[1]: Leaving directory `/home/roaan/mydroid/common/kernel' make: *** [all] Error 2 I have a module called as hello.c in folder /home/roaan/junk and Makefile is also in the same folder. Also I didn't understand the usage of M= ${moduledir}/ modules and what is modules used for here. Thanks, Rohan. On Wed, May 26, 2010 at 11:27 AM, perumal316 perumal...@gmail.com wrote: Hi Rohan, You can try using the below code in the Makefile: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /home/AndroidKernelDirectory PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m :=hello.o endif Regards, Perumal On May 25, 1:57 pm, rohan raizada rohan.raiza...@gmail.com wrote: Hi, I have written a small LKM for android. Now when i try to build it I get the following error: make ARCH=arm CROSS_COMPILE=../../../prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- -C /home/roaan/mydroid/common/kernel/ M=`pwd` modules make: Entering directory `/home/roaan/mydroid/common/kernel' make: *** No rule to make target `modules'. Stop. make: Leaving directory `/home/roaan/mydroid/common/kernel The module that i want to build is hello.c in the current directory. Thanks, Rohan. -- unsubscribe: android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com website:http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -- --Pavan Savoy -- unsubscribe: android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
Hi, I currently working on a monitoring tool in a form of LKM, which I want to use to monitor the system calls made and aruguments passed during the calls. I can access into the system call table and replace system calls (using the LKM) but this is only for one system call. Any idea how to capture parameters passed and monitor the system calls made by applications? Regards, Perumal -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel
[android-kernel] Re: Loadable Kernel Module
Haven't encountered that error. Try checking your kernel .config and include Module unloading Forced module unloading under the Enable loadable module support menu. On Nov 6, 9:58 am, perumal316 perumal...@gmail.com wrote: Hi Mr Chew, When I rmmod my modules. i keep on getting rmmod: delete_module failed (errno 38) error message. Any idea what is causing this? My exit portion of the code is similar to those I tried in Linux. It works fine in Linux. Regards, Perumal On Oct 30, 12:59 pm, Chew Esmero chew.esm...@gmail.com wrote: No problem. Happy coding. =) On Oct 30, 12:45 pm, Chew Esmero chew.esm...@gmail.com wrote: Oh, sorry. Didn't get it right. Terminal emulator in Android has no root privileges unfortunately. May I ask why would you do it in terminal emulator when you can do it in adb (already root)? On Oct 30, 12:30 pm, perumal316 perumal...@gmail.com wrote: Hi Mr Chew, I have built the module against the goldfish kernel. Then I start the emulator then in a terminal (adb shell) then insmod it and it is working. But within the emulator there is a terminal emulator. If I insmod there the module is not loaded (Operation Not Permitted). Since it is working in the shell, it should also work within the terminal emulator but not sure why it is not working. Is there any way to verify I have root access in terminal emulator? Regards, Perumal On Oct 30, 12:10 pm, Chew Esmero chew.esm...@gmail.com wrote: Hi Perumal, I'm confused when you say that it's already working in shell but not in emulator. Working in shell meaning you insmod the hello.ko to your host? If so, then the module was not properly built. If module is properly built against the goldfish kernel, output module would be for ARM architecture therefore you cant insmod it to your host (assuming your host is x86). Only in emulator since emulator is an emulated ARM architecture. On Oct 30, 11:35 am, perumal316 perumal...@gmail.com wrote: Hi, I also faced similar problem, your MakeFile may need changes, below is the makefile i used: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /goldfish/kernel PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m := hello.o endif Or you can also try the one mentioned by Mr Chew above. Also as mentioned by him above set the path to your CROSS_COMPILE directory before make. Regards, Perumal On Oct 30, 10:57 am, Eduardo Acker izayahighfat...@gmail.com wrote: Hi Chew, I'm a newbie in linux/android and Im having some problems to compile the my module. i dowloaded the android-goldfish-2.6.29 snapshot and the android plataform. Compiled the kernel with your instructions to ARCH and CROSS_COMPILE and have no problem, but when i try to compile the module it givesthe error: - entering directory /home/acker/goldfish/kernel - no rule to process the target modules any idea of what i did wrong? thanks for the help, Eduardo Acker 2009/10/29 Chew Esmero chew.esm...@gmail.com Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be
[android-kernel] Re: Loadable Kernel Module
Thanks Mr Chew, I managed to solve it. I didn't enable module unloading and forced module unloading previously. After enabling and making the kernel again, I can unload the modules. Regards, Perumal On Nov 6, 10:22 am, Chew Esmero chew.esm...@gmail.com wrote: Haven't encountered that error. Try checking your kernel .config and include Module unloading Forced module unloading under the Enable loadable module support menu. On Nov 6, 9:58 am, perumal316 perumal...@gmail.com wrote: Hi Mr Chew, When I rmmod my modules. i keep on getting rmmod: delete_module failed (errno 38) error message. Any idea what is causing this? My exit portion of the code is similar to those I tried in Linux. It works fine in Linux. Regards, Perumal On Oct 30, 12:59 pm, Chew Esmero chew.esm...@gmail.com wrote: No problem. Happy coding. =) On Oct 30, 12:45 pm, Chew Esmero chew.esm...@gmail.com wrote: Oh, sorry. Didn't get it right. Terminal emulator in Android has no root privileges unfortunately. May I ask why would you do it in terminal emulator when you can do it in adb (already root)? On Oct 30, 12:30 pm, perumal316 perumal...@gmail.com wrote: Hi Mr Chew, I have built the module against the goldfish kernel. Then I start the emulator then in a terminal (adb shell) then insmod it and it is working. But within the emulator there is a terminal emulator. If I insmod there the module is not loaded (Operation Not Permitted). Since it is working in the shell, it should also work within the terminal emulator but not sure why it is not working. Is there any way to verify I have root access in terminal emulator? Regards, Perumal On Oct 30, 12:10 pm, Chew Esmero chew.esm...@gmail.com wrote: Hi Perumal, I'm confused when you say that it's already working in shell but not in emulator. Working in shell meaning you insmod the hello.ko to your host? If so, then the module was not properly built. If module is properly built against the goldfish kernel, output module would be for ARM architecture therefore you cant insmod it to your host (assuming your host is x86). Only in emulator since emulator is an emulated ARM architecture. On Oct 30, 11:35 am, perumal316 perumal...@gmail.com wrote: Hi, I also faced similar problem, your MakeFile may need changes, below is the makefile i used: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /goldfish/kernel PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m := hello.o endif Or you can also try the one mentioned by Mr Chew above. Also as mentioned by him above set the path to your CROSS_COMPILE directory before make. Regards, Perumal On Oct 30, 10:57 am, Eduardo Acker izayahighfat...@gmail.com wrote: Hi Chew, I'm a newbie in linux/android and Im having some problems to compile the my module. i dowloaded the android-goldfish-2.6.29 snapshot and the android plataform. Compiled the kernel with your instructions to ARCH and CROSS_COMPILE and have no problem, but when i try to compile the module it givesthe error: - entering directory /home/acker/goldfish/kernel - no rule to process the target modules any idea of what i did wrong? thanks for the help, Eduardo Acker 2009/10/29 Chew Esmero chew.esm...@gmail.com Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your
[android-kernel] Re: Loadable Kernel Module
Hi, I tried enabling the module support and boot the emulator using that kernel but still getting the same error when insmod a module from the terminal in emulator. I also changing the Make file as specified and make the program but get a long list of errors like undeclared identifier and cannnot find header files and others. If there anything else I must do, like only need to enable module support or must enable any other options too? Thanks in Advance, Perumal On Oct 29, 1:23 pm, Chew Esmero chew.esm...@gmail.com wrote: Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
Only Enable loadable module support. I think you really need to build your driver with KERNEL_DIR pointing to your goldfish kernel directory and using the cross-compiler provided with Android source. If not, your driver will be built using your host's kernel headers. The output module is not recognizable in Android kernel. On Oct 29, 3:33 pm, perumal316 perumal...@gmail.com wrote: Hi, I tried enabling the module support and boot the emulator using that kernel but still getting the same error when insmod a module from the terminal in emulator. I also changing the Make file as specified and make the program but get a long list of errors like undeclared identifier and cannnot find header files and others. If there anything else I must do, like only need to enable module support or must enable any other options too? Thanks in Advance, Perumal On Oct 29, 1:23 pm, Chew Esmero chew.esm...@gmail.com wrote: Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
By the way, I'm using SDK 1.5 and android-goldfish-2.6.27. I also tested android-goldfish-2.6.29 and still ok. Haven't tried the with 1.6 but I think it's still applicable. On Oct 29, 4:16 pm, Chew Esmero chew.esm...@gmail.com wrote: Only Enable loadable module support. I think you really need to build your driver with KERNEL_DIR pointing to your goldfish kernel directory and using the cross-compiler provided with Android source. If not, your driver will be built using your host's kernel headers. The output module is not recognizable in Android kernel. On Oct 29, 3:33 pm, perumal316 perumal...@gmail.com wrote: Hi, I tried enabling the module support and boot the emulator using that kernel but still getting the same error when insmod a module from the terminal in emulator. I also changing the Make file as specified and make the program but get a long list of errors like undeclared identifier and cannnot find header files and others. If there anything else I must do, like only need to enable module support or must enable any other options too? Thanks in Advance, Perumal On Oct 29, 1:23 pm, Chew Esmero chew.esm...@gmail.com wrote: Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
Hi Perumal, I'm confused when you say that it's already working in shell but not in emulator. Working in shell meaning you insmod the hello.ko to your host? If so, then the module was not properly built. If module is properly built against the goldfish kernel, output module would be for ARM architecture therefore you cant insmod it to your host (assuming your host is x86). Only in emulator since emulator is an emulated ARM architecture. On Oct 30, 11:35 am, perumal316 perumal...@gmail.com wrote: Hi, I also faced similar problem, your MakeFile may need changes, below is the makefile i used: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /goldfish/kernel PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m := hello.o endif Or you can also try the one mentioned by Mr Chew above. Also as mentioned by him above set the path to your CROSS_COMPILE directory before make. Regards, Perumal On Oct 30, 10:57 am, Eduardo Acker izayahighfat...@gmail.com wrote: Hi Chew, I'm a newbie in linux/android and Im having some problems to compile the my module. i dowloaded the android-goldfish-2.6.29 snapshot and the android plataform. Compiled the kernel with your instructions to ARCH and CROSS_COMPILE and have no problem, but when i try to compile the module it givesthe error: - entering directory /home/acker/goldfish/kernel - no rule to process the target modules any idea of what i did wrong? thanks for the help, Eduardo Acker 2009/10/29 Chew Esmero chew.esm...@gmail.com Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
No problem. Happy coding. =) On Oct 30, 12:45 pm, Chew Esmero chew.esm...@gmail.com wrote: Oh, sorry. Didn't get it right. Terminal emulator in Android has no root privileges unfortunately. May I ask why would you do it in terminal emulator when you can do it in adb (already root)? On Oct 30, 12:30 pm, perumal316 perumal...@gmail.com wrote: Hi Mr Chew, I have built the module against the goldfish kernel. Then I start the emulator then in a terminal (adb shell) then insmod it and it is working. But within the emulator there is a terminal emulator. If I insmod there the module is not loaded (Operation Not Permitted). Since it is working in the shell, it should also work within the terminal emulator but not sure why it is not working. Is there any way to verify I have root access in terminal emulator? Regards, Perumal On Oct 30, 12:10 pm, Chew Esmero chew.esm...@gmail.com wrote: Hi Perumal, I'm confused when you say that it's already working in shell but not in emulator. Working in shell meaning you insmod the hello.ko to your host? If so, then the module was not properly built. If module is properly built against the goldfish kernel, output module would be for ARM architecture therefore you cant insmod it to your host (assuming your host is x86). Only in emulator since emulator is an emulated ARM architecture. On Oct 30, 11:35 am, perumal316 perumal...@gmail.com wrote: Hi, I also faced similar problem, your MakeFile may need changes, below is the makefile i used: ifeq ($(KERNELRELEASE),) KERNELDIR ?= /goldfish/kernel PWD := $(shell pwd) .PHONY: build clean build: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c else $(info Building with KERNELRELEASE = ${KERNELRELEASE}) obj-m := hello.o endif Or you can also try the one mentioned by Mr Chew above. Also as mentioned by him above set the path to your CROSS_COMPILE directory before make. Regards, Perumal On Oct 30, 10:57 am, Eduardo Acker izayahighfat...@gmail.com wrote: Hi Chew, I'm a newbie in linux/android and Im having some problems to compile the my module. i dowloaded the android-goldfish-2.6.29 snapshot and the android plataform. Compiled the kernel with your instructions to ARCH and CROSS_COMPILE and have no problem, but when i try to compile the module it givesthe error: - entering directory /home/acker/goldfish/kernel - no rule to process the target modules any idea of what i did wrong? thanks for the help, Eduardo Acker 2009/10/29 Chew Esmero chew.esm...@gmail.com Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote:
[android-kernel] Re: Loadable Kernel Module
Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
Yes, it is possible. Exec Format Error: it seems that your module is not built using the headers of your goldfish kernel. Try this simple makefile when building your new driver (assuming hello.c as source): obj-m := hello.o CROSS_COMPILE=arm-eabi- KERNEL_DIR ?= ~/goldfish/kernel/ all: $(MAKE) -C $(KERNEL_DIR) M=`pwd` ARCH=arm CROSS_COMPILE=$ (CROSS_COMPILE) modules clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers Module.markers You need to take note that you need to export first CROSS_COMPILE variable to your current shell. (i.e. #export CROSS_COMPILE=~/your- android-dir/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1/bin) Then you issue the command #make. I think this will resolve the Exec Format Error problem. As for the 'operation not permitted' problem in #insmod, it seems that the Loadable Module Support in your goldfish's kernel config is still not enabled. You can try this: goldfish-kernel# ARCH=arm make goldfish_defconfig goldfish-kernel# ARCH=arm make menuconfig [*] Enable loadable module support --- (make sure to have this one) goldfish-kernel# ARCH=arm ARCH=arm CROSS_COMPILE=arm-eabi- make Your final kernel will be arch/arm/boot/zImage. After booting emulator using that kernel, you can now do your #insmod in emulator shell. Hope that helps. On Oct 29, 1:01 pm, perumal316 perumal...@gmail.com wrote: Thanks,Yes, now it can be loaded when the emulator is booted with the new kernel. But must I always build the module against my new kernel and boot with the new kernel to load a new module? Is it possible to insmod module, similar like in Linux to load a module? I have tried in emulator's terminal and in shell but keep on getting the init module failed, Exec Format Error or init module failed,operation not permitted error messages. Regards, Perumal On Oct 20, 9:06 pm, Chew Esmero chew.esm...@gmail.com wrote: Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---
[android-kernel] Re: Loadable Kernel Module
Did you build the module against your new kernel? (i.e. ARCH=arm KERNEL_DIR=android-root-dir/kernel make). I've encountered that error message before and it seems that the booted kernel still do not allow Enable Loadable Module .config support. Are you sure emulator is booted with the new kernel? (i.e. emulator -kernel new-kernel - show-kernel -avd name-of-avd) --~--~-~--~~~---~--~~ unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel -~--~~~~--~~--~--~---