Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Question about C# appropriateness

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony P. - 16 Feb 2008 20:39 GMT
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
Robbe Morris - [MVP] C# - 16 Feb 2008 20:53 GMT
Do you really want to have your drivers dependent upon
having the .NET framework installed?

Signature

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

> Hello Everyone,
>
[quoted text clipped - 7 lines]
> Thank!
> Anthony
Jeroen Mostert - 16 Feb 2008 21:02 GMT
> 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.

Signature

J.

Peter Bromberg [C# MVP] - 16 Feb 2008 22:21 GMT
Virtually 99% of driver development for the Windows OS must be done with C++,
because of the fact that drivers require native code that interacts directly
with the OS.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> Hello Everyone,
>
[quoted text clipped - 7 lines]
> Thank!
> Anthony
Anthony P. - 16 Feb 2008 23:11 GMT
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!
christery@gmail.com - 17 Feb 2008 10:34 GMT
> 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
Rad [Visual C# MVP] - 19 Feb 2008 20:20 GMT
> 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
Signature

http://www.thinkersroom.com/bytes

Lasse Vågsæther Karlsen - 17 Feb 2008 14:52 GMT
> Hello Everyone,
>
[quoted text clipped - 7 lines]
> 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.

Signature

Lasse Vågsæther Karlsen
mailto:lasse@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.