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?
mouse driver
Re: mouse driver
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.
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.
It depends on how you design the OS. But polling it generally not a good idea.digo_rp wrote:and we have one process that reads that mouse buffer and keep drawing at screen offset ?
Re: mouse driver
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
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
tnx a lot