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.
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/
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.
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.
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]