[SOLVED] problem with IRQs "internal keyboard buffer full"

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.
Post Reply
rdtsc
Posts: 7
Joined: Fri Oct 29, 2010 2:04 pm
Location: France

[SOLVED] problem with IRQs "internal keyboard buffer full"

Post by rdtsc »

Hi everyone :)

I have (again) a problem with my operating-system.

I wanted to implement IRQs so I wrote a code which sets up the idt and adds ISRS.

The software interrupts work, but the hardware don't.

For exemple, If my code is "int 0x42" it will display "Interrupt 0x42", but if I get an exception from the keyboard, I'll only have messages in bochs such as :
00651280000i[KBD ] internal keyboard buffer full, ignoring scancode.(a7)
http://www.reactos.org/bugzilla/show_bug.cgi?id=1111
http://f.osdev.org/viewtopic.php?f=2&t= ... b&start=15

After reading that, I tested with qemu and ... it still doesn't work so I can't accuse bochs :)

The gate descriptor is correctly loaded :
<bochs:9> info idt 33
Interrupt Descriptor Table (base=0x00101720, limit=7968):
IDT[0x21]=32-Bit Interrupt Gate target=0x0008:0x00100326, DPL=0
And if I put some breakpoints, I can see that actually, the OS enters the code of interrupt 0x42 but never the code wich belongs to the keyboard interrupt.

The file dealing with idt :
http://x86.pastebin.com/MU81AeH7

The file dealing with 8259A :
http://x86.pastebin.com/uP6kEFCq

The kernel :
http://x86.pastebin.com/PHts9yss

Could you please help me? :)

thank you
Last edited by rdtsc on Sun Oct 31, 2010 11:12 am, edited 1 time in total.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Re: problem with IRQs "internal keyboard buffer full"

Post by hailstorm »

Where is your keyboard initialization code?
rdtsc
Posts: 7
Joined: Fri Oct 29, 2010 2:04 pm
Location: France

Re: problem with IRQs "internal keyboard buffer full"

Post by rdtsc »

"init code"?

erm, I tought there was no need to code such "initialization". By the way, in the codes I read, there's no such code.

My idea is to :

-set up the IDT
-configure the 8259A and remap the IRQs so as to have the 32nd entry of the IDT corresponding to IRQ0 (timer) and the 33rd corresponding to IRQ1 (keyboard)
-then, I set up the ISRs with fill_gate(). I associate an IDT entry to a function. For exemplen the entry 0x42 points to int_42().

For me, when there is an IRQ1, I'll enter the corresponding ISR even though I don't use the scan codes. For that, I'll then use the 8042 to receive scan codes on the port 0x60.

(but at the moment, I don't do anything with keayboard, I just wan't to now when there is an hardware interrupt. My code works only for exceptions and software interrupts)
rdtsc
Posts: 7
Joined: Fri Oct 29, 2010 2:04 pm
Location: France

Re: problem with IRQs "internal keyboard buffer full"

Post by rdtsc »

ohhh. I *must* actually use the datas sent by the hardware.

*gonna code what's missing*

(thank you for your answer btw :) )
rdtsc
Posts: 7
Joined: Fri Oct 29, 2010 2:04 pm
Location: France

Re: problem with IRQs "internal keyboard buffer full"

Post by rdtsc »

It works!!! Wouhou :mrgreen: :mrgreen: :mrgreen: :mrgreen:

I'm gonna post my code don't worry

edit :

You can see the modifications here.

Code: Select all

void isr_kbd(void)
{
    char i;
    i=inb(0x60);
    char *video;
    video=(char*)0xB8000;
    *video='Z';
    *(video+1)=0x07;
}

Code: Select all

extern isr_kbd
global irq0

irq0:

    call isr_kbd
    mov al,0x20
    out 0x20,al
    iret

Code: Select all

   fill_gate(&idt[33], irq0, 0x8, INTERRUPT_GATE, 0);
Post Reply