1576 2010,31(7) 计算机工程与设计Computer Engineering and Design
・开发与应用・
Linux下有中断端点的USB设备驱动的实现
金鑫, 孙松林, 景晓军
(北京邮电大学,北京100876)
摘要:手写板是有中断端点的USB设备,为了在Linux下实现此类设备的驱动,分析了USB设备的基本概念和Linux设备
驱动原理,对Linux下设备驱动程序的内部机制和框架构成进行了研究。在此基础上,提出了 f入信号量机制控制内核线 程同步的方法来实现read函数,进而设计出Linux下有中断端点的USB设备的驱动程序。通过编写应用程序和设计对比实
验,证明了此驱动可以准确、高效地读写设备。与针对中断端点普遍采用的输入子系统方式相比,简化了程序设计,提高了 系统效率。 关键词:USB;设备驱动程序;中断端点;Linux;信号量 中图法分类号:TP3l1.11 文献标识码:A 文章编号:1000.7024(2010)07—1576—04
Implementation of USB device driver with interrupt endpoints in Linux
JIN Xin, SUN Song—lin, JING Xiao ̄un
(Beijing University of Posts and Telecommunications,Beijing 1 00876,China)
Abstract:To realize the communication between computer and handwriting board which iS a kind of device with interrupt endpoints.a
method to develop USB driver in Linux iS studied.Based on the principle ofdriver for USB device.the internal mechanism and structure ofdriver in Linux for USB device are analyzed.The semaphore mechanism iS introduced to realize the synchronization ofkernel threads. And the driver in Linux for USB device with interrupt endppints is designed.Both application program and comparable experiments de—