Ubuntu Bluetooth Driver 调试
Ubuntu Bluetooth Driver 调试
kernel源码:Linux-3.2.16
升级Linux-3.2.16源码(参照:Linux-3.2.6内核升级)。bluetooth驱动模块代码位于linux-3.2.16/net/bluetooth目录下。打开该目录下的Makefile文件,如下:
- #
- # Makefile for the Linux Bluetooth subsystem.
- #
- obj-$(CONFIG_BT) += bluetooth.o
- obj-$(CONFIG_BT_RFCOMM) += rfcomm/
- obj-$(CONFIG_BT_BNEP) += bnep/
- obj-$(CONFIG_BT_CMTP) += cmtp/
- obj-$(CONFIG_BT_HIDP) += hidp/
- bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o hci_sock.o hci_sysfs.o lib.o
- bluetooth-$(CONFIG_BT_L2CAP) += l2cap_core.o l2cap_sock.o smp.o
- bluetooth-$(CONFIG_BT_SCO) += sco.o
编译完kernel安装后,在系统/lib/modules/`uname -r`/kernel/net/bluetooth下会安装这些.ko,这里修改了以上跟bluetooth.ko有关的源文件(比如加些打印)后,直接insmod进内核,然后用dmesg打印信息,当bluetooth.ko运行到打印部分时,打印的信息就会用dmesg打出来。
驱动卸载过程:
1.关闭bluetooth应用
2.sudo rmmod rfcomm
3.sudo rmmod btusb
4.sudo rmmod bnep
5.sudo rmmod bluetooth
驱动装载过程:
1.sudo insmod bluetooth.ko
2.开启bluetooth应用
然后就能调试驱动部分了。
更多Ubuntu相关信息见Ubuntu 专题页面 http://www.bkjia.com/topicnews.aspx?tid=2
评论暂时关闭