手写板是有中断端点的USB设备,为了在Linux下实现此类设备的驱动,分析了USB设备的基本概念和Linux设备驱动原理,对Linux下设备驱动程序的内部机制和框架构成进行了研究。在此基础上,提出了引入信号量机制控制内核线程同步的方法来实现read函数,进而设计出Linux下有中断端点的USB设备的驱动程序。通过编写应用程序和设计对比实验,证明了此驱动可以准确、高效地读写设备。与针对中断端点普遍采用的输入子系统方式相比,简化了程序设计,提高了系统效率。
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 of driver for USB device,the internal mechanism and structure of driver in Linux for USB device are analyzed.The semaphore mechanism is introduced to realize the synchronization of kernel threads.And the driver in Linux for USB device with interrupt endpoints is designed.Both application program and comparable experiments de-monstrated the feasibility of the driver.Compared with the common methods of input subsystem with regarding to interrupt endpoints,the whole efficient process is simplified.