Page 2 of 3

Posted: Tue Mar 18, 2008 1:15 pm
by Dex
I would try Bios setup to see if you can get any info about keyboard there, i would also try some 32bit hobby OS, with idt setup to see if they work.
Also have you tyred a exterior keyboard ?.

Posted: Tue Mar 18, 2008 9:40 pm
by Philip
yeah the tc1000 keyboard is removable, can unplug it out
maybe that's the reason why cant read it from port 60h?
(my keyboard is HID keyboard)

Posted: Wed Mar 19, 2008 4:39 am
by Combuster
If you're saying that you're using a USB keyboard, then accessing it via the keyboard (PS/2) controller is likely to cause trouble sooner or later, because it's not connected there.

Posted: Wed Mar 19, 2008 5:09 am
by Philip
it is shown in windows xp as "HID Keyboard Device", i guess it is actually "USB HID Keyboard Device", the keyboard has mouse buttons combo and connected to the mainboard by a 12 pin port
anybody knows how to read from this device?

Posted: Wed Mar 19, 2008 5:23 am
by JamesM
See your other thread. ](*,)

Posted: Wed Mar 19, 2008 7:59 am
by Dex
Try http://www.lvr.com/hidpage.htm
And check theres no legac support in the BIOS.

Posted: Wed Mar 19, 2008 11:58 am
by Philip
just want to share with you guys a link to usb programming in assembly:

http://www.frontiernet.net/~fys/usb.htm

other assembly codes of the same author (quite great):

http://www.frontiernet.net/~fys/index.htm

Posted: Wed Mar 19, 2008 2:16 pm
by xyzzy
JamesM wrote:See your other thread. ](*,)
Correction: 2 other threads, there's that 5 year old one that got dug up as well. :roll:

Posted: Wed Mar 19, 2008 7:43 pm
by Philip
Dex wrote:Try http://www.lvr.com/hidpage.htm
And check theres no legac support in the BIOS.
only contains windows code like delphi vc++ etc.

Posted: Thu Mar 20, 2008 3:55 am
by Combuster
only contains windows code like delphi vc++ etc.
Wrong.

Posted: Thu Mar 20, 2008 5:36 am
by jal
Philip wrote:i found out the problem,
it is because of my tablet pc compaq tc1000
port 60h is not the keyboard port as i tried
to write a small program in real mode and run under dos to check but
the value from port 60h is also always AAh
If you are serious about OS programming then stay away from real hardware as long as you can. Use Bochs, for example. As for port 60h, I'd be very surprised if it doesn't work on your system. If the port was absent, it should return 0xff, not 0xaa. 0xaa indicates to me the port is working just fine. See for example here and also here on how to communicate with the keyboard controller. Try e.g. the diagnostics echo (0xee) or setting the keyboard lights (0xed) and see if that works. If not, try resetting the controller (0xff). Or maybe you should simply first enable it (0xf4, 0xf6).


JAL

Posted: Thu Mar 20, 2008 8:15 am
by Philip
hi jal, thanks for the links
but my keyboard is USB HID, so just cant read from port 60h
if you know how to read from usb port, pls tell me

Posted: Thu Mar 20, 2008 10:06 am
by JAAman
you cant
simple as that. you cant
there is no way to simply 'read from the usb port' -- this is not a simple port read, like the keyboard port


1) you must first find the usb port, which means supporting PCI PnP and scanning the PCI bus to find the USB controller

2) once you have identified and located the USB controller, you must initialize it

3) once you have initialized it, you must learn to comunicate with it -- which is very complicated


i dont know more than that, as i havent done it myself (compatability with USB devices is one of the last things you do when writing an OS...)
this is what people have been trying to tell you, and have pointed you to the appropriate documentation



the much easier approach would be to forget about USB for now, and simply use the traditional interface, to do this you can either:

1) use a VM -- Bochs, VMware, VPC, and QEMU are the most commonly used ones, there are other advantages to using them besides just keyboard

2) go into your BIOS setup program, and enable legacy keyboard compatibility (to get into the BIOS, you may need to connect a PS/2 keyboard though... a lot of systems wont recognize a USB keyboard)

Posted: Fri Mar 21, 2008 6:20 am
by jal
Philip wrote:hi jal, thanks for the links
but my keyboard is USB HID, so just cant read from port 60h
if you know how to read from usb port, pls tell me
It's relatively difficult, as JAAMan wrote (at least not as easy as PS/2, as you need a USB stack of drivers: PCI to detect it, USB controller, USB HID class driver, keyboard driver, etc.). However, if you can get into the BIOS setup with the keyboard, chances are large that it has legacy support enabled. That means that normal keyboard reading should work, although not all commands may be supported, depending on what is emulated. You could try booting into e.g. FreeDOS, and if that works without problems, you know for sure legacy support is enabled (as DOS lacks USB support).


JAL

Posted: Fri Mar 21, 2008 7:37 am
by Philip
could not read from port 60h of tc1000, i bought a different computer already, what a waste of money, damn the USB keyboard