该程序顺利在tq2440上运行
///helloworld.c/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world %d \n", 250);
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world \n");
}
module_init(hello_init);
module_exit(hello_exit);
///Makefile/
ifneq ($(KERNELRELEASE),)
obj-m := helloworld.o
else
KERNELDIR := /opt/EmbedSky/linux-2.6.30.4
PWD := $(shell pwd)
all:
make -C $(KERNELDIR) M=$(PWD) modules ARCH=arm CROSS_COMPILE=arm-linux-
clean:
rm -f *.ko *.o *.mod.o *.mod.c *.symvers modul*
dst:
cp helloworld.ko /opt/EmbedSky/mnt_tq2440/
endif