作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2021, Vol. 47 ›› Issue (4): 166-172. doi: 10.19678/j.issn.1000-3428.0058572

• 体系结构与软件技术 • 上一篇    下一篇

基于Linux的PXIe可重构仪器设备驱动程序开发

王法臻, 崔少辉, 王成   

  1. 陆军工程大学石家庄校区, 石家庄 050003
  • 收稿日期:2020-06-08 修回日期:2020-07-23 发布日期:2020-06-30
  • 作者简介:王法臻(1992-),男,硕士研究生,主研方向为装备测试技术;崔少辉,教授、博士;王成,讲师、博士。
  • 基金资助:
    国家自然科学基金(61501493)。

Device Driver Development for PXIe Reconfigurable Instrument Based on Linux

WANG Fazhen, CUI Shaohui, WANG Cheng   

  1. Shijiazhuang Campus of Army Engineering University, Shijiazhuang 050003, China
  • Received:2020-06-08 Revised:2020-07-23 Published:2020-06-30

摘要: PXIe可重构仪器具备多通道并行测试能力,可用于解决共享资源测试系统中的测试资源竞争和死锁等问题。为确保PXIe可重构仪器在国产操作系统下正常运行,在Deepin操作系统下开发PXIe设备驱动程序,实现上位机与仪器设备之间的通信。介绍Linux字符设备驱动程序,基于该驱动类型结构设计PXIe设备驱动的开发流程。在此基础上,通过共享内存映射提高应用程序与驱动程序的数据交互效率,并基于阻塞和中断机制进行直接存储器存取传输。通过Qt Creator设计的图形界面测试程序对驱动程序的运行情况进行检验,测试结果表明,该设备驱动程序运行稳定,数据传输准确可靠,可满足PXIe可重构仪器的通信需求。

关键词: Linux系统, 驱动程序, PXIe可重构仪器, 共享内存映射, 直接存储器存取, 中断, Deepin操作系统

Abstract: The PXIe reconfigurable instrument has the ability of multi-channel parallel test, which provides a good solution to the problems of test resource competition and deadlock in the shared-resource test system. In order to realize the smooth operation of the PXIe reconfigurable instrument under the domestic operating system, PXIe device driver is developed under the Deepin operating system to solve the communication problem between the upper computer and the instrument device. Linux character device driver is introduced and the development process of PXIe device driver is designed based on the Linux character device driver structure. On this basis, the shared-memory mapping is used to improve the efficiency of data interactions between application program and driver, and Direct Memory Access(DMA) transmission is implemented based on the block and interrupt mechanism. Qt Creator is used to design the graphic interface test program to verify the working condition of the driver, and the test results show that the device driver runs stably and the data transmission is accurate and reliable, which meets the communication requirements of PXIe reconfigurable instrument.

Key words: Linux system, driver, PXIe reconfigurable instrument, shared-memory mapping, Direct Memory Access(DMA), interrupt, Deepin operating system

中图分类号: