Hello
Sorry for bumping this 3 years old thread. I have the same eGalax Touch screen and I'm struggling to achieve the same goal.
First all, thank you Bret for this excellent, extensive work on USB drivers for DOS. The documentation is impressive (I dare to say intimidating).
If xceedsys reads this post (I hope he gets notified when someone replies to this topic) I'd really appreciate his help.I'm an experienced C coder but I know very little in assembly and low level programming for DOS. I know the protocol of those eGalax touch screens (
http://www.eeti.com/pdf/Software%20Prog ... e_v2.0.pdf), what I don't know is the USB protocol. So far what I've done is, I've taken the C source code of "usbdevic.cpp" and started modifying it. I can enumerate the hosts and devices until it finds my touch screen, and I successfully registered myself as the interface owner for it. But I have several problems now.
- Starting from here, I don't know what to do next. I'd like to send and receive data packets to the device, but I haven't found any concise howto do that in the documentation. Please don't advise me to read the 600 pages of the USB specifications...
- Are there constraints to obey when programming in C ? I have two compilers at hand, either Borland Turbo C++ 3.0 (TCC) or Microsoft C/C++ Optimizing Compiler 7.00 (CL). The latter one requires 386MAX to simply run (but the binary format I target doesn't require an extender. It produces 16-bit code).
- I can't seem to be able to use the callbacks feature of the driver (tested with the interface registration). Each time my callback is supposed to be called (for example, if I unplug the cord) the computer freezes and a reboot is required. My callback is defined as "void interrupt USBNotification (void)". I pass it as such :
// prepare request structure
usb_request.I14RRequestType = I14RRTRegIntfOwner;
usb_request.I14RHostIndex = host_index;
usb_request.I14RDeviceAddress = device_address;
usb_request.I14RInterfaceNum = device_interface;
usb_request.I14RCallBackAddrSeg = FP_SEG (callback_address);
usb_request.I14RCallBackAddrOff = FP_OFF (callback_address);
usb_request.I14RUserPktID = callback_arg;
usb_request being a global instance of the int14h structure that I reuse across calls, and callback_address being a void * pointer that points to USBNotification. What am I doing incorrectly ?
Obviously, I'd love if xceedsys accepted to share his driver code with me - that would save me days
, but any sort of helpful feedback will be appreciated. An answer to my first question would be a great relief already.