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:6098
Description:
  Shows the basic interaction with a PS2 mouse(with extended wheel/buttons!) using TC3.
User Contributed Comments(8)
 [1] Ven | 2006-07-14 16: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 06:46:04

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

hi there
this code is not working not in xp and in dos
help
 [4] arkon | 2006-10-18 11: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 10: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 01: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 17: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?
 [8] moussa | 2010-04-13 00:38:04

i want to interface a ps2 mouse with a pic (16f877or 18f452) can anyone help me to write this program in basic language (i am working on proton pluse program)
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[106235]
2D Rotated Rectangles Collision Detection[79393]
Keyboard Hook[68783]
UDP[52867]
HTTP Proxy[36098]

::Top 5 Samples::
2D ColDet Rotated Rectangles[10613]
PS2 Mouse Driver[6098]
Wave Format Player[4984]
Reading FAT12[4870]
CodeGuru[4561]


All rights reserved to RageStorm © 2009