|
2010-08-29
, 16:00
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#2
|
The Following 2 Users Say Thank You to MohammadAG For This Useful Post: | ||
|
2010-08-30
, 13:58
|
Posts: 58 |
Thanked: 8 times |
Joined on Aug 2010
|
#3
|
I want to test a 'hello' module program (see below) in N900. I make it work in Ubuntu X86. But when I do the same thing in scratchbox
(sbox-FREMANTLE_ARMEL), the compilation result seems wrong.
I run command:
[sbox-FREMANTLE_ARMEL: ~/MyDocs/LinuxDriver] > fakeroot make -C ../linux-headers-2.6.32-23-generic/ M=$(pwd) modules
But the result:
make: Entering directory `/home/maemo/MyDocs/linux-headers-2.6.32-23-generic'
make: *** No rule to make target `modules'. Stop.
make: Leaving directory `/home/maemo/MyDocs/linux-headers-2.6.32-23-generic'
Note:
(1) I copy all the header files to the directory '/home/maemo/MyDocs/linux-headers-2.6.32-23-generic' already.
(2) I put 'hello.c' and 'Makefile' below into scratchbox directory '~/MyDocs/LinuxDriver'
Can anyone tell me what's wrong with it?
Thanks!
hello.c
==========================================
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/init.h>
MODULE_LICENSE("GPL");
int text_init(void){
printk("<0>Hello World!");
return 0;
}
void text_cleanup(void){
printk("<0>Goodbye World!");
}
module_init(text_init);
module_exit(text_cleanup);
==========================================
Makefile
==========================================
obj-m := hello.o
==========================================
Last edited by justforfun; 2010-08-29 at 15:13.