OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 6:38 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: prob about 8259A reprog , pls come in
PostPosted: Sat Dec 22, 2001 4:08 am 
Codes about 8259A are :(from Christopher Giese,a bit changed)
   mov al,0x11  ; icw1-->11:icw4 is needed
   out 0x20,al
   out 0xa0,al
   mov al,0x20  ; icw2:vector for IRQs begining
   out 0x21,al        ; IRQ0-IRQ7 -> interrupts 0x20-0x27
   add al,8
   out 0xa1,al
   mov al,4     ; icw3
   out 0x21,al
   mov al,2
   out 0xa1,al
   mov al,1fh   ; icw4
   out 0x21,al
   mov al,1bh
   out 0xa1,al
   mov al,0xFc  ;ocw
   out 0x21,al
and Codes for INT 21:
 int_21:
   mov si,msg_int20  ; 'Pressed key...'
   inc dh     ;dh->row for display
   call Print ;routine for video output,param with dx & si.
   in al,60h
   iretd
when I press a key, it display the message twice, like this:
Pressed key...

                                    Pressed key...
and it was no responds when press again.

thanks.
user4


Top
  
 
 Post subject: Re: prob about 8259A reprog , pls come in
PostPosted: Mon Dec 24, 2001 2:54 pm 
you get two messages because key down + key release each generate one.

so

a) press key down -> msg1
b) release the key -> msg2


Top
  
 
 Post subject: Re: prob about 8259A reprog , pls come in
PostPosted: Mon Dec 24, 2001 2:55 pm 
and you need to signal EOI, which your interrupt handler does not do.


Top
  
 
 Post subject: Re: prob about 8259A reprog , pls come in
PostPosted: Tue Dec 25, 2001 1:18 am 
thanks.

>a) press key down -> msg1
>b) release the key -> msg2
but the message is in wrong position,why?

>and you need to signal EOI, which your interrupt handler does not do.
I think ICW4 above which equal 1fh means Automatic EOI.
When I add codes to signal EOI to the end of INT21,and change ICW4 to manual EOI,things are not changed. It always display the message twice,and no responds after that.

Merry Christmas for all.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Google [Bot] and 78 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