Page 1 of 1

mouse driver

Posted: Sat Jul 02, 2011 12:05 pm
by digo_rp
Guys, justa question please.

how mouse driver works inside a operating system?

is something like:

when mouse move it calls irq 12 then the handler works on that irq get bytes, etc.

and we have one process that reads that mouse buffer and keep drawing at screen offset ?

could anyone give some start please?

Re: mouse driver

Posted: Sat Jul 02, 2011 12:10 pm
by bluemoon
It depends on what mouse is it, COM, PS2 and USB have different ways to trigger event.

So what you move the mouse, an IRQ triggers and call your interrupt handler,
the handler fetch information from the hardware and ack the PIC.
digo_rp wrote:and we have one process that reads that mouse buffer and keep drawing at screen offset ?
It depends on how you design the OS. But polling it generally not a good idea.

Re: mouse driver

Posted: Mon Jul 04, 2011 4:53 am
by digo_rp
ok, tnx a lot

Re: mouse driver

Posted: Wed Jul 06, 2011 7:39 am
by Ready4Dis
You should send the mouse info either into an i/o buffer of sorts, and/or send it to the currently active program that is requesting the mouse. If it's the GUI, the GUI should be responsible for drawing said mouse pointer, not the mouse driver. The mouse driver simply sends it's movements and button presses to another running process, nothing more. That process is what would put it's limits (min/max), render the mouse, and dispatch what to do with different button presses (or scroll, etc).

Re: mouse driver

Posted: Wed Jul 06, 2011 4:59 pm
by digo_rp
Hum... I got it, now I understand it! then I need to create one process that is responsible for the mouse... right ?
tnx a lot