Mouse Driver Problems

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.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Mouse Driver Problems

Post by Lprogster »

Hi all

I have yet another problem... Trying to get input from the mouse.

..See next post...

Thanks yet again,
Lster
Last edited by Lprogster on Fri May 18, 2007 12:50 pm, edited 1 time in total.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

...

Thanks,
Lster
Last edited by Lprogster on Tue Oct 23, 2007 11:14 am, edited 1 time in total.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Lprogster wrote:Update: I think the mouse is of the USB type - would that make any difference?

Thanks,
Lster
"You think?", If you can't identify a USB connector... Is OSDev for you? :wink:

You could always see if your BIOS supports PS/2 legacy emulation..

Shouldn't be that hard to support the native USB connectivity though...
http://www.usb.org/developers/devclass_docs/HID1_11.pdf
http://www.usb.org/developers/hidpage/
http://en.wikipedia.org/wiki/USB_human_ ... vice_class
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Thanks for links. Brilliant :).

My physical mouse is USB, but I'm using Qemu. That's why I'm not sure about the hardware...

Than you again,
Lster
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Lprogster wrote:Thanks for links. Brilliant :).

My physical mouse is USB, but I'm using Qemu. That's why I'm not sure about the hardware...

Than you again,
Lster
Uhh, Well QEMU is an emulator.. Your host hardware wouldn't make any difference at all.. It's likely emulating a PS/2 mouse to the guest operating system.

:roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

QEMU emulates a PS/2 mouse. So does Bochs (unless you tell it otherwise).

I know, because I use my cursor in QEMU... my mouse is USB and my OS only supports PS/2 so far. I plan to implement USB soon...
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Are there any tutorials for either PS/2 mouse or USB mouses/ devices? Everything I find, I can't understand!
Last edited by Lprogster on Tue Oct 23, 2007 11:15 am, edited 1 time in total.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

Well, go to my project's sourceforge site, browse the CVS (Go to CPP_Kernel folder) and then look at my mouse driver... It's a hack job but it works.

If you want better code, look at Linux's source, or rewrite mine.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Thank you loads for that pcmattman. I think it is nearly working, but I keep getting the mouse input to my keyboard_handler (at IRQ1)! This means loads of strange characters on the screen - shouldn't that input go to IRQ12?

Anyone had this problem before?

Thanks,
Lster
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

No, my problem was the keyboard data going to IRQ 12 (which is fixed anyway).

Have you mapped the interrupts properly?
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Every thing's OK now... I confused some code... Beware of copy and paste!

Thank you pcmattman - again,
Lster
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

No worries!
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

One last question though...

...See later...

I hope I'm being coherent enough.

Anyhow - thank you for the code,
Lster
Last edited by Lprogster on Wed May 23, 2007 5:12 am, edited 1 time in total.
User avatar
AndrewAPrice
Member
Member
Posts: 2309
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

Lprogster wrote:Why doesn't this work:
You have to initialise the stack.. then there's no reason why it shouldn't work!
My OS is Perception.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

...

Thanks,
Lster
Last edited by Lprogster on Tue Oct 23, 2007 11:16 am, edited 1 time in total.
Post Reply