My keyboard handler works only once (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
j4cobgarby
Member
Member
Posts: 64
Joined: Fri Jan 26, 2018 11:43 am

My keyboard handler works only once (keyboard buffer full)

Post 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!
j4cobgarby
Member
Member
Posts: 64
Joined: Fri Jan 26, 2018 11:43 am

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

Post by j4cobgarby »

update: I think I might've worked it out, wait a minute...
j4cobgarby
Member
Member
Posts: 64
Joined: Fri Jan 26, 2018 11:43 am

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

Post 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 :)
Post Reply