mouse driver

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

mouse driver

Post 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?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: mouse driver

Post 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.
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

Re: mouse driver

Post by digo_rp »

ok, tnx a lot
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: mouse driver

Post 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).
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

Re: mouse driver

Post 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
Post Reply