Page 1 of 1

My keyboard handler works only once (keyboard buffer full)

Posted: Sun Oct 13, 2019 3:07 pm
by j4cobgarby
Here's my keyboard ISR:

Code: Select all

isr_keyboard:
    pusha
    cli

    in al, 0x60
    xchg bx, bx

    mov al, 0x20    ; EOI
    out ICW2_MASTER, al

    mov eax, esp
    add eax, 4
    popa

    sti
    xchg bx, bx
    iret
So I emulate my operating system in bochs, and once it's booted up I press the 'A' key. I know that the ISR runs the first time I press this because bochs stops at the breakpoint. The issue is after exiting the ISR, I try pressing 'A' again, but nothing happens. Does anyone know why this could be the case?

I'd be happy to provide more of my code if necessary.

Thanks!

Re: My keyboard handler works only once (keyboard buffer ful

Posted: Sun Oct 13, 2019 3:19 pm
by j4cobgarby
update: I think I might've worked it out, wait a minute...

Re: My keyboard handler works only once (keyboard buffer ful

Posted: Sun Oct 13, 2019 3:22 pm
by j4cobgarby
Yep, I've fixed it. Just a silly mistake (albeit one that I've been thinking about all day...)
Just got a bit confused with ICW2 :)