Page 2 of 3
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 1:35 pm
by DixiumOS
Kevin wrote:And also that irq has nothing to do with IRQs?
Quote of the day.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 1:41 pm
by iansjack
DixiumOS wrote:Kevin wrote:And also that irq has nothing to do with IRQs?
Quote of the day.
So, what do you suppose reading port 0x20 does?
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 1:58 pm
by DixiumOS
iansjack wrote:DixiumOS wrote:Kevin wrote:And also that irq has nothing to do with IRQs?
Quote of the day.
So, what do you suppose reading port 0x20 does?
Reading IRQ1.
Also, if my previous one did it with 0x20, how can it not work this time? Did the Matrix change? No.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:06 pm
by Octacone
Oh God! Your post made me so nervous. Let me explain something: there is no such thing as keyboard_outportb, Outportb and Inportb are universal hardware calls that do not bound to specific drivers. You need to seperate them into a custom file. Also what does 0x20 do, never seen anybody doing it your way. Also your x++ makes me want to end my life forever. Please please make a proper print character function.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:11 pm
by BrightLight
Guys, stop replying. You really aren't helping. Stop telling him how IRQs and port IO work. If he doesn't know the language he’s using (C), he won't get anywhere even if he knows all the OSDev theory.
BTW, I've never seen infinite loops in an IRQ handler.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:18 pm
by DixiumOS
It's not an IRQ handler for cat's sake.
Also, I could get it working by moving the scancode and IRQ unsigned chars into the loop, then it worked ya-
Well, it still displayed "f" instead of "abcdef", but okay. I'll get to that later.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:26 pm
by iansjack
DixiumOS wrote:Reading IRQ1.
Also, if my previous one did it with 0x20, how can it not work this time? Did the Matrix change? No.
The command port of the 8259 Pic is write only. (You learn this sort of thing by reading its documentation.) A read of it is either going to return 0 or an undefined value (not sure which, and can't be bothered to test it). In other words, it's meaningless.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:31 pm
by sleephacker
DixiumOS wrote:Also, if my previous one did it with 0x20, how can it not work this time? Did the Matrix change? No.
There is no keyboard.
But seriously, I think you might need to check the wiki page about the
PS/2 Controller, and the way it sends bytes.
What you seem to be trying to do is polling, which is quite simple:
- 1. Test if bit 0 of the Status Register is set
2. If so, read from the Data Port
3. Repeat
You can look up the port numbers and their functions on the
wiki. Note that polling has nothing to do with IRQs or the PIC at all, while your code suggests otherwise. And vice versa, if you're using IRQs there's no need to poll.
Once you get polling to work and you know you can communicate with the PS/2 controller / device properly, you should try to use interrupts instead, which is also described on the wiki.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:34 pm
by DixiumOS
iansjack wrote:DixiumOS wrote:Reading IRQ1.
Also, if my previous one did it with 0x20, how can it not work this time? Did the Matrix change? No.
The command port of the 8259 Pic is write only. (You learn this sort of thing by reading its documentation.) A read of it is either going to return 0 or an undefined value (not sure which, and can't be bothered to test it). In other words, it's meaningless.
There are several statements in your comment that is wrong, but I'll let you realize it.
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 2:48 pm
by iansjack
You're priceless!
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 3:08 pm
by IanSeyler
This thread has been fun to read at least!
Re: Keyboard handler doesn't display
Posted: Fri Jan 13, 2017 3:29 pm
by Kevin
DixiumOS wrote:Quote of the day.
Maybe next time you try it with understanding rather than quoting.
So, what do you suppose reading port 0x20 does?
Reading IRQ1.
Do you know what an IRQ is? Hint: It's nothing that can be read.
Re: Keyboard handler doesn't display
Posted: Sat Jan 14, 2017 1:53 am
by Octocontrabass
iansjack wrote:You're priceless!
Hmm.
Still, you shouldn't need that in a keyboard handler.
Re: Keyboard handler doesn't display
Posted: Sat Jan 14, 2017 2:19 am
by DixiumOS
iansjack wrote:You're priceless!
Oh, I just realized that I'm turning into one of you...
meh whatever
Re: Keyboard handler doesn't display
Posted: Sat Jan 14, 2017 3:19 am
by dchapiesky
DixiumOS wrote:iansjack wrote:You're priceless!
Oh, I just realized that I'm turning into one of you...
meh whatever
is that a threat?