USB support (keyboard)

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
HOS

USB support (keyboard)

Post by HOS »

Since there has been an interest in this topic, i decided to ask the question. How does one go about supporting a USB device such as a keyboard. i have a usb keyboard that works in the bios, but once i get to my OS (even in rmode calling bios for keyboard input) the usb keyboard does not work anymore. needless to say, it does not work in pmode either.

To support a USB device, is it a matter of enabling the usb port and reading from it or what? is the bios needed for information for USB devices?
Schol-R-LEA

Re:USB support (keyboard)

Post by Schol-R-LEA »

Well, the obvious place to start is the USB home page, which has the full specs available for download. While quite dense, they are relatively readable as standards documents go ::)

As for tutorials, those are rather sparse on the ground; not only has USB been slow to be adopted in the PC world, writing a driver for USB is considerably harder than the equivalent for, say, the PS/2 mouse and keyboard ports. The reasons for this are clear from the name: it is bus system (technically, the topology is a pyramidal star, but that's not the point) which can be used to connect to any peripheral (in theory). This means, among other things, that you need a driver both for the USB host, as well as for each USB device supported.

Despite this, a Google search does bring up a few potentially useful pages:
http://www.lvr.com/usb.htm
http://people.freenet.de/dieterp/main.htm#P5

Also, the OSRC does not fail us, though their material is rather dated:
http://www.nondot.org/~sabre/os/article ... nectBuses/

There are a number of books on the subject; a quick Amazon search should bring up several. Most of them, however, are on hardware design, and usually assume a Windows host environment.
User avatar
Philip
Member
Member
Posts: 59
Joined: Thu Mar 06, 2008 11:37 pm
Location: Singapore

Post by Philip »

ok, let's discuss about programming the usb devices
can we start with usb keyboard
how to read data from usb keyboard? :?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Read the USB Human Interface Device specification.

Or, use bochs or qemu so that you can use a PS2 keyboard while your kernel is still in the initial stages.
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Post by xyzzy »

RTFM. You could also have carried on this discussion in your other thread, rather than digging up a 5 year old thread...
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

AlexExtreme wrote:RTFM. You could also have carried on this discussion in your other thread, rather than digging up a 5 year old thread...
Well, it at least shows he used the forum's search functionality. That's more than some do.


JAL
Post Reply