文档介绍:华中科技大学
硕士学位论文
Linux平台下PCI图像卡的驱动程序设计与研究
姓名:马洪伟
申请学位级别:硕士
专业:控制理论与控制工程
指导教师:盛翊智
20050401
摘要
随着计算机技术的迅猛发展越来越多的电子设备需要由计算机来进
行控制而几乎所有的 CPU 和外部设备都会提供 PCI 总线的接口 PCI 总
线已经是计算机系统中应用最为广泛最为通用的总线标准因此开发
PCI 设备的驱动程序显得尤为重要 Linux 因其免费的开放源代码以及稳
定的性能越来越受到广大用户所青睐同时基于 Linux 内核的嵌入式
操作系统应用势头强劲开发基于 Linux 的设备驱动程序具有很强的实
用性和通用性
本文以 DSP 视频采集处理卡的设计为背景研究了 PCI 总线传输控
制机制及其配置技术阐述了 Linux 下驱动程序的特点开发出了 PCI 设
备在 Linux 下的驱动程序在驱动程序的设计中充分考虑了操作的同步与
互斥有效地解决了资源的共享问题针对 DSP 图像卡传输图片实时性要
求较高的特点设计出共享内存的方案使得图像处理与数据传输同步进
行大大提高了数据传输的速率工业控制要求运行稳定遇到故障能够
及时恢复本文探讨在驱动程序中设置监控代码监控 DSP 卡运行状态
一旦发现异常便重新初始化 DSP 卡保证整个系统的健壮性
整个设计项目采用内核层 API 层应用层三级编程体系结构各层
编码相对独立编程思路清晰明了程序具有较强的通用性安全性和可
移植性如需对硬件设备升级只需修改软件的设备驱动程序而无需对
整个系统重新编译
本文的设计为通用的设备驱动程序提供了借鉴使嵌入式设备驱动程
序在不修改和少量修改驱动程序源代码的情况下可在不同操作系统实现
代码级兼容提高了类似项目的开发效率同时为驱动程序如何保持稳定
提供了自己的参考意见
关键词 PCI Linux DSP 驱动嵌入式设备, 视频采集处理卡
I
Abstract
With the rapid development puter technology, computer controls
more and more electronic devices. Almost all of the CPU and peripheral
equipments offer PCI bus interface, because that PCI bus has been the most
extensive and tne most universal bus standard puter system. Therefore,
the work is valuable on developing PCI device driver. Linux is popularly
applied for it's speciality of free and open codes. The application based on
Linux kernel in Embedded operater system is imperative for low cost. So, It's
applied and universal to develop the device drivers for Linux.
Video capture and ess card based on DSP is the background of the
thesis. After the PCI bus translation technique, control mechanism and
configration technique is studied, we expatiate the driver specialty in Linux.
Then, the PCI device drivers are developped respective for Linux. The operation
of synchronization and mutex are considered fully to settle the question of
resource share effectively. For the real time photo transmission of DSP video
card, the plan of shared memory is designed, so the photo can be processed with