摘要
为方便开发基于LINUX操作系统的GPIB仪器,近几年,Linux内核也集成了专用在测试测量领域里的GPIB总线驱动,但直接拿来利用发现,在向仪器发命令的频率比较高时,此驱动传输性能不是很理想,偶尔还会出现驱动挂掉,造成LINUX内核崩溃;针对以上问题,给出了在LINUX架构下GPIB驱动优化设计方案;分析了LINUX字符设备驱动模型;在中断服务程序底半部里,引入了结合睡眠机制的非原子操作工作队列,提高了驱动运行效率;提出了利用FIFO半满而非传统的全满标志位作为数据传输判断标准,提升了数据传输速率,引入了读写操作互斥的信号量,消除了由于读写竞态引起的驱动异常;对优化后的GPIB驱动进行测试,结果表明,上述问题得到了一定的改善。
In order to facilitate the development of GPIB instruments based on LINUX operating system,in recent years,the LINUX kernel has also integrated a GPIB bus driver specially used in the field of testing and measurement.However,after being directly used,it is found that the transmission performance of this driver is not very ideal when sending commands to instruments with relatively high frequency,occasionally there will be drive hanging off,to cause kernel crash.In view of the above problems,the GPIB-driven optimization design scheme under the LINUX architecture is given.The LINUX character device driver model is analyzed;In the bottom half of the interrupt service program,a non-atomic operating work queue combined is introduced to improve the driving operation efficiency;The use of FIFO half full instead of the traditional full flag bit as the data transmission standard is proposed to improve the data transfer rate;Introducing mutually exclusive signal for read and write operations,eliminating drive-running anomalies caused by read and write race;Tests on the optimized GPIB driver,result shows that the above problem have been improved to some extent.
作者
赵昕
郭恩全
李小杰
Zhao Xin;Guo Enquan;Li Xiaojie(Shanxi HitechElectronic limited liability Company,Xi an 710075,China;Xi an Precision Machinery Research Institute,Xi an 710075,China)
出处
《计算机测量与控制》
2020年第3期163-167,共5页
Computer Measurement &Control