Page 1 of 2

Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 10:33 am
by Tom
I'm telling you, I can NOT get any value from the keyboard using in OR inportb while the Ints are Enabled!

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 11:24 am
by dronkit
That just can't be. You must have a problem with your inportb() function or something with your idt or maybe you're not sti'ing the interrupts or maybe you haven't enabled all interrupts of the pic (maybe you disabled them all).


are you getting any clock interrupts?

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 11:24 am
by Pype.Clicker
that's a pity ... i'll light a candle and pray for Tanenbaum's mercy ...

is it on real hardware ? on bochs ? ... did u ensure you had no more polling loop ? ...

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 11:31 am
by Tom
I did STI...with ints disabled I can poll...I never use Bochs for FritzOS...I use reboot -f ;)

my inportb is not messed up...because the "In" function in asm is not working either;)

and it calls the IRQ..I tested when it calles it to print "1"

my IDT is fine....I think...

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 12:20 pm
by dronkit
i'll ask you one more time. Are you getting any clock interrupts? (int 8)

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 12:27 pm
by Tim
First of all: Tom, we know your code isn't working. You don't need to tell us 86 times...

Second: the actual inportb() and the IN instruction do work. If the IN instruction appears in your disassembly, it will work: bugs don't work their way into the CPU hardware.

Third: there is no direct interaction between the IN instruction and interrupts. However, what the hardware does when you read a port is up to the hardware. For example, once you receive IRQ1, the keyboard controller won't issue any more interrupts until you read from port 0x60.

In summary: there's a problem in your code somewhere. In the end, it's your code, not ours, and no amount of complaining about inportb() will fix it. Those of us who've got further in OS development than you have solved all these problems for ourselves, so it's possible -- it just takes a lot of effort.

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 1:29 pm
by ncsu121978
[attachment deleted by admin]

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 3:49 pm
by Tom
ncsu121978,

can I see your install_handler code?(and it's whole header file )

Re:Keyboard I/O Prob...

Posted: Wed Nov 06, 2002 7:47 pm
by ncsu121978
[attachment deleted by admin]

Re:Keyboard I/O Prob...

Posted: Thu Nov 07, 2002 2:09 am
by Pype.Clicker
just a silly question ... you don't own an USB keyboard, do you ?
maybe it's something to configure in the BIOS (emulate old keyboard) or something alike ... a.f.a.i.k. both legacy and PS/2 keyboards come through 0x60..0x64 in ports, but for USB ones, i think they use some other method (dunno which one, though :(

Re:Keyboard I/O Prob...

Posted: Thu Nov 07, 2002 2:25 am
by ncsu121978
i do not own a usb keyboard...or are you even talking to me ?
anywho the code i put up works perfectly fine for me :)

Re:Keyboard I/O Prob...

Posted: Thu Nov 07, 2002 8:46 am
by Tom
I use a PS/2 that's why with ints disabled I can use polling...

still trying...

Re:Keyboard I/O Prob...

Posted: Thu Nov 07, 2002 8:50 pm
by Tom
I need another IDT example...mabe one in C....tried Warmasters...but asm is ok

The IDT I have is bad. Don't argue. I have tested ALL the code. All the code...I don't have much time for OS dev mabe for a while...so just belive me....

Does anyone have a working tested IDT?

In Asm(intel/at&t) or C?

Thank you(when I use my IDT and read ports, the computer crashes)

Re:Keyboard I/O Prob...

Posted: Fri Nov 08, 2002 4:09 am
by Pype.Clicker
Tom wrote:
Does anyone have a working tested IDT?
In Asm(intel/at&t) or C?
Thank you(when I use my IDT and read ports, the computer crashes)
mine works fine from about 2 years. get it at http://sourceforge.net/projects/clicker

i hope you'll find it useable ... (see kernel/interrpt.c, core/control.asm and core/config.asm)

Re:Keyboard I/O Prob...

Posted: Sat Nov 09, 2002 7:54 pm
by Tom
doesn't your OS run in v86 mode? Pype...would I have to do anything special with your code before I test it...?