欢迎来到天天文库
浏览记录
ID:39465418
大小:54.00 KB
页数:9页
时间:2019-07-04
《linux下led小灯的驱动》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、我第一个字符设备驱动程序的痛苦经历2009-12-2621:07写驱动程序是个痛苦成长的过程。。。对驱动的编译,先要有支持的内核源码树,所以先得编译内核。由于过了两天才来整理,写的东西有点杂乱了。1.按照那个入门设备驱动程序,来编译的时候老是错误,网络上有个参考的(blog.csdn.net/sabalol/archive/2008/02/01/2076610.aspx),但是他有一个严重的错误:编译linux源码的路径不对。他的错误如下:[liu@liu-desktophellomod]#makeoldconfig[liu@liu-desktophellomod]#m
2、akeprepare应该是:[root@liu-desktoplinux26]#makeoldconfig[root@liu-desktoplinux26]#makeprepare2.我下了linux内核后,直接make出现如下错误:[root@localhostmy_drivers]#makemake-C/home/xinghun/linux-2.6.30.4M=/home/xinghun/my_driversmodulesmake[1]:Enteringdirectory`/home/xinghun/linux-2.6.30.4'ERROR:Kernelconfig
3、urationisinvalid. include/linux/autoconf.horinclude/config/auto.confaremissing. Run'makeoldconfig&&makeprepare'onkernelsrctofixit.make[1]:***[include/config/auto.conf]Error1make[1]:Leavingdirectory`/home/xinghun/linux-2.6.30.4'make:***[default]Error2解决办法:红色部分(在linux内核目录下执行红
4、色部分代码)[root@localhostlinux-2.6.30.4]#makepreparescripts/kconfig/conf-sarch/arm/KconfigCHK include/linux/version.hUPD include/linux/version.hGeneratinginclude/asm-arm/mach-types.hCHK include/linux/utsrelease.hUPD include/linux/utsrelease.hSYMLINKinclude/asm->include/asm-armCC
5、 kernel/bounds.sGEN include/linux/bounds.hCC arch/arm/kernel/asm-offsets.sGEN include/asm/asm-offsets.hCALL scripts/checksyscalls.sh:1097:2:warning:#warningsyscallfadvise64notimplemented:1265:2:warning:#warningsyscallmigrate_pagesnotimplemented:1321:2:
6、warning:#warningsyscallpselect6notimplemented:1325:2:warning:#warningsyscallppollnotimplemented:1365:2:warning:#warningsyscallepoll_pwaitnotimplemented[root@localhostlinux-2.6.30.4]#看见几个warning很不爽,解决办法:make下内核就不会出现了。3.出现MODPOST1modules/bin/sh:scripts/mod/modpost:notfound错误的
7、解决办法:[root@localhostlinux-2.6.30.4]#makescriptsCC scripts/mod/empty.oHOSTCCscripts/mod/mk_elfconfigMKELF scripts/mod/elfconfig.hHOSTCCscripts/mod/file2alias.oHOSTCCscripts/mod/modpost.oHOSTCCscripts/mod/sumversion.oHOSTLDscripts/mod/modpostHOSTCCscripts/kallsymsHOSTC
此文档下载收益归作者所有