Hi,
I’ve in project to create a driver for an USB microchip card that works actually with the HID protocol. My card works actually like a joystick , it send and receive data from an directx application. It works fine but know I would like to build a driver to be able to change parameters like in the joystick panel ,or gaming configuration panel.
My driver will works with windows only 7 or later.
I’ve visual studio and the WDK but I don’t know how to start.
Thanks you
Develop the chip’s firmware in strict accordance of what is expected from the HID joystick, and you will need no driver at all (yes, on Apple and Linux too :-)).
wrote in message news:xxxxx@ntdev…
> Hi,
> I’ve in project to create a driver for an USB microchip card that works actually with the HID protocol. My card works actually like a joystick , it send and receive data from an directx application. It works fine but know I would like to build a driver to be able to change parameters like in the joystick panel ,or gaming configuration panel.
> My driver will works with windows only 7 or later.
> I’ve visual studio and the WDK but I don’t know how to start.
> Thanks you
>
>
>
>
>
Hi,
I know this and I’ve done this , but now I need to add a form to modify parameters , and I would like to simplify the data exchange because it is quite complicated . If the driver can do all the job it will be more simple.
The user mode cpl work must be done by a DLL, not the driver
d
Bent from my phone
From: xxxxx@gmail.commailto:xxxxx
Sent: ?11/?7/?2013 3:11 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] building USB driver from scratch
Hi,
I know this and I’ve done this , but now I need to add a form to modify parameters , and I would like to simplify the data exchange because it is quite complicated . If the driver can do all the job it will be more simple.
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
Ok maybe i’m new on driver dvp.
Where can I find information to build a simple driver with a cpl to test a simple USB application with my PIC , just exchange analog conversion from Pic to cpl and toggle led order from cpl to my pic.
Thanks you
There are no samples which demonstrate how to write a dll, MSDN has docs. A dll is a renamed dll with a well known named export. It is simpler to write a standalone mfc app generated by the VS wizard. To communicate with the driver you can simple use IOCTLs. If the driver is hid, it is.more restrictive and you need to expose a new TLC with custom.usages that you then trap in the driver and do something with. If this is a kmdf based hid miniport, you could expose your own raw pdo and use the ioctl route.
d
Bent from my phone
From: xxxxx@gmail.commailto:xxxxx
Sent: ?11/?7/?2013 7:18 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] building USB driver from scratch
Ok maybe i’m new on driver dvp.
Where can I find information to build a simple driver with a cpl to test a simple USB application with my PIC , just exchange analog conversion from Pic to cpl and toggle led order from cpl to my pic.
Thanks you
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>
xxxxx@gmail.com wrote:
Hi,
I know this and I’ve done this , but now I need to add a form to modify parameters , and I would like to simplify the data exchange because it is quite complicated . If the driver can do all the job it will be more simple.
It may be wordy, but it is certainly not complicated. What you’re
trying to do is move the tedious code from user-mode, where it is easy
to debug and the price of a mistake is low, into kernel-mode, where it
is harder to debug and the price of a mistake is catastrophic. NEVER do
something in kernel-mode if the same task can be accomplished in user-mode.
There is NO WAY that a user-mode interface to a standard system driver
is more complicated than a custom user-mode interface to a custom
driver. No way.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Sorry ,I think I don’t explain correctly what I’ve done.
Actually my system (without any driver) is able to send and receive data with an directx application with the HID & PID protocol. But for the debugging and modify parameters it’s a shame.
My whish is to simplify the HID & PID protocol between the application and my pic, and I would like to add a panel to modify parameters.
I just start my research on the USB driver so most of your explanation are chinese for me.
IOCTL an other kernel-mode user-mode.
I’ve just bought the OSR FX2 card , I think it is the best way to understand the “mystery driver world”
with the FX2 is it possible to make what I want ???
Thanks you
xxxxx@gmail.com wrote:
Ok maybe i’m new on driver dvp.
Where can I find information to build a simple driver with a cpl to test a simple USB application with my PIC , just exchange analog conversion from Pic to cpl and toggle led order from cpl to my pic.
You said your device is a HID device, right? In that case, you don’t
need to write a driver at all. Just let the the standard driver handle
it. How are you planning write your data? Have you defined custom
reports? Or were you planning to use vendor commands?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
xxxxx@gmail.com wrote:
Sorry ,I think I don’t explain correctly what I’ve done.
Actually my system (without any driver) is able to send and receive data with an directx application with the HID & PID protocol.
What is “PID” protocol?
But for the debugging and modify parameters it’s a shame.
Why on earth is it a shame? If the HID commands are a bit wordy, then
you hide them in a function that is tested and reliable, and you call
that. You don’t design a new driver for it.
I think your development priorities are confused. What’s your goal
here? If you’re just trying to download parameter sets into your
joystick device, while still allowing it to be a joystick, then don’t
think about drivers at all. Write a user-mode application to do the
download using the HID APIs.
My whish is to simplify the HID & PID protocol between the application and my pic, and I would like to add a panel to modify parameters.
The reason we have standard protocols (like HID) is to eliminate the
need to develop new drivers for every device. As long as your device is
working with the standard driver, why are you worried about this?
I just start my research on the USB driver so most of your explanation are chinese for me.
IOCTL an other kernel-mode user-mode.
I’ve just bought the OSR FX2 card , I think it is the best way to understand the “mystery driver world”
with the FX2 is it possible to make what I want ???
The OSR FX2 will give you an introduction to USB devices and USB
drivers, but it is not a HID device, so it’s not clear how would help
you in your current project.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
> Actually my system (without any driver) is able to send and receive data with an directx application
with the HID & PID protocol. But for the debugging and modify parameters it’s a shame.
Why? DirectInput is a way to go.
Also note that debugging will not be required on customer sites, and will not be provided in the customer’s package.
And, for modify parameters, note what Doron have told you. And yes, this EXE/DLL should talk DirectInput/HID, using “set usage” verbs (my memory is a bit vague on the exact name of this operation).
My whish is to simplify the HID & PID protocol between the application and my pic
What is the need of “simplifying” the protocol at the major man*month (and thus $$$) cost of developing a driver, where it is not necessary at all?
Do not “simplify” the protocol. Just use it “as is”. Filling complex HID messages in a control panel EXE is next to nothing compared to driver complexity and support costs.
Also, “no need in any drivers, just plug and go” is a customer-visible benefit, ask your marketing ![]()
, and I would like to add a panel to modify parameters.
Just send “set” HID messages over DirectInput to blink LEDs and such.
I just start my research on the USB driver so most of your explanation are chinese for me.
Tell your management you’re about to waste like 1/2 of man*year of company time for your personal satisfaction, also stripping the final product off the customer-visible benefit of “no drivers required”.
Also think Linux and MacOS, which have something very similar to DirectInput (surely they can blink the joystick LEDs), while your driver will require TOTAL rewrite for these OSes.
Yes, I know that KMDF is architecturally very much similar to Apple’s IOKit, but still they are not compatible at all. Same entities with another names, also KMDF has a C exported API (wrapped around C++ internals), while IOKit uses a subset of C++ for exported API (with things like OSDynamicCast).
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
Whaouh,
Ok, most of yours answers look same : don’t waist time to dvp a working system !!!
I’m sure your right , I will let the HID doing is good job . But I still a way to configure my system with a control panel.
You say that I just need to write an MFC that can be able to my card trought HID , ok but the commands I need are not integrated in the HID protocol . I 've to add some “vendor command”.
The PID is “Device Class Definition for Physical Interface Devices”(http://www.usb.org/developers/devclass_docs/pid1_01.pdf) to make system with Force feedback.
the HID interface to make simple joystick is not problem it take 15 minutes but to make it compatible with the PID is not quite esay , I made 90% of the job the last 10% make me thinking that it would be more easier if a driver could make all the decoding of the informations and send only simplified frame. I’ve looked at other protocol of system that use the PID , they exaclty do as I tought the driver doesn’t send frame PID compliant.
A friend of mine give me the FX2 but if you says that is not interesting for me I will let it down.
Thanks you
if you control firmware, report a new HID TLC and put whatever vendor stuff you want there. the firmware on the device can then interpret the vendor specific HID reports however you wish.
From: xxxxx@lists.osr.com on behalf of xxxxx@gmail.com
Sent: Thursday, November 07, 2013 11:13 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] building USB driver from scratch
Whaouh,
Ok, most of yours answers look same : don’t waist time to dvp a working system !!!
I’m sure your right , I will let the HID doing is good job . But I still a way to configure my system with a control panel.
You say that I just need to write an MFC that can be able to my card trought HID , ok but the commands I need are not integrated in the HID protocol . I 've to add some “vendor command”.
The PID is “Device Class Definition for Physical Interface Devices”(http://www.usb.org/developers/devclass_docs/pid1_01.pdf) to make system with Force feedback.
the HID interface to make simple joystick is not problem it take 15 minutes but to make it compatible with the PID is not quite esay , I made 90% of the job the last 10% make me thinking that it would be more easier if a driver could make all the decoding of the informations and send only simplified frame. I’ve looked at other protocol of system that use the PID , they exaclty do as I tought the driver doesn’t send frame PID compliant.
A friend of mine give me the FX2 but if you says that is not interesting for me I will let it down.
Thanks you
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
> You say that I just need to write an MFC that can be able to my card trought HID , ok but the
commands I need are not integrated in the HID protocol . I 've to add some “vendor command”.
The commands like “turn the LED on” MUST be in HID (HID is designed with them in mind). Otherwise, it’s just a design error of the firmware designer.
You can use vendor-specific HID usage codes. No need in vendor-specific commands which makes the device non-HID.
would be more easier if a driver could make all the decoding of the informations
No, it would not. “Driver” and “easier” are incompatible notions.
Driver will open a major can of worms of its own, and, with this can of worms, you will just forget about the past horrifics on HID packet encodings
they will become very simple to you ![]()
and send only simplified frame.
Yet another error.
What you want is to have 2 stages:
- convert the packets from complex to easy
- handle the easy packets.
In nearly any case this is an inferior solution to a better one: handle complex packets directly. The reason is that the 2-stage solution requires more code (stage 1 is actually as complex as direct handling), of a very bug-prone and even security-bug-prone kind.
A friend of mine give me the FX2
Good toy. But hardly usable for a marketable professional joystick product.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com