Well i stumbled across this site yesterday and went straight to the Basic Bones tutorial. I modified it a bit (made a printf function and a function to clear the screen), and the next thing i want to do is add keyboard support. I looked through the section on Keyboard Controllers and attempted to hack together a keyboard controller to no avail. This is mainly because im not to great at asm. So i was wondering if anyone could explan to me how to modify the loader from the basic bones tutorial to make it call a function in my C source file ( keyboardHandler() ) when a key is pressed.
Cheers.
Keyboard support
Re: Keyboard support
I just had a quick look over the bare bones tutorial on the wiki and see nothing in it regarding the IDT (interrupt descriptor table).
I'll keep this short. The keyboard controller raises an interrupt when you press a key. You need to tell the CPU what to call when the keyboard interrupt occurs. (you could do it via polling but that's just nuts )
I recommend reading tutorials on GDT,IDT and the PIC.
Hope that helps..
EDIT: Oh and welcome to the forum! Good luck.
I'll keep this short. The keyboard controller raises an interrupt when you press a key. You need to tell the CPU what to call when the keyboard interrupt occurs. (you could do it via polling but that's just nuts )
I recommend reading tutorials on GDT,IDT and the PIC.
Hope that helps..
EDIT: Oh and welcome to the forum! Good luck.
All your base are belong to us.
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: Keyboard support
Agreed. I tried doing a keyboard driver in asm via polling but it failed miserably. As well as taking 100% CPU!dosfan wrote:(you could do it via polling but that's just nuts )
Re: Keyboard support
My old kernel used to drop to a built in kernel debugger when it panic'ed. I used to poll the keyboard because it ran with interrupts disabled (for obvious reasons)
All your base are belong to us.