UIO(Userspace I/O)是运行在用户空间的I/O技术。在Linux系统中,一般的设备驱动都是运行在内核空间,而在用户空间使用应用程序调用即可。而UIO则是将设备驱动的很少一部分运行在内核空间,而在用户空间实现驱动的绝大多数功能。那么,在内核空间UIO要做的事情就变得很简单,分为两种:
-
分配和记录设备需要的资源和注册UIO设备
-
实现必须在内核空间实现的中断处理函数
为了对UIO有一个直观的认识,先上个图:
了解了UIO 驱动在Linux系统中的位置后,让我们对参考资料(Linux User Space Device Drivers)的部分内容做一个中英文对照翻译以加深对UIO的理解。
1. Device Driver Architectures | 设备驱动架构
-
Linux device drivers are typically designed as kernel drivers running in kernel space 典型的Linux设备驱动都是被设计为运行在内核空间的内核驱动
-
User space I/O is another alternative device driver architecture that has been supported by the Linux kernel since 2.6.24 从Linux内核版本2.6.24开始,就支持另一种可作为内核设备驱动的替代方案的设备驱动架构,也就是用户空间I/O
-
People in the Linux kernel community may not always agree on the need to have user space I/O 在Linux内核社区的人们不总是赞成使用用户空间I/O
-
Industrial I/O cards have been taking advantage of user space I/O for quite some time 在工业中使用的I/O卡利用用户空间I/O的优点已经有一阵子了
-
For some types of devices, creating a Linux kernel driver may be overkill 对某些类型的设备来说,创建对应的Linux内核驱动很可能代价太高
-
Soft IP for FPGAs can have unique requirements that don't always fit the mold FPGA的软IP有独特的需求