OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Sep 17, 2019 3:34 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Replacement int 0x9 or 0x8
PostPosted: Wed Aug 15, 2012 10:47 am 
Offline

Joined: Tue Dec 27, 2011 4:41 pm
Posts: 11
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?


Top
 Profile  
 
 Post subject: Re: Replacement int 0x9 or 0x8
PostPosted: Wed Aug 15, 2012 11:30 am 
Offline
Member
Member

Joined: Tue Nov 08, 2011 11:35 am
Posts: 453
What about sending EOI (End Of Interrupt) to interrupt controller?


Top
 Profile  
 
 Post subject: Re: Replacement int 0x9 or 0x8
PostPosted: Wed Aug 15, 2012 11:52 am 
Offline

Joined: Tue Dec 27, 2011 4:41 pm
Posts: 11
Hah, works. Thank you very much :) I didn't know that IRQs need special care.


Top
 Profile  
 
 Post subject: Re: Replacement int 0x9 or 0x8
PostPosted: Wed Aug 15, 2012 12:12 pm 
Offline
Member
Member
User avatar

Joined: Wed Dec 01, 2010 3:41 am
Posts: 1761
Location: Hong Kong
note that you trash es in the interrupt handler.


Top
 Profile  
 
 Post subject: Re: Replacement int 0x9 or 0x8
PostPosted: Mon Aug 19, 2019 4:50 pm 
Offline

Joined: Tue Dec 27, 2011 4:41 pm
Posts: 11
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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], titanzero and 10 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group