• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

OS/2 & eCS USB HID driver incomplete

Started by demetrioussharpe, 2010.11.23, 04:48:42

Previous topic - Next topic

demetrioussharpe

Try connecting a USB joystick with analog sticks and it will improperly be recognized as a mouse & be generally ineffective for usage.
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

Pete

Hi

You will probably find the IBM usbhid driver is written to the usb specs but hardware supplied for Windows does not necessarily follow those specs and in such cases provides some sort of driver to make the hardware work.

Regards

Pete

warpcafe

Hi,

I wonder if the new stylus/tablet driver (see Sigurd's Lenovo...) can be a basis to develop something suitable for USB joysticks... but then... how many people are actually using USB joysticks with eCS?
(Sorry if that sounds ignorant... I am honestly wondering!)

Cheers,
Thomas
"It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that"
- G.H. Hardy

demetrioussharpe

Quote from: Pete on 2010.11.23, 16:34:26
Hi

You will probably find the IBM usbhid driver is written to the usb specs but hardware supplied for Windows does not necessarily follow those specs and in such cases provides some sort of driver to make the hardware work.

Regards

Pete


What's more likely is that the HID driver was written before the world was flooded with USB joysticks. I've found the same issue with another OS that I love (Syllable). When I looked through the source for it, I found that they'd done a half-ass port of the Linux HID driver. Now, I know that OS/2's HID driver probably isn't based on any of the concepts in the Linux driver. But I also know that IBM stopped updating most of OS/2 before people were using more types of USB input devices than just mice & keyboards. Since I've poured through the code of HID drivers before & I've read the spec over & over, I can tell you that the driver in question probably doesn't implement collections & usage pages properly. It also probably doesn't implement push & pop functions either.
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

demetrioussharpe

Quote from: warpcafe on 2010.11.23, 18:40:41
Hi,

I wonder if the new stylus/tablet driver (see Sigurd's Lenovo...) can be a basis to develop something suitable for USB joysticks... but then... how many people are actually using USB joysticks with eCS?
(Sorry if that sounds ignorant... I am honestly wondering!)

Cheers,
Thomas

What matters isn't how many that're doing it today. What matters is making sure that it works when they actually do it. Unless things like this are fixed, it's going to be harder to grow our community numbers. I'm a realist & I'm sure that OS/2 won't overtake Windows in my lifetime. But, that doesn't mean that we can't increase our user base. People like to play with OS's that don't look too dated & that they can play some of their favorite types of games on with a little hassle as possible. So, why have unnecessary hassles?
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

DougB

My first comment is, that probably nobody is using USB joysticks, since the probably won't work.

QuoteWhat matters is making sure that it works when they actually do it. Unless things like this are fixed, it's going to be harder to grow our community numbers.

There are hundreds of things that are far more important that joysticks, and not enough people working on making them work. We need either a couple of hundred, volunteer, expert programers, or we need a few million dollars to hire them. Fortunately, those who do volunteer their time, are pretty good at what they do, but there are still only 24 hours in a day. Mensys does put money into hiring programers to do some of the really important things (like support for network adapters), USB support is, apparently, on the ToDo list, but I suspect that it is far down on that list.

Okay, here is a challenge for YOU. There is a package at HOBBES called usbecd10.zip. It contains a driver for "unknown" devices, and it supplies the basic access methods for read and write to the device. There is also a (windows) tool at http://sourceforge.net/projects/usbsnoop/ that will trace exactly what a USB device does. Between the two, and some serious work, it should be possible to develop something that will make the device work. Have fun...

demetrioussharpe

Quote from: DougB on 2010.11.23, 20:40:15
My first comment is, that probably nobody is using USB joysticks, since the probably won't work.

QuoteWhat matters is making sure that it works when they actually do it. Unless things like this are fixed, it's going to be harder to grow our community numbers.

There are hundreds of things that are far more important that joysticks, and not enough people working on making them work. We need either a couple of hundred, volunteer, expert programers, or we need a few million dollars to hire them. Fortunately, those who do volunteer their time, are pretty good at what they do, but there are still only 24 hours in a day. Mensys does put money into hiring programers to do some of the really important things (like support for network adapters), USB support is, apparently, on the ToDo list, but I suspect that it is far down on that list.

Okay, here is a challenge for YOU. There is a package at HOBBES called usbecd10.zip. It contains a driver for "unknown" devices, and it supplies the basic access methods for read and write to the device. There is also a (windows) tool at http://sourceforge.net/projects/usbsnoop/ that will trace exactly what a USB device does. Between the two, and some serious work, it should be possible to develop something that will make the device work. Have fun...

Your first comment:  Chicken or the egg?

Your second comment:  I already know what it's doing, I don't need a trace device to figure that out. It's only parsing part of the HID protocol & assuming that the data is for either a keyboard or joystick based on simplistic guidelines that aren't realistic. If it bothered to implement the whole protocol for HID's then there wouldn't be an issue.  Also, all things are important, not just network adapters & the like. These are things that will never be complete anyway, since devices will always become outdated when new devices are created.

As far as your challenge, my hands are full with the OS/2 OpenGL stack  rewrite including hardware acceleration. I'm not one of those guys who whines & waits for someone to do the work for them. I'm one of those guys who jumps in & starts working, then tries to see if he can get a few others to do the same. Also, assuming this rewrite is successful, adapting another kernel for OS/2 usage is next on my list.
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

rudi

Quote from: demetrioussharpe on 2010.11.23, 21:49:03
What's more likely is that the HID driver was written before the world was flooded with USB joysticks.

OS/2's USB drivers suck big time. They were written at a time, when USB was rather new and IBM's the later update policy was to support only devices for which they had an immediate requirement (business case). Thus, in most of the cases it's not the fault of the device doing "non-standard" things. It's the USB stack, that is to blame.

Quote from: demetrioussharpe on 2010.11.23, 21:49:03
I already know what it's doing, I don't need a trace device to figure that out. It's only parsing part of the HID protocol & assuming that the data is for either a keyboard or joystick based on simplistic guidelines that aren't realistic.

Actually this is not the whole story. The HID drive is parsing the HID protocol reasonably well. When a device is attached, it then asks it's clients if one of them might feel responsible for serving this device. Since there is no joystick client driver installed and your device seems to offer a mouse-like interface, the USB mouse driver claims it. If it does this right is another story. ISTR, that there used to be an USB joystick driver around, but don't remember it's name and where to find it. Of course, you also need applications that make use of it.

As for the mentioned "usbecd10.zip" on HOBBES: I strongly suggest to support devices that conform to a standard class by a real driver instead of a ring3 hack.


demetrioussharpe

I'm surprised that it's not using one HID driver with subfunctions for the different types of HIDs. But I guess I shouldn't be surprised. It probably couldn't be done optimally on OS/2.
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

demetrioussharpe

Quote from: rudi on 2010.11.24, 11:57:44
Actually this is not the whole story. The HID drive is parsing the HID protocol reasonably well. When a device is attached, it then asks it's clients if one of them might feel responsible for serving this device. Since there is no joystick client driver installed and your device seems to offer a mouse-like interface, the USB mouse driver claims it. If it does this right is another story. ISTR, that there used to be an USB joystick driver around, but don't remember it's name and where to find it. Of course, you also need applications that make use of it.

Right now's probably a good time to develop a new API for joystick usage. If I can't find that driver or it's author, I guess I'll have to look into porting one from another OS. Is there anyone else interested in such a driver?
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!

abwillis

Quote from: rudi on 2010.11.24, 11:57:44
ISTR, that there used to be an USB joystick driver around, but don't remember it's name and where to find it. Of course, you also need applications that make use of it.
It is/was on the netlabs cvs.  There is now a svn repository:
http://svn.netlabs.org/usb
that I think is where the work Mensys is doing towards USB support is done... it may or may not include the genjoy (which is what I recall the USB joystick driver was called) code from CVS (requires an ID and password for code access and mine has not been authorized).  I have the cvs code that I zipped up in 2004, I think the last code update was around 2001.  There was a much more functional version that was reported to have been developed but the developers machine was stolen.

RobertM

abwillis has hit the head right on the nail... here's the old discussion group:
http://tech.groups.yahoo.com/group/ejoyos2/

And the old page for it was located on OS/2 World but is now long gone.
- USB Joysticks: http://www.os2world.com/usb/html/joysticks.html


As Martin and Andy are both active in these forums, they may be able to answer any particular questions on the project - then again, it's been kinda dead for a while.

-R


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


DougB

Quote
Your second comment:  I already know what it's doing, I don't need a trace device to figure that out. It's only parsing part of the HID protocol & assuming that the data is for either a keyboard or joystick based on simplistic guidelines that aren't realistic. If it bothered to implement the whole protocol for HID's then there wouldn't be an issue.  Also, all things are important, not just network adapters & the like. These are things that will never be complete anyway, since devices will always become outdated when new devices are created.

I suggested "usbecd10.zip" because it will install a driver that will take control of the device. What happens after that is up to whatever program you attach to the driver. IBM's implementation is far from complete, and nobody has found the time, or the interest, to update it. Whether joysticks are important, or not, is in the hands of the user. Personally, the last joystick I ever considered using, was one that I built myself, back in about 1982, for my original IBM PC. It worked well, but was just about the most useless piece of hardware that I ever owned. I really don't want to see good programing talent going to waste on joysticks, when accelerated video, is no longer available, JAVA 6 is not, yet available, many printers are not supported, large disk drives are waiting for support, AHCI disk controllers are not, yet, supported, and so on. It seems to me, that joysticks are WAAAY down on the list of necessary items. Besides, what would you use it for?

QuoteAs for the mentioned "usbecd10.zip" on HOBBES: I strongly suggest to support devices that conform to a standard class by a real driver instead of a ring3 hack.

I don't think that driver is any more of a hack than any other driver is. It is simply an open ended attachment to a raw USB device. It does give the user the option to write their own program to do whatever is required to make the device work. There is a supplied REXX library, but there is also documentation on how to use it with other programing languages. Backupsmon uses it to control Uninterruptable power supplies, and it is also used with the Canon 4400F scanner driver. If the source was available for that driver (perhaps it is), it might help to make more USB devices work. The USBSNOOP program gives the user a tool to see, exactly, what the device needs to "see" for it to work. With a lot of work, I suspect that any USB device could be made to work, with nothing more than the current USB stack.

rudi

Quote from: DougB on 2010.11.24, 20:11:04
Backupsmon uses it to control Uninterruptable power supplies ...

Which is fundamentally wrong because UPS devices are supposed to comply to
the HID standard (see http://www.usb.org/developers/hidpage#HID_Usage). The
way Backupsmon is implemented is just a hack to make it kinda work. Not how it
should be done. A correct implementation would be able to work with most UPS
devices in a generic way by interpreting the HID descriptors in order to find out
which bit in which data packet has which functionality. In contrast, the author of
Backupsmon has monitored data packets from some UPS model(s) and figured
out the meaning of a few of the status bits. This works only for a very limited
number of devices, because a manufacturer is free change the layout of the
HID reports depending on model, firmware revision or whatever. Not to talk
about different manufacturers.

I haven't looked a the tool for quite a while, but last time I checked it could not
read values like current line voltage, remaining battery capacity, current UPS
load, battery replace date etc. This all can be done in a generic way i.e. without
the driver being hardcoded to support only model Abc by manufacturer Xyz.

demetrioussharpe

Quote from: abwillis on 2010.11.24, 18:01:38
Quote from: rudi on 2010.11.24, 11:57:44
ISTR, that there used to be an USB joystick driver around, but don't remember it's name and where to find it. Of course, you also need applications that make use of it.
It is/was on the netlabs cvs.  There is now a svn repository:
http://svn.netlabs.org/usb
that I think is where the work Mensys is doing towards USB support is done... it may or may not include the genjoy (which is what I recall the USB joystick driver was called) code from CVS (requires an ID and password for code access and mine has not been authorized).  I have the cvs code that I zipped up in 2004, I think the last code update was around 2001.  There was a much more functional version that was reported to have been developed but the developers machine was stolen.

Yeh, I can't seem to access the svn version, no password.
The difference between what COULD be achieved & what IS achieved
is directly relational to what you COULD be doing & what you ARE doing!