Page 1 of 1
Keyboards......
Posted: Tue Mar 23, 2004 4:53 pm
by vbbrett
I have used your info to use Grub.
So, after hours of playing with that (stinking) boot loader, I have loaded my C kernel, but I have only written a few video routines for it. How do I access and decode my keyboard? I have searched this and a few other forums and websites but to no avail. I can't seem to find some C code to do this?
Brett
Re:Keyboards......
Posted: Tue Mar 23, 2004 4:58 pm
by Tim
1. Set up an IDT.
2. Reconfigure the PICs so that the interrupts they issue don't conflict with the CPU's built-in exception vectors.
3. Install a handler for IRQ 1.
4. In your IRQ 1 handler, read a scan code from port 0x60, then acknowledge the interrupt at the PIC.
5. Translate scan codes to ASCII codes or Unicode characters or whatever you want.
The FAQ on this site or
http://www.osdever.net/ should be able to help you with all of these.
PS: what stinks about GRUB?
Re:Keyboards......
Posted: Tue Mar 23, 2004 5:02 pm
by vbbrett
Well, grubs not bad. It's just the time it takes to figure and install it! After you spend your few hours configuring it, It works like a dream.
As to what tutorial on this site where you talking about? I've been to osdever, can't seem to find too much sample code there.
Brett
Re:Keyboards......
Posted: Wed Mar 24, 2004 12:58 am
by BI lazy
You can look into Minix source code for a pretty good sample of how it can be done.
You know Minix and the Minix Book (Operating Systems Development and Implementation., 2nd edition), do you?
Well, as for grub and needing hours to configure it properly: I canna follow this one. RTFM and do as it tells you to do and there you go. Where's the problem?
as for your Keybard problem: ere you do this, take care that you are able to
1. set up a GDT
2. set up a IDT
3. create and register handlers(actually the asm-stubs) in IDT
4. configure the PIC
5. mask/unmask IRQ lines of the PIC at needs.
6. register/unregister IRQ-Handlers (the implemenation) at needs.
You see, there is quite some work ere you can start with the Keyboard driver itself - it is as Tim haws pointed out already.
Stay safe and Take time to read the texts
www.osdever.net offers carefully.
Re:Keyboards......
Posted: Wed Mar 24, 2004 3:49 am
by Solar
vbbrett wrote:
Well, grubs not bad. It's just the time it takes to figure and install it!
*Nothing* compared to writing a bootloader that enables protected mode yourself...

Re:Keyboards......
Posted: Wed Mar 24, 2004 4:12 am
by Candy
Solar wrote:
vbbrett wrote:
Well, grubs not bad. It's just the time it takes to figure and install it!
*Nothing* compared to writing a bootloader that enables protected mode yourself...
Must say I've figured out writing a boot sequence before being able to use grub. Could just be my incompatibility with gnu-ish software & manuals

Re:Keyboards......
Posted: Thu Mar 25, 2004 8:25 pm
by vbbrett
Tim Robinson wrote:
4. In your IRQ 1 handler, read a scan code from port 0x60, then acknowledge the interrupt at the PIC.
How do I acknowledge that I have recieved something?
I read from port 0x60 then I'm not sure what to do next?
Brett
Re:Keyboards......
Posted: Fri Mar 26, 2004 2:54 am
by bubach
Maybe you should download M?bius and/or Clicker and check how they did it?
/ Christoffer
Re:Keyboards......
Posted: Fri Mar 26, 2004 5:39 am
by Pype.Clicker
vbbrett wrote:
Tim Robinson wrote:
4. In your IRQ 1 handler, read a scan code from port 0x60, then acknowledge the interrupt at the PIC.
How do I acknowledge that I have recieved something?
I read from port 0x60 then I'm not sure what to do next?
Brett
or simply read an interrupt tutorial (there are some on Bona Fide) and discover outport(0x20,0x20) ;D