P
P
Ponteley2022-02-05 19:19:33
assembler
Ponteley, 2022-02-05 19:19:33

How to properly initialize an interrupt controller?

Projected interrupt table and loaded limit and base into idtr. I wrote a timer interrupt handler, wrote down its address in the table as the 20th element. When this handler is called via the int 20h command, the handler executes its own and the kernel continues its work. Also initialized pic with the following commands

mov        al,0x11       
        out        20h,al
        out        0A0h,al
        mov      al,0x20        
        out        21h,al
        mov      al,0x28       
        out        0A1h,al
        mov      al,04h           
        out        21h,al
        mov      al,02h            
        out        0A1h,al
        mov      al,1        
        out        21h,al
        mov      al,1      
        out        0A1h,al

Essentially pic should generate interrupts 18 times per second, but it doesn't. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2022-02-05
@Ponteley

Essentially pic should generate interrupts 18 times per second

In fact, not a PIC, but a timer. And in your code it is not clear how you initialized the timer, nor that the timer interrupt is allowed in the PIC.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question