Testing for Mouse on FreeDos

The intent of this forum is to discuss my DOS TSR programs (available at http://bretjohnson.us), how they work and don't work, new/missing features, status of updates, and anything else related to them that may need to be discussed.

Testing for Mouse on FreeDos

Postby Dinosaur » Sat Jul 04, 2009 11:02 pm

Hi all

Using Microsoft 2 button & wheel mouse on usb port of a VIA Mark Industrial cpu board.
The BIOS shows "On Chip USB" Enable/Disabled
"USB Keyboard" ditto
I have enabled both.
If I dont, then running usbuhci gives an error, "There is no uhci compatible usb host controller installed"
If I do, then running usbuhci gives the (lengthy) warning, ".....Legacy support enabled....Y/N to continue.
Answering Y, and then running usbmouse appears to progress without errors, but the mouse does not appear to work.
On some occasions, the initialising of usbmouse puts garbage on the screen, and it hangs.

Booting up with usbuhci only, will also power up the mouse.
The aim is to have firstly a standard usb mouse work, and then attempt to use a Joystick instead.
Brett, can you see any obvious solution to this.

Regards

Below screen prints of what may be relevant.
usbhosts output.
Code: Select all
       PCI BUS
      ÍÍÍÍÍÍÍÍÍÍ                             BASE           USB DRIVER
      I   B  D F                      BASE   PHYSICAL   ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
HOST  d   u  v n              USB IRQ I/O    MEMORY     HST             BW
TYPE  x   s  c c  VENDR PROD  VER NUM ADDR   ADDRESS    IDX   STATUS   USED
ÍÍÍÍ  Í ÍÍÍ ÍÍ Í  ÍÍÍÍÍ ÍÍÍÍÍ ÍÍÍ ÍÍÍ ÍÍÍÍÍ ÍÍÍÍÍÍÍÍÍÍ  ÍÍÍ ÍÍÍÍÍÍÍÍÍÍ ÍÍÍÍ
UHCI  0   0  7 2  1106h 3038h 1.0  12 DF00h ±±±±±±±±±±    0 Running      0%
                  VIA Technologies Inc                   

UHCI  1   0  7 3  1106h 3038h 1.0  12 E000h ±±±±±±±±±±  ±±± ±±±±±±±±±± ±±±±
                  VIA Technologies Inc                   

usbdevice output.
Code: Select all
                               DEVICE ADDRESSES
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Host Index:  0  Host Type: UHCI  Bus Type: PCI   IRQ#: 12  Root Hub Ports: 2
Vendor: 1106h = VIA Technologies Inc                       Product: 3038h
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
                DEVICES                                   INTERFACES           
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ  ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
                           L                C  I A                O           
ADRS                       o         P      o  n l                w           
ÍÍÍÍ   (hex)               S         o BUS  n  t t                n           
Test VEND PROD     Sub Pro p USB HUB r POWR f  f I                e     Sub Pro
RWak  ID   ID  Cls Cls col d VER ADR t (mA) g  c n  DESCRIPTION   d Cls Cls col
ÍÍÍÍ ÍÍÍÍ ÍÍÍÍ ÍÍÍ ÍÍÍ ÍÍÍ Í ÍÍÍ ÍÍÍ Í ÍÍÍÍ Í  Í Í ÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Í ÍÍÍ ÍÍÍ ÍÍÍ
  1  1106 3038   9   0   0 . 1.0 ... . s  0 1  0 0*Root Hub       Y   9   0   0
     VIA Technologies Inc                   
ÄÄÄÄ ÄÄÄÄ ÄÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ Ä ÄÄÄ ÄÄÄ Ä ÄÄÄÄ Ä  Ä Ä ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ä ÄÄÄ ÄÄÄ ÄÄÄ
  2R 045E 0053   0   0   0 Y 1.1   1 2  100 1  0 0*Mouse          .   3   1   2
     Microsoft Corp                         

usbirq output.
Code: Select all
IRQ 1.00, (C) 2008, Bret E. Johnson.

IRQ  INT      COMMON USE       ENABLED
ÄÄÄ  ÄÄÄ  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ  ÄÄÄÄÄÄÄ
00  08h  *System Timer*         Yes
01  09h  *Keyboard*             Yes
02  0Ah  *IRQ Controller #2*    Yes
03  0Bh  COM2/COM4           
04  0Ch  COM1/COM3           
05  0Dh  LPT2/Sound Card     
06  0Eh  Floppy Disk         
07  0Fh  LPT1                 
ÄÄÄ  ÄÄÄ  ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ  ÄÄÄÄÄÄÄ
08  70h  *CMOS Clock*         
09  71h  n/a                    Yes
10  72h  n/a                    Yes
11  73h  n/a                    Yes
12  74h  PS/2 Mouse             Yes
13  75h  *Math Coprocessor*     Yes
14  76h  Hard Disk              Yes
15  77h  IDE Controller #2      Yes
Dinosaur
 
Posts: 70
Joined: Wed Jul 01, 2009 5:54 pm
Location: Salt Lake City USA

Re: Testing for Mouse on FreeDos

Postby Bret » Sun Jul 05, 2009 1:21 am

Dinosaur:

I think your problem is that the USB host controller is using IRQ 12, which is supposed to be reserved for the PS2 mouse (and only the mouse). USBMOUSE emulates the PS2 Mouse, and all software that interacts with a PS2 mouse assumes IRQ 12 and assumes it is not a shared IRQ. Try installing USBUHCIL with a different IRQ. On your particular system, I think I would probably try IRQ 5. Also, installing with the DisableLegacySupport option will avoid the lengthy warning message:

USBUHCIL IRQ:5 DisableLegacySupport
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Testing for Mouse on FreeDos

Postby Dinosaur » Sun Jul 05, 2009 11:12 am

Hi all

Just to clarify something.
What other software is needed to display the mouse cursor and allow existing software to
think that an ordinary mouse driver is installed.
Code: Select all
usbuhci IRQ 11 DisableLegacySupport
usbprint
usbmouse

I am testing various IRQ's but even though all appears ok, there is no mouse cursor.
With IRQ 11 the keyboard stops working.

Regards

Edit: Can you suggest a very basic Mouse testing program.
Dinosaur
 
Posts: 70
Joined: Wed Jul 01, 2009 5:54 pm
Location: Salt Lake City USA

Re: Testing for Mouse on FreeDos

Postby Bret » Sun Jul 05, 2009 12:34 pm

To simply test whether USBMOUSE is working correctly, you can use the PS2MTEST.COM program that was included in USBDOS.ZIP file. It's sole purpose is to test USBMOUSE. You need CTMOUSE (a DOS mouse driver) if you want to actually use the mouse with DOS programs -- you can get it from http://cutemouse.sourceforge.net. This is all discussed in USBINTRO.DOC.

DOS, by default, never has a mouse cursor. Sometimes individual programs know how to use a mouse (accessing the mouse through a DOS mouse driver like CTMOUSE), but mouse functionality is not an inherent function built into DOS like it is with Windows. I have a program called MOUSKEYS (download from my site, http://bretjohnson.us) that will let you use a mouse with almost any DOS program, including the DOS prompt itself. It does this by turning mouse movements and button presses into keystrokes that look like they came from the keyboard. When you get to the point of trying to use the joystick, my JOYKEYS programs does the same thing as MOUSKEYS, except with a joystick (turns joystick movements and button presses into keystrokes).
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Testing for Mouse on FreeDos

Postby Dinosaur » Sun Jul 05, 2009 1:38 pm

Hi Bret

You have done a fantastic job of explaining the usb interface.
I have read the doc's, but have to admit, at the end I was looking for
a concise HOWTO.

Either way, your test program ps2mtest works correctly and shows all the correct buttons etc.
I normally use ctmouse on the ps2 interface, and this mouse is what I use in my app's.

However my app does not respond to mouse movements.
Putting the old ps2 mouse in parralel, shows the mouse still working on the old ps2 interface.

Regards

Edit: Should the ps2 irq be the same as the usbmouse irq ?
Dinosaur
 
Posts: 70
Joined: Wed Jul 01, 2009 5:54 pm
Location: Salt Lake City USA

Re: Testing for Mouse on FreeDos

Postby Bret » Sun Jul 05, 2009 2:52 pm

Actually, USBMOUSE emulates the mouse at the BIOS level, not the hardware (IRQ) level. USBMOUSE doesn't directly use or require an IRQ, but indirectly uses the IRQ of the Host Controller (the one used by USBUHCIL).

I suspect your problem may that you might be using CTMOUSE version 2.0, which does not work correctly with USBMOUSE, because it does not interact with the PS2 mouse at the BIOS level. You need to use CTMOUSE version 1.9 or earlier, or version 2.1 or later. In addition, you should install USBMOUSE before installing CTMOUSE. You can do it the other way also, but you must "reset" CTMOUSE if you do.


How to write the documentation has always a tough issue for me. I have a hard time writing concise HOWTO's, because there are usually so many parameters and variables that can keep things from working that if the simple directions don't work, many users just give up. Creating long documents with lots of details (which is my default way of writing documentation) also turns off some users, who won't even try to use a program if they have to read anything more than a couple of pages. If you have suggestions for the documentation, or even want to help write some of it, let me know. You should definitely have some good insight once this is all done (assuming we can get it all to work, which I think we can).
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM

Re: Testing for Mouse on FreeDos

Postby Dinosaur » Sun Jul 05, 2009 3:20 pm

Hi all

Brilliant, that works. Didnt realise that I had a faulty version of ctmouse.
My app has a loop timer in micro sec's, and it allows me to keep track of changes that cause
longer than expected execution times. It runs at 10 Micro Sec on a 533Mhz Industrial Board.
Using your mouse driver didnt change the timing at all, which I am very pleased about.
Congrats, you have done well.

This is my Autoexec.bat extract.
Code: Select all
Path C:\dos32;
C:\Dos32\DosLFN.com
C:\Dos32\cwsdpmi.exe
cd\usb
usbuhci IRQ 11 DisableLegacySupport
usbprint
usbmouse
cd\
C:\Dos32\ctmouse
C:\Dos32\LBACache
As far as the doc's is concerned, you have split it into 2. One for programmers, and one for the user.
I think there is to much user detail, that you should transfer to the programmers section.
Most people are either lazy, or to busy to go into detail.
I have read a lot of doc's on drivers, and at one stage contemplated writing a driver just for usb mouse.

I will over the next few weeks perfect the installation with a joystick, and then have a look at your doc's.
As you noted, there are loads of possible combinations , and the challenge is to write a generic HowTo.

Regards

Edit: Do you have any experience with usb joysticks ? Just wondering what problems multi button usb joysticks will cause
when I only need 1 or 2 buttons.
Dinosaur
 
Posts: 70
Joined: Wed Jul 01, 2009 5:54 pm
Location: Salt Lake City USA

Re: Testing for Mouse on FreeDos

Postby Bret » Sun Jul 05, 2009 11:33 pm

Dinosaur wrote:Edit: Do you have any experience with usb joysticks ? Just wondering what problems multi button usb joysticks will cause when I only need 1 or 2 buttons.


USBJSTIK emulates a regular analog joystick, which normally only has two or four buttons anyway. Most USB joysticks have several buttons (way more than 4), and usually also have multiple axes, hat-switches, sliders, etc. USBJSTIK will have a default way of mapping the various USB controls to the analog values (buttons and axes), which usually includes just ignoring some of the USB buttons. Except in unusual circumstances, though, the default mapping probably won't work the way you want it to work.

You're likely going to want to change the way USBJSTIK maps things, and unfortunately telling USBJSITK how you want it to work can be very confusing. Setting up USBJSTIK to work the way you want may be the most complicated thing you do in any of the USB programs. You'll definitely need to read the USBJSTIK section of USBINTRO.DOC. You will probably also want/need to use the THRUST program (a joystick test program, similar in concept to PS2MTEST), as well as the J:# option of USBJSTIK .

I'll be here if you have questions. If you need to use the forum for that, I suggest you start a new thread with "joystick" in the title somewhere rather than using this one with "mouse" in the title.
Bret
 
Posts: 478
Joined: Fri Oct 10, 2008 3:43 am
Location: Rio Rancho, NM


Return to Programs

Who is online

Users browsing this forum: No registered users and 2 guests

cron