first... I am form Brasil ... i have a bad english
I have some problems ...
I am starting in OS development and i would like to know how can i get the mouse position x and y but not with the "polling" way .... i would like to know how to program the PIC 8259
to ... when i move the mouse .... the computer call an interruption and jump to my routine ....
8259
Re:8259
Mas eu vou falar Ingl?s! bahahaahhaprbhell wrote: first... I am form Brasil ... i have a bad english
I've never programmed a mouse... but it's either:prbhell wrote: I have some problems ...
I am starting in OS development and i would like to know how can i get the mouse position x and y but not with the "polling" way .... i would like to know how to program the PIC 8259 to ... when i move the mouse .... the computer call an interruption and jump to my routine ....
- for PS/2, catch mouse info in ISR for IRQ 12... I think it's read from the PS/2 keyboard/mouse registers...
- for serial mouses, you have to implement the mouse driver as a serial port ISR (IRQ3/4)... read http://www.cs.york.ac.uk/rtslab/demos/readme/docs/pdf/mouse_hardware.pdf for protocol info...
- and if it's USB, first you need to support USB (obvious!) (parhaps you have to support PCI devices even before...) and then HID, and then... I don't know! (i.e. if it's USB just forget it for now!)
If all you want is to reprogramme the PIC, check http://www.nondot.org/sabre/os/articles/MiscellaneousDevices
JJ
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:8259
the FAQ has interesting stuff too, among other things, a pointer to SANiK's public domain driver ...
maybe you should be more precise on what you call "polling way". The mouse typically report moves, not positions. You need to keep track of these movements e.g. (+5, -2) and update the current position accordingly. Everytime you "touch" the mouse, it sends a packet to the PC including button state, and movement vector.how can i get the mouse position x and y but not with the "polling" way
hopefully not. Most motherboards do a nice job in detecting USB mice/keyboard and emulate the PS/2 mouse/keyboard interaction for you. So you can just run it as a PS/2 mouse and voil?.and if it's USB, first you need to support USB
that's a fairly different issue, but the FAQ has good info here too. Just make sure you know that most of the "alternate configurations" of the PIC are just not possible with a PC (such as using IRQ7 as cascade channel rather than IRQ2, for instance).i would like to know how to program the PIC 8259 too
Re:8259
Hadn't noticed...the FAQ has interesting stuff too, among other things, a pointer to SANiK's public domain driver ...
Erm... ok!maybe you should be more precise on what you call "polling way". The mouse typically report moves, not positions. You need to keep track of these movements e.g. (+5, -2) and update the current position accordingly. Everytime you "touch" the mouse, it sends a packet to the PC including button state, and movement vector.how can i get the mouse position x and y but not with the "polling" way
So, the mouse itself can only detect small movements...
I didn't know... partly bacause i have no background in programming mouses...hopefully not. Most motherboards do a nice job in detecting USB mice/keyboard and emulate the PS/2 mouse/keyboard interaction for you. So you can just run it as a PS/2 mouse and voil?.and if it's USB, first you need to support USB
Is there any advantage in directly controling a USB mouse when running on that type of motherboards...
I think USB mouses are stupid... Who needs a high speed general purpose port to use a mouse???
<edit:pype> this is discussed in another thread</edit>
When I wrote my PIC code, I asked that question to myself...(such as using IRQ7 as cascade channel rather than IRQ2, for instance).
I would have to rewire the PIC chip in order to do that, right?
And with a modern computer it would be impossible to do so, cause the PIC is in the chipset!
JJ