Page 1 of 1

Mouse Sample Rate

Posted: Tue Nov 13, 2007 1:21 pm
by Dex
In my GUI mouse works fine, but in my cli my mouse it is too responsive, so i tried using "set Sample Rate" with the 0f3h command, as per the spec, but it does not seem to change Sample Rate ?.
I am at a loss as to why it is not working, any one who has written a ps2 mouse driver for there OS, got it to work ?.
Thanks in advance.

Posted: Tue Nov 13, 2007 2:07 pm
by Candy
Sample rate is the amount of messages the mouse can send per second. You can just shift down the amount of movement to slow down the movement...

Posted: Tue Nov 13, 2007 7:46 pm
by bewing
Samplerate is number of mouse packets per second -- it does not change mouse sensitivity at all.
What you want is Set Resolution -- command 0xe8.

I just finished rewriting the wiki mouse entry a few days ago -- you might want to take a peek at that. It's very different now.
http://www.osdev.org/wiki/Mouse_Input
What I do in my CLI is I use a multiplier of 32 on both X and Y coordinates, and a log2(deltaX + deltay) approximate non-linear scaling.

Posted: Wed Nov 14, 2007 4:53 am
by jal
bewing wrote:I just finished rewriting the wiki mouse entry a few days ago -- you might want to take a peek at that. It's very different now.
It looks good, just the opening sentence "Current PCs generally use PS2 mice, or a similar format that emulates a PS2 mouse" is a bit out of date. Truely all PCs have USB mice nowadays (yes, they may emulate PS/2, but PCs do not "generally use PS/2 mice").


JAL

Posted: Wed Nov 14, 2007 5:13 am
by Dex
Thanks for both your inputs, i had the same idea as Candy, but its seems to have no effect, i have also tried changing "Set Resolution" and it also has no effect.
I will do a "Status Request" to see if it is changing anything.

And nice job on wiki bewing.

[EDIT] I found the problem, it seem when i wrote my mouse code many moon ago, i did not div the XY by 8 for text mode.

Posted: Wed Nov 14, 2007 2:04 pm
by bewing
jal wrote: It looks good, just the opening sentence "Current PCs generally use PS2 mice, or a similar format that emulates a PS2 mouse" is a bit out of date. Truely all PCs have USB mice nowadays (yes, they may emulate PS/2, but PCs do not "generally use PS/2 mice").
As a statistical thing, I'm gonna bet that it's only PCs owned by geeks in the US, Europe, & Japan (plus other industrialized asian tiger countries), that primarily use USB. I'll bet that corporate PCs mostly still use old PS2 mice (because they still work, and it would cost money to replace them!) -- but of the half a billion functional PCs in the world, I'll put my money on most of them still using PS2.

But, of course, now that I've written the hard part of the wiki entry, feel completely free to tweak it to make it sound better! :D I was just trying to cram in everything that I'd had to dig up in order to get my mouse to work, and make it sound logical. Wasn't trying to make it elegant, too. lol

Posted: Wed Nov 14, 2007 3:01 pm
by jal
bewing wrote:I'll bet that corporate PCs mostly still use old PS2 mice (because they still work, and it would cost money to replace them!)
Over here in the Netherlands, corporate PCs are leased, usually from Dell nowadays, and replaced every two years or so. I haven't seen any PC with a PS/2 mouse at the company where I work. At home, I use the USB plug of my Logitech keyboard/mouse combo, although it has PS/2 connectors and so does my PC.
-- but of the half a billion functional PCs in the world, I'll put my money on most of them still using PS2.
I'll put my money on a large amount still using serial mice :). No wait, not my money, but I wouldn't be surprised.
But, of course, now that I've written the hard part of the wiki entry, feel completely free to tweak it to make it sound better! :D
Hey, if only I had the time :).
I was just trying to cram in everything that I'd had to dig up in order to get my mouse to work, and make it sound logical. Wasn't trying to make it elegant, too. lol
I have recently read somewhere someplace about sending commands to the PS/2 mouse, and iirc, it said something about sending specific manufacturer commands to the thing, using something like one or two bits per byte for some reason, or something. Can't for the love of god remember where though...


JAL

Posted: Thu Nov 15, 2007 1:06 am
by bewing
Amusingly, I have a copy of it saved on my machine, and I was just looking back at it today. Not that I am intending to implement non-M$ compliant mice, currently.

http://www.win.tue.nl/~aeb/linux/kbd/scancodes-13.html

And I will be adding it as a link to the wiki entry now.

Posted: Thu Nov 15, 2007 4:48 am
by jal
bewing wrote:Amusingly, I have a copy of it saved on my machine, and I was just looking back at it today.
Heh, yeah, that's exactly the one I read back then. Thanks :)


JAL