Keyboard handler doesn't display

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.
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: Keyboard handler doesn't display

Post by DixiumOS »

Kevin wrote:And also that irq has nothing to do with IRQs?
Quote of the day.
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Keyboard handler doesn't display

Post 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?
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: Keyboard handler doesn't display

Post 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.
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Keyboard handler doesn't display

Post 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.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Keyboard handler doesn't display

Post 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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: Keyboard handler doesn't display

Post 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.
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Keyboard handler doesn't display

Post 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.
User avatar
sleephacker
Member
Member
Posts: 97
Joined: Thu Aug 06, 2015 6:41 am
Location: Netherlands

Re: Keyboard handler doesn't display

Post 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.
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: Keyboard handler doesn't display

Post 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.
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Keyboard handler doesn't display

Post by iansjack »

You're priceless! :D
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: Keyboard handler doesn't display

Post by IanSeyler »

This thread has been fun to read at least!
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Keyboard handler doesn't display

Post 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.
Developer of tyndur - community OS of Lowlevel (German)
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: Keyboard handler doesn't display

Post by Octocontrabass »

iansjack wrote:You're priceless! :D
Hmm. :|


Still, you shouldn't need that in a keyboard handler.
User avatar
DixiumOS
Member
Member
Posts: 84
Joined: Tue Jan 10, 2017 3:19 pm
Libera.chat IRC: NunoLava1998

Re: Keyboard handler doesn't display

Post by DixiumOS »

iansjack wrote:You're priceless! :D
Oh, I just realized that I'm turning into one of you...

meh whatever
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: Keyboard handler doesn't display

Post by dchapiesky »

DixiumOS wrote:
iansjack wrote:You're priceless! :D
Oh, I just realized that I'm turning into one of you...

meh whatever
is that a threat?
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Post Reply