arm中驱动模块加载并由应用程序调用
Makefile文件如下: # To build modules outside of the kernel tree, we run "make" 执行顺序: 1.编译驱动模块程序和应用程序,分别生成dev_test1.ko和data_deal1,并用串口烧到开发板 2.加载模块:insmod dev_test1 3.创建设备结点,mknod /dev/dev_test1 c 253 0 4.执行应用程序:./data_deal1(可能需要修改权限) 串口烧写方式简介: 1.启动开发板,进入开发板系统,按ctrl+a并释放,再按z键 2.出现很多选项,选s--传输文件 3.enter键选zmoden 4.按向右方向键,选中[转到],按enter键 5.打入所要传输文件在你主机上的绝对路径,按enter键 6.选中要传输文件,按enter键
# in the kernel source tree; the Makefile these then includes this
# Makefile once again.
# This conditional selects whether we are being included from the
# kernel Makefile or not.
ifeq ($(KERNELRELEASE),)
# Assume the source tree is where the running kernel was built
# You should set KERNELDIR in the environment if its elsewhere
# KERNELDIR ?= /lib/modules/$(shell uname -r)/build
KERNELDIR = /home/wangwei/utu-linux_for_s3c2440_V1.5.3
# KERNELDIR=$(KDIR)
#
# The current directory is passed to sub-makes as argument
PWD := $(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
else
# called from kernel build system: just declare what our modules are
obj-m := dev_test1.o
endif
arm驱动模块程序调 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)