Bochs).
I have built an IDT, and have a function that changes the ISR for a
certain interrupt number. And I remapped the PICs to 0x20.
Ok, so first of all, I disable interrupts (cli). I change the ISR for the
keyboard, enable the irq (by sending such message to PIC) and finally, I
enable interrupts (sti).
Ok, but if I press a key, sometimes nothing happens.
Still, sometimes I see the proprietage message. Look at my code, this is
the ISR:
Code: Select all
[global int_irq1]
int_irq1:
EXTERN printk
cli
push eax
mov eax, msg
push eax
call printk
mov al,0x20
out 0x20,al
add esp,4
pop eax
sti
iretd
msg dw "IRQ1", "0"
Code: Select all
remap_pics(0x20, 0x28);
printk("PICs remapped: IRQs starting at interrupt 0x20\n\n");
printk("Enabling IRQ1\n");
changeISR(0x21, (void*) int_irq1);
enable_irq(1);
printk("Enabling interrupts...\n");
asm("sti");
might be, that the printk() function is bad. This function does a call to
my own vsprintf() and then to putc(). There is no mutex handling and no
interrupts enable/disable.
Please help me, I'm really stuck with that!
Thanks and regards,
A. Blessing