OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 5:34 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Strange interrupt problem
PostPosted: Sun Sep 23, 2001 11:00 pm 
I have strange problem: IRQ0 interrupts just one
time. Just one interrupt and no more!
My code works fine in Real Mode, but not in PM.
All I do is:
1) Settin Up PM
2) Reprogramming PIC (a=0x20, b=0x70)
3) Disabling all, but IRQ0
4) Looping for few seconds
5) Quiting application

Here some code parts:
;---
; PIC reprogramming Code
;---
mov al, 00010001b
out 0x20, al
mov al, 0x20
out 0x21, al
mov ax, 00000100b
out 0x21, al
mov ax, 00000001b
out 0x21, al
mov al, 00010001b
out 0xa0, al
mov al, 0x70
out 0xa1, al
mov al, 0000010b
out 0xa1, al
mov al, 0000001b
out 0xa1, al

mov al, 0xfe
out 0x21, al
mov al, 0xff
out 0xa1, al

;---
; Interrupt Gate
;---
int20:
push es
push eax
push ebx

mov ax, LINEAR_SEL
mov es, ax

xor eax, eax
mov al, [tim]
mov byte [es:0xb8008], al
inc al
mov [tim], al

pop ebx
pop eax
pop es
sti
iret

tim db 0x00

;---
; Part-o-IDT
;---
dw int20
dw SYS_CODE_SEL
db 0x00
db 0x8e
dw 0x0000


Top
  
 
 Post subject: RE:Strange interrupt problem
PostPosted: Sun Sep 23, 2001 11:00 pm 
maybe you forgot to tell the pic that your isr
has finished and that it can generate further
interrupts. just do this at the end of your isr:
send 0x20 to your first pic (in your case 0x20) and send
0x20 to your second pic (in your case 0x70)
let me know if this worked


Top
  
 
 Post subject: RE:Strange interrupt problem
PostPosted: Sun Sep 23, 2001 11:00 pm 
>maybe you forgot to tell the pic that your isr
>has finished and that it can generate further
>interrupts. just do this at the end of your isr:
>send 0x20 to your first pic (in your case 0x20) and send
>0x20 to your second pic (in your case 0x70)
>let me know if this worked

Ow yeah! It works! I have sent 0x20(interrupt addres)
to first PIC(1st=0x20).
Do I allways have to send IRQ interrupt addres
to PIC? Why I didn't have to do the same trick
in real mode?


Top
  
 
 Post subject: RE:Strange interrupt problem
PostPosted: Sun Sep 23, 2001 11:00 pm 
>On 2001-09-24 06:13:44, Iwabee wrote:
>>maybe you forgot to tell the pic that your isr
>>has finished and that it can generate further
>>interrupts. just do this at the end of your isr:
>>send 0x20 to your first pic (in your case 0x20) and send
>>0x20 to your second pic (in your case 0x70)
>>let me know if this worked
>
>Ow yeah! It works! I have sent 0x20(interrupt addres)
>to first PIC(1st=0x20).
yes, i think that in pmode, you always have to tell the pic
that you finished your isr. don't know why this has not to be done in
rmode. anyone out who knows about this behavior ?
>Do I allways have to send IRQ interrupt addres
>to PIC? Why I didn't have to do the same trick
>in real mode?


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: Majestic-12 [Bot] and 211 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