raspberry pi driver development

来源:互联网 发布:大连理工大学网络期刊 编辑:程序博客网 时间:2024/06/05 15:50

1.makefile

ifneq ($(KERNELRELEASE),)obj-m := hello.oelseKDIR := /home/hcx/work/boards/RPi/kernel/linux-rpi-3.6.yall:make -C $(KDIR) M=$(PWD) modules ARCH=arm CROSS_COMPILE=/home/hcx/work/boards/RPi/kernel/RpiTools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-clean:rm -f *.ko *.o *.mod.o *.mod.c *.symvers  modul*endif

//----------------------------------------------------------------------
注意:Makefile 第一个字母必须大写

2.scp命令格式
scp /home/rob/pictures/donuts/half-eaten.jpg [user name]@[server ip]:/home/mywebsite.com/public_html/images/
scp [user name]@[server ip]:/home/mywebsite.com/public_html/images/mylogo.png /home/pictures/


3.加载驱动:执行insmod ./hello.ko屏幕上没反应。(因为我是在WINDOWS上用远程终端连上去的嘛)OK,先让时光倒流,回到加载驱动以前,先另开一个窗口,执行:tail -f /var/log/message然后在原来的窗口里执行:insmod ./hello.ko哈哈,/var/log/message文件里面看见了盼望已久的hello world!


4.查看驱动:lsmod 看见 hello这个驱动在其中

5.卸载驱动:rmmod hello 看见/var/log/message里显示了goodbye



0 0
原创粉丝点击