请各位大侠路过看看:
我的板子是tiny6410,系统自带的ADC是通过调试电阻AIN0)来测试,现在我改换一下,用其他路来采集信号。比如AIN1,AIN2等,我准备更改36内核附带的ADC驱动,我首先在虚拟机的红帽里面用友善的arm-linux-gcc4.5.1把友善的ADC驱动程序(修改到其他通道)进行编译,如果没有报错,我就把它编译到36内核里面,或者加载这个模块,当然的吧之前自带的卸载掉,之后在移植到板子上。
至于驱动的修改我是这样想的:
先把友善的AD驱动修改一个通道试一下,如果行,在吧自己改的结合网上的一些ADC驱动按照之前搞的,把它搞到板子上去。
现在遇到的问题是:用arm-linux-gcc编译时出现mini_6410adc.c:fatal error:linux/module.h:no such file or directory compilation terminated.
希望有搞过采集的或者熟悉本过程的给一些建议,
再次先谢过啦!


zl870213 于 2011-08-10 11:16:24发表:
这个adc_zl_1.ko是我在用和板子一样的内核2.6.38在pc机上编译的adc_zl_1.ko文件。其中只是把友善的ADC驱动稍加修改(通道换了一下),的说明的是友善板子的系统里面有个adc。劳驾请各位帮我看看。] (unwind_backtrace+0x0/0xe4) from [] (warn_slowpath_common
] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_f
] (warn_slowpath_fmt+0x2c/0x3c) from [] (sysfs_add_one+0x80
] (sysfs_add_one+0x80/0xa8) from [] (create_dir+0x5c/0xac)
] (create_dir+0x5c/0xac) from [] (sysfs_create_dir+0xb8/0xe
] (sysfs_create_dir+0xb8/0xe0) from [] (kobject_add_interna
] (kobject_add_internal+0xd0/0x1e8) from [] (kobject_add+0x
] (kobject_add+0x68/0x8c) from [] (device_add+0xa0/0x508)
] (device_add+0xa0/0x508) from [] (device_create_vargs+0x84
] (device_create_vargs+0x84/0xcc) from [] (device_create+0x
] (device_create+0x1c/0x24) from [] (misc_register+0xbc/0x1
] (misc_register+0xbc/0x128) from [] (dev_init+0xa4/0xd8 [a
] (dev_init+0xa4/0xd8 [adc_zl_1]) from [] (do_one_initcall+
] (do_one_initcall+0xbc/0x190) from [] (sys_init_module+0x1
] (sys_init_module+0x158c/0x1754) from [] (ret_fast_syscall
] (unwind_backtrace+0x0/0xe4) from [] (kobject_add_internal
] (kobject_add_internal+0x1bc/0x1e8) from [] (kobject_add+0
] (kobject_add+0x68/0x8c) from [] (device_add+0xa0/0x508)
] (device_add+0xa0/0x508) from [] (device_create_vargs+0x84
] (device_create_vargs+0x84/0xcc) from [] (device_create+0x
] (device_create+0x1c/0x24) from [] (misc_register+0xbc/0x1
] (misc_register+0xbc/0x128) from [] (dev_init+0xa4/0xd8 [a
] (dev_init+0xa4/0xd8 [adc_zl_1]) from [] (do_one_initcall+
] (do_one_initcall+0xbc/0x190) from [] (sys_init_module+0x1
] (sys_init_module+0x158c/0x1754) from [] (ret_fast_syscall
[root@FriendlyARM 2.6.38-FriendlyARM]# modprobe adc_zl_1
modprobe: module 'adc_zl_1' not found
[root@FriendlyARM 2.6.38-FriendlyARM]# insmod adc_zl_1.ko
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0x80/0xa8()//我觉得这三行是错误关键但不明白sysfs: cannot create duplicate filename '/devices/virtual/misc/adc'
Modules linked in: adc_zl_1(+)
[
+0x4c/0x64)
[
mt+0x2c/0x3c)
[
/0xa8)
[
[
0)
one_wire_status: 2
[
l+0xd0/0x1e8)
[
68/0x8c)
one_wire_status: 2
[
[
/0xcc)
[
1c/0x24)
one_wire_status: 2
[
28)
[
dc_zl_1])
one_wire_status: 2
[
0xbc/0x190)
[
58c/0x1754)
one_wire_status: 4
[
+0x0/0x30)
---[ end trace 3328e7f542e004dc ]---
kobject_add_internal failed for adc with -EEXIST, don't try to register things w
ith the same name in the same directory.
[
+0x1bc/0x1e8)
[
x68/0x8c)
one_wire_status: 5
[
[
/0xcc)
[
1c/0x24)
[
28)
[
dc_zl_1])
one_wire_status: 2
[
0xbc/0x190)
[
58c/0x1754)
[
+0x0/0x30)
one_wire_status: 2
adc initialized
insmod: can't insert 'adc_zl_1.ko': File exists
zl870213 于 2011-08-09 14:48:11发表:
我要在虚拟机中配置和板子内核一样的源代码树:我现在windows下吧这个 版本的.38解压出来,然后通过smb共享到虚拟机的/usr/src/下面,应为看见虚拟机得linux的内核也放在这,
然后在这么做呢?
目的是在利用这个和板子一样的内核编译新的ADC驱动模块生成.ko文件,然后拷贝到板子上在班上进行驱动模块的安装。
请哪位帮着吧详细的步骤列出来,刚学习这个,望赐教!
liusongguang 于 2011-08-09 12:28:27发表:
学习路过
alick 于 2011-08-09 10:55:30发表:
没有内核的头文件。
疑问:楼主的系统是 红帽哪个版本?是否安装了 kernel-headers 软件包?