Page 1 of 1

Prerequisites for keyboard input.

Posted: Sat Jul 05, 2008 2:04 pm
by Nick Carlson
Hi again,

I've been trying to read as much beginner material as possible, but I'm still not sure about the following: What are the prerequisites to getting user keyboard input (assuming I'm in Pmode) ?

Do I need to have the following implemented?
  • ISR
  • IDT
  • GDT
Am I leaving anything out? At the moment, I have only 3 source file. Kernel.c, system.h, and loader.asm. The code can be viewed here: http://jottit.com/cqkbg/

Thanks for the help.

Re: Prerequisites for keyboard input.

Posted: Sat Jul 05, 2008 2:10 pm
by piranha
Bran's tutorial will tell you: http://www.osdever.net/bkerndev/index.php

-JL

Re: Prerequisites for keyboard input.

Posted: Sat Jul 05, 2008 7:46 pm
by octa
u have a lot of things to do before settin up keyboard..

read Bran's Tutorial or James Tutorial

Re: Prerequisites for keyboard input.

Posted: Sat Jul 05, 2008 8:26 pm
by bewing
You need a functional GDT in order to enter pmode at all.
Once you are in pmode, for a simple test you can just poll bit 0 (value = 1) of IO port 0x64 (read bytes from the port). Whenever the value is 1, you can read one scancode byte from port 0x60 -- but you will need to have the PIC shut off for this to work.
To do anything even slightly more complex, yes, you will need ISRs for all IRQs that are active on the PIC, and a 32bit functional IDT.

Re: Prerequisites for keyboard input.

Posted: Sun Jul 06, 2008 11:49 pm
by Nick Carlson
Thank you for your help.

Re: Prerequisites for keyboard input.

Posted: Mon Jul 07, 2008 7:25 am
by eax
Hi I just have been going through alot of keyboard stuff, Im new myself but brans tutorial is good because it gets things setup that are absolutly needed and after you have been through it ; it helps you understand what other stuff you need to read. I really took my time on brans tutorial and referanced stuff I didnt understand with other guides.

I also thanks to bewing and the keyboard docs managed to learn much about the keyboard I didnt know and finally managed to get some test code working yesterday thanks to everything Ive mentioned. (Its been frustrating at times but all the help as been invaluable!)

After you have got your GDT and IDT up and running thanks to brans applied style tutorial make sure to read about all the flags and try to see if you can visualise whats happening with certain parts of the code, this is why Ive taken so long with brans guide because I figured I need to be sure as I can be in theory whats going on in every baby step along the way. (I still am not looking forward to a memory manager lol)

Btw the brokenthorn series are an absolutely awesome series of tutorials , I did those last time around but I think they have been updated severly since I was last here, and theres a great theory article on the PIC(Programmable Interrupt Controller) when you get to the point of doing code for that.

Good luck!

Re: Prerequisites for keyboard input.

Posted: Mon Jul 14, 2008 6:52 am
by Combuster
You only really need to be able to do port I/O to access the keyboard. The rest is just additional goodies that make life easier. You can just poll it rather than waiting for interrupts.