News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

USB keyboard and mouse

Started by sinsi, July 06, 2007, 05:54:00 AM

Previous topic - Next topic

sinsi

Does a USB keyboard still send IRQ1 or is it all done via the USB controller? And what about the mouse?

I ask because I've gotten the "roll your own" bug  ::) (thanks Bogdan...I think)
Light travels faster than sound, that's why some people seem bright until you hear them.

Tedd

Initially, while in real mode and if the bios is set for it, then it will simulate the legacy keyboard by translating the usb keyboard input - so it appears the keyboard is still a legacy one, and can be used as such. When you set up your own interrupt handlers then it becomes your problem - and the keyboard only comes in through the usb controller (as it is, and always was, a usb device.)
Same for the mouse.

(Unless it's the chipset that magically does this, then I suppose you could enable it - with the help of bios - and it should just work; but I don't think that's what happens.)
No snowflake in an avalanche feels responsible.

BogdanOntanu

Yes usually BIOS will emulate USB mouse and keyboard as PS/2 mouse and keyboard while in real mode. In protected mode this emulation might or might not continue.

From my experience I would say that 80% of BIOS will emulate USB mouse and keyboard in real mode while only 50% or less will continue this emulation when the CPU is in protected mode.

The emulation is usually done via SMM code that is inaccessible even to OS  programmers. You might have an option in your BIOS setup for enabling/disabling this kind of emulation.

The bottom line: you can get lucky 50% of the times but normally you will need some USB drivers for mouse and keyboard as soon as you are in protected mode :D. And do not forget that USB drivers are kind of complicated to write.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

sinsi

Why isn't anything easy?

Thanks for the info guys.
Light travels faster than sound, that's why some people seem bright until you hear them.

ninjarider

let me know what you find out.

im about to test switching to p mode myself and find out if the usb works or not.

ninjarider

well it doesn't work on my dell optiplex 240gx i think. latest bios edition.

not i have to find out how to right usb drivers for it.

MichaelW

Mark Larson posted some USB-related code that might contain some useful information here.
eschew obfuscation

sinsi

Can't get the 2 links to work...help us donkey!  :bdg
Quote from: Mark_Larson on January 14, 2005, 04:41:33 PM

Donkey has been kind enough to host both files.  Here are the links.  Thanks Donkey!!!


http://www.members.shaw.ca/contact_donkey/files/markl/USBCOMP.ZIP
http://www.members.shaw.ca/contact_donkey/files/markl/ICH2.ZIP

And thanks MichaelW for your good memory.
Light travels faster than sound, that's why some people seem bright until you hear them.

ninjarider


MichaelW

The links do not work, but ICH2.ZIP is still available as an attachment on the post that I linked. The other is just an EXE, no source.

eschew obfuscation