Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Sample Code - PS2 Mouse Driver
Author:Arkon
Category:DOS Stuff
File Name:ps2mouse.cpp
File Size:~ 4.98 KB
Uploaded at:15-Jul-06
Downloads:6955
Description:
  Shows the basic interaction with a PS2 mouse(with extended wheel/buttons!) using TC3.
User Contributed Comments(7)
 [1] Ven | 2006-07-14 20:58:26

I noticed a small bug. When enabling the interrupt with PIC 2, you used 0x21. That's PIC 1. PIC 2 is 0xA1. ;)
 [2] arkon | 2006-07-15 10:46:04

Thanks Ven,
a fix was uploaded already.
 [3] wasim ahmad | 2006-10-17 04:58:12

hi there
this code is not working not in xp and in dos
help
 [4] arkon | 2006-10-18 15:24:31

it is not supposed to work under any windows (ntvdm).
anyways, what's wrong with dos? can you give more details?
 [5] anna | 2006-10-27 14:51:04

ok i think i ave tried everithing, it wont work on dos, not xp, nor vista,i have tried to modify 0xa1 by 0x21 doest work either way, all it does in dos is cursor blinking, and it obviuly doesnt detect the mouse, on xp in says a bunch of errors, so coud it be the compiler?, or linker?? do they need special config???
using tc3 and tc 3lite
 [6] wasim ahmad | 2006-11-01 06:16:59

hi there
i used tc++ 3.0 to compile the code
after this i opened the bin directory and execute the exe
all it does is it as mentioned by "anna" a blinking cursor
i can understand that dos programs run in virtual x86 mode under xp and hence cant have pure hardware interaction
so i booted my pc with a bootable floppy, browsed to that directory and executed it
i found a different result :
cursor blinking continues
the system gets hanged on clicking the mouse button

sir, i will be thankful to u if u will look into the matter and upload a functional mouse code(even in asm) which can run in pure vanilla DOS(i mean bootaing system using DOS bootable disk)

I want mention at last but not least that
"THIS IS THE ONLY WEBSITE I HAVE SEEN SO FAR THAT HAS SUCH A CODE UPLOADED"
HATS OFF FOR THE EFFORT

Hope i will get some reply soon
 [7] anna | 2006-12-12 22:23:21

ok after numerus tries I gave up, this just seems to only hang the system up, any how coud it be possible to getted to work under the following bios interruption?
PS/2 Mouse Request (C2h) (int 15h)

The PS/2 Mouse Request BIOS function is called to process an application or operating system
request to read the status of, or control the operation of, the PS/2 mouse.
Input Parameters:
AH - C2h, indicating the PS/2 Mouse Request Function.
AL - subfunction, as follows:
00h - Enable/Disable mouse.
01h - Reset mouse.
02h - Set sample rate.
03h - Set resolution.
04h - Get mouse type.
05h - Initialize mouse interface.
06h - Get mouse status/set scaling factor.
07h - Register callout address.
BH - sub-subfunction code or parameter for subfunction.
  0-disable
  1-enable(I think)
Output Parameters:
CY - clear if success, else set if failure.
AH - status code, as follows:
00h - no error.
01h - invalid subfunction code (code in AL.)
02h - invalid input value (value in BH.)
03h - I/O communications error.
04h - resend status received from mouse.
05h - no callout address registered.
86h - function not supported (if OPTION_SUPPORT_PS2MOUSE disabled.)
Well I mean the code that you wrote seems fine but it just doesn't seem to work,I think it could be `cause of port numbers,i noticed that some how tha app seems to confuse the keyboarb with the mouse,could that be the problem??
Any how it is the only code in the web. And it think it's awsome to publish this kind of code.:)
 by the way ps/2 port isn'ta com port is it?
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[116927]
2D Rotated Rectangles Collision Detection[88956]
Keyboard Hook[77253]
UDP[65805]
HTTP Proxy[41194]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11559]
PS2 Mouse Driver[6955]
Wave Format Player[5790]
Reading FAT12[5618]
CodeGuru[5357]


All rights reserved to RageStorm © 2009