flat assembler
Message board for the users of flat assembler.

Index > OS Construction > [SOLVED] IRQ1 not firing?

Author
Thread Post new topic Reply to topic
Aulendil



Joined: 13 Jul 2014
Posts: 14
Aulendil
Hi,

I am trying to incorporate the IRQ1 handler used in this thread http://board.flatassembler.net/topic.php?t=6206&postdays=0&postorder=asc&start=0 but for some reason the keyboard interrupt never gets fired, and I have proved this by trying to halt the cpu under the keyboard label. IRQ0 is working fine and this updates the screen.

I am running it in bochs, do I need to change some additional bochs config for the keyboard?

Any help would be much appreciated.

See post below for solution..


Last edited by Aulendil on 17 Nov 2014, 07:07; edited 1 time in total
Post 16 Nov 2014, 14:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17663
Location: In your JS exploiting you and your system
revolution
Show your code.
Post 16 Nov 2014, 14:43
View user's profile Send private message Visit poster's website Reply with quote
Aulendil



Joined: 13 Jul 2014
Posts: 14
Aulendil
Right as an additional test I have just added the code alongside a basic bootloader and it does the same thing. The clock screen output ticks fine but the keyboard IRQ is not firing when keys are pressed.
Post 16 Nov 2014, 20:30
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
There are a few possibilities here. Is there definitely an IDT entry for IRQ 1? Has it been remapped, if so where? Have you explicitly enabled IRQ 1? Which other IRQs are enabled and are they being serviced? (failure to correctly acknowledge can prevent other IRQs being triggered)
Post 16 Nov 2014, 23:11
View user's profile Send private message Reply with quote
Aulendil



Joined: 13 Jul 2014
Posts: 14
Aulendil
Mystery solved! Originallly I had written a keyboard handler which constantly polled the keyboard input port, but before I started to poll I cleared the keyboard buffer using the below since a user had to enter a command to reach the PM/LM section after booting to RM:

Code:
        clear_buffer:
        in al, 64h
        test al, 1
        jz main_loop
        in al, 60h
        jmp clear_buffer
    


I have added this just before my main LM loop after initializing my PIC / custom interrupts and now IRQ1 is fired and can read from the keyboard buffer. It turns out after some research that if you don't clear the keyboard buffer the keyboard won't raise another IRQ.
Post 17 Nov 2014, 07:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.