Re: [android-kernel] Re: kernel modules "hello world " in samsung n8000

1.262 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Bridgette

ungelesen,
18.04.2013, 21:37:0818.04.13
an android...@googlegroups.com
may be the vermagic...if you do a 'modinfo kernelModule.ko' it will list what the vermagic is and it should match your kernel version on your phone, adb shell cat /proc/version

If the vermagic does not match, try setting the EXTRAVERSION in the /path/to/kernel/Makefile to match the kernel version and rebuild.

This is an example of what to look for and set in the Makefile:
VERSION=3
PATCHLEVEL=0
SUBLEVEL=15
EXTRAVERSION=-962322


- bridgette


From: "arun...@iiitd.ac.in" <arun...@iiitd.ac.in>
To: android...@googlegroups.com
Sent: Thursday, April 18, 2013 4:38 AM
Subject: [android-kernel] Re: kernel modules "hello world " in samsung n8000

Hi,

I am also facing exactly similar problem while Kernel Module Development with HTC Explorer Device.

Can you please tell as to whether you have found a solution to this problem.

Any help will be deeply appreciated.

Thanks and Regards,
Arun Kumar Jindal

On Tuesday, April 9, 2013 8:50:51 AM UTC+5:30, Fazhang Liu wrote:
my device is samsung n8000   

android version : 4.0.4

kernel version : 3.0.15-962322



i want to make a "hello world " kernel module .   

git clone https://android.googlesource. com/kernel/samsung.git   to get source code . and make it .


hello world code

#include <linux/module.h>	/* Needed by all modules */
#include <linux/kernel.h>	/* Needed for KERN_INFO */

int init_module(void)
{
	printk(KERN_INFO "Hello world 1.\n");

	/* 
	 * A non 0 return means init_module failed; module can't be loaded. 
	 */
	return 0;
}

void cleanup_module(void)
{
	printk(KERN_INFO "Goodbye world 1.\n");
}


make

obj-m += hello-1.o

all:
	make -C /opt/kernel/samsung M=$(PWD) modules

clean:
	make -C /opt/kernel/samsung M=$(PWD) clean

ARCH=arm CROSS_COMPILE=/opt/prebuilt/ linux-x86/toolchain/arm-eabi- 4.4.3/bin/arm-eabi- make

and make success   .  

but when i push ko to device 

su 

insmod  hello.ko 

insmod: init_module 'hello.ko ' failed (Exec format error)


what's wrong with that ? 


--
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-kerne...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Si Dao

ungelesen,
12.09.2013, 00:06:3012.09.13
an android...@googlegroups.com
Pls execute bellow command in your target device(same env. as where you execute 'insmod'):
$ readelf -h hello.ko
$ uname -a

and paste logfile here.

On Sunday, April 21, 2013 2:39:41 AM UTC+7, Shuang Liang wrote:
Have you enabled the LKM in kernel configs?


On Monday, April 8, 2013 11:20:51 PM UTC-4, Fazhang Liu wrote:
my device is samsung n8000   

android version : 4.0.4

kernel version : 3.0.15-962322



i want to make a "hello world " kernel module .   

git clone https://android.googlesource.com/kernel/samsung.git   to get source code . and make it .


hello world code

#include <linux/module.h>	/* Needed by all modules */
#include <linux/kernel.h>	/* Needed for KERN_INFO */

int init_module(void)
{
	printk(KERN_INFO "Hello world 1.\n");

	/* 
	 * A non 0 return means init_module failed; module can't be loaded. 
	 */
	return 0;
}

void cleanup_module(void)
{
	printk(KERN_INFO "Goodbye world 1.\n");
}


make

obj-m += hello-1.o

all:
	make -C /opt/kernel/samsung M=$(PWD) modules

clean:
	make -C /opt/kernel/samsung M=$(PWD) clean

ARCH=arm CROSS_COMPILE=/opt/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make

Boyan Vladinov

ungelesen,
12.09.2013, 10:07:1412.09.13
an android...@googlegroups.com

Boyan Vladinov

ungelesen,
12.09.2013, 10:25:3312.09.13
an android...@googlegroups.com
Also use this example: http://www.faqs.org/docs/kernel/hello2.html with the proper module macroses
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten