Question about C# appropriateness

  • Thread starter Thread starter Anthony P.
  • Start date Start date
A

Anthony P.

Hello Everyone,

I have a piece of hardware that does not have any drivers. So, I'm
considering taking the dive into driver development and writing my own
and I'm considering doing so in C#. I'm wondering, though, if C# is an
appropriate language for this task or do I really need C++?

Can anyone give me any advice?

Thank!
Anthony
 
Do you really want to have your drivers dependent upon
having the .NET framework installed?

--
Robbe Morris [Microsoft MVP - Visual C#]
AdvancedXL Server, Designer, and Data Analyzer
Convert cell ranges in Excel to rule driven web apps
without IT programmers.
Free download: http://www.equalssolved.com/default.aspx
 
Anthony said:
I have a piece of hardware that does not have any drivers. So, I'm
considering taking the dive into driver development and writing my own
and I'm considering doing so in C#. I'm wondering, though, if C# is an
appropriate language for this task or do I really need C++?
C# uses the .NET framework. The .NET framework, as it currently is, is
simply unusable in kernel mode, which is where device drivers reside. The
exception is the new user-mode driver framework (from Windows XP SP2
upwards), but even that would just mean a lot of P/Invoking in C#. C# would
make your job harder here, not easier.

For now, device driver development is still restricted to C/C++. It's an
advanced topic with a high learning curve if you're only used to user-mode
programs, so make sure you know what you're getting in to. Depending on the
kind of device, you may not have to write a driver, but just a program that
can communicate with the device over an existing bus (parallel port, USB,
serial, whatever). If your device has only one specialized function and
doesn't require microsecond-precision timing, having a program to control it
may be as good as having a general-purpose driver.
 
I'd like to thank everyone for the thoughtful replies and I now see
that C# just isn't where it would need to be to be able to do device
driver creation using the language. I suppose it's C++ then. Thanks
again!
 
I'd like to thank everyone for the thoughtful replies and I now see
that C# just isn't where it would need to be to be able to do device
driver creation using the language. I suppose it's C++ then. Thanks
again!

Well, C, or macro assembler is as usual a way to go...
//CY
 
Anthony said:
Hello Everyone,

I have a piece of hardware that does not have any drivers. So, I'm
considering taking the dive into driver development and writing my own
and I'm considering doing so in C#. I'm wondering, though, if C# is an
appropriate language for this task or do I really need C++?

Can anyone give me any advice?

Thank!
Anthony

Nonwithstanding the other replies here, it really depends on what you
actually mean by "driver".

One such topic I've seen was the request for a driver, when the end
result was that this was a proprietary device, built for one specific
software application, and it used usb, so the programmer could talk to
it using the usb api without actually building a proper driver for it.
If this is true also for your device, you could get by without actually
creating a "driver".

But as the others have said, C# can't make real drivers.
 
I'd like to thank everyone for the thoughtful replies and I now see
that C# just isn't where it would need to be to be able to do device
driver creation using the language. I suppose it's C++ then. Thanks
again!

While that is certainly true, there are devices that support the .NET
framework natively, in the guise of the .NET Micro Framework. They're quite
few as of now, but they are there
 
Back
Top