C#驱动程序的开发? [英] C# driver development?

查看:701
本文介绍了C#驱动程序的开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我跳扎进C#...

Before I jump headlong into C#...

我一直认为,C,或者C ++,最好是在Windows上开发的驱动程序。我并不热衷于.NET机器上开发驱动程序的想法。

I've always felt that C, or maybe C++, was best for developing drivers on Windows. I'm not keen on the idea of developing a driver on a .NET machine.

不过,.NET似乎是MS是为应用程序开发标题的方式,所以我现在想知道:

But .NET seems to be the way MS is heading for applications development, and so I'm now wondering:


  • 的人都在用C#开发的驱动程序?

  • 请你必须做大量的API挂钩,还是C#与内核接口的设施没有大量的两轮牛车的?

  • 任何人都可以到可靠性和运行C#程序更接近环0比通常会出现这种情况安全说话?

我希望我的设备是在C#中使用,如果在C#中的驱动程序开发是成熟这显然是要走的路,但我不想花大量的精力那里,如果不推荐它。

I want my devices to be usable in C#, and if driver dev in C# is mature that's obviously the way to go, but I don't want to spend a lot of effort there if it's not recommended.


  • 有什么好的资源,开始,比方说,开​​发一个简单的虚拟串口驱动程序?

推荐答案

您无法在C#内核模式设备驱动程序运行时不能安全地加载到ring0的,并如预期运行。

You can not make kernel-mode device drivers in C# as the runtime can't be safely loaded into ring0 and operate as expected.

此外,C#不创建适合装载设备驱动程序,特别是对于驾驶者需要公开的切入点二进制文件。在运行时的依赖跳和分析和JIT加载过程中的二进制禁止直接访问驱动程序子系统需要加载二进制文件。

Additionally, C# doesn't create binaries suitable for loading as device drivers, particularly regarding entry points that drivers need to expose. The dependency on the runtime to jump in and analyze and JIT the binary during loading prohibits the direct access the driver subsystem needs to load the binary.

有就是工作正在进行中,但是,解除某些设备驱动程序进入用户模式,你可以看到一个采访的这里与UDMF的彼得·维兰德(用户模式驱动程序框架)团队。

There is work underway, however, to lift some device drivers into user mode, you can see an interview here with Peter Wieland of the UDMF (User Mode Driver Framework) team.

用户模式驱动程序会更适合于管理工作,但你得google了一下,以找出是否C#和.NET将直接支持。我所知道的是,内核级驱动程序不是只在C#中是可行的。

User-mode drivers would be much more suited for managed work, but you'll have to google a bit to find out if C# and .NET will be directly supported. All I know is that kernel level drivers are not doable in only C#.

您可以,但是,很可能使C / C ++的驱动程序,和C#的服务(或类似),并有司机聊到托管code,如果你非得写了很多code的在C#。

You can, however, probably make a C/C++ driver, and a C# service (or similar) and have the driver talk to the managed code, if you absolutely have to write a lot of code in C#.

这篇关于C#驱动程序的开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆