OSDev.org
https://forum.osdev.org/

Replacement int 0x9 or 0x8
https://forum.osdev.org/viewtopic.php?f=1&t=25656
Page 1 of 1

Author:  cybek [ Wed Aug 15, 2012 10:47 am ]
Post subject:  Replacement int 0x9 or 0x8

Hi.
I have problem with replacing interrupt 0x8 and 0x9. After my changes to IVT and enabling interrupts (sti), my functions are called only once. Int 0x8 should be called 18.2 times per second, but it isn't. I'm using qemu.
Here's my code:
Code:
; Interrupt handler
INT_0x8:
   pusha
   call   Test   
   popa
   iret

[...]

; Install 0x8 IRQ0
   mov   bx, 0x8*4
   mov   word [es:bx], INT_0x8
   mov   word [es:bx+2], 0

[...]

; My loop
   sti   
_Test:
   call   Test
   hlt
   jmp   _Test
   
   hlt
   jmp   $
   
LastKey db '<'
TestID dw 0
Test:
   mov   bx, 0xB800
   mov   es, bx
   mov   bx, [TestID]
   mov   al, [LastKey]
   mov   byte [es:bx], al
   mov   byte [es:bx+1], 0xA0
   add   word [TestID], 2
   ret

Anyone can help me?

Author:  Nable [ Wed Aug 15, 2012 11:30 am ]
Post subject:  Re: Replacement int 0x9 or 0x8

What about sending EOI (End Of Interrupt) to interrupt controller?

Author:  cybek [ Wed Aug 15, 2012 11:52 am ]
Post subject:  Re: Replacement int 0x9 or 0x8

Hah, works. Thank you very much :) I didn't know that IRQs need special care.

Author:  bluemoon [ Wed Aug 15, 2012 12:12 pm ]
Post subject:  Re: Replacement int 0x9 or 0x8

note that you trash es in the interrupt handler.

Author:  cybek [ Mon Aug 19, 2019 4:50 pm ]
Post subject:  Re: Replacement int 0x9 or 0x8

bluemoon wrote:
note that you trash es in the interrupt handler.

I know that it was many years ago, but I have never said thank you. I've read this post and fixed this, but I didn't manage to write to you. And it was bad, because you spent time reading my code. Sorry and thank you :)

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/