Keyboard I/O Prob...

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.
Tom

Keyboard I/O Prob...

Post by Tom »

I'm telling you, I can NOT get any value from the keyboard using in OR inportb while the Ints are Enabled!
dronkit

Re:Keyboard I/O Prob...

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Keyboard I/O Prob...

Post 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 ? ...
Tom

Re:Keyboard I/O Prob...

Post 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...
dronkit

Re:Keyboard I/O Prob...

Post by dronkit »

i'll ask you one more time. Are you getting any clock interrupts? (int 8)
Tim

Re:Keyboard I/O Prob...

Post 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.
ncsu121978

Re:Keyboard I/O Prob...

Post by ncsu121978 »

[attachment deleted by admin]
Tom

Re:Keyboard I/O Prob...

Post by Tom »

ncsu121978,

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

Re:Keyboard I/O Prob...

Post by ncsu121978 »

[attachment deleted by admin]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Keyboard I/O Prob...

Post 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 :(
ncsu121978

Re:Keyboard I/O Prob...

Post 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 :)
Tom

Re:Keyboard I/O Prob...

Post by Tom »

I use a PS/2 that's why with ints disabled I can use polling...

still trying...
Tom

Re:Keyboard I/O Prob...

Post 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)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Keyboard I/O Prob...

Post 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)
Tom

Re:Keyboard I/O Prob...

Post 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...?
Post Reply