Linux 2.6.23将使用用户空间驱动程序API

稳定版驱动API由Greg Kroah-Hartman宣布一年后,现已整合到核心树中。该API旨在简化驱动程序开发者的工作,允许大部分驱动程序在用户空间编写,仅一小部分留在内核。此外,使用此API编写的驱动程序即使在内核更改后也可继续使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The stable driver API was already announced a year ago by Greg Kroah-Hartman. Now the last patches where uploaded and the API was included in Linus’ tree. The idea of the API is to make life easier for driver developers:

This interface allows the ability to write the majority of a driver in userspace with only a very small shell of a driver in the kernel itself. It uses a char device and sysfs to interact with a userspace process to process interrupts and control memory accesses.

Since future drivers using this API will run mainly in userspace there is no need to open up the source code for these parts. Also, drivers can be re-used even after kernel changes because the API will remain stable.

The background motivation for the inclusion of such a stable API comes form the embedded world: there embedded drivers are often closed source and just developed for a single kernel version and are not maintained over time. Using the new API these drivers could be used for a longer time.
And in fact such an API has already been developed by people from the embedded industry to make their life easier. But it was just developed for a single device and not as a generic interface. Such developments are now unnecessary.

However, DMA transfer between userspace and kernelspace is not yet implemented. This means essentially that drivers which involve high traffic are not an option yet. So graphic drivers as well as file system drivers and similar cannot use this API at the moment.

Some people might ask now why not simply allow closed source kernel drivers directly in the kernel, since they are allowed in userspace now anyway. But there is a huge difference between these two types of drivers - while userspace drivers can be controlled in a certain way and cannot trash the kernel kernelspace drivers could do that. A quite good explanation about the topic can be read at LWN.
The other way around one could ask if this will mean the end for Linux (for example according to the LWN article). But again, kernelspace and userspace is very different - an d with the new API the important part (the kernelaspace part) still has to be Open Source! Besides, this API does not introduce anything which was not possible before: as already mentioned such an API was already developed quite some time ago, and was actively used.

But I must also admit that while I see the need for such an API I still prefer hardware vendors who simply make the drivers Open Source and bring them upstream.

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值