APIC定时器代码不起作用?

时间:2011-10-25 20:11:51

标签: assembly

我使用的是N450主板(Intel Atom),Eclipse是IDE,我使用C和AT& T编写汇编代码。

我尝试在周期模式和ISR_55上使用API​​C Timer

InitTickISR:
    push    %ebp    //save the context to swith back
    mov     %esp,%ebp

// Divide Configuration Register (for Timer) addr : FEE0 03E0 <-
    movl    $0xFEE003E0, %eax
    movl    $0x3, (%eax)//0x3:Divided by 16, 0xA :divide by 128

// Initial Count addr : FEE0 0380 <- 0x1000
    movl    $0xFEE00380,%eax
    movl    $0x100, (%eax)

// LVT(Local Vector Table) Timer Register (FEE0 0320H) -- Interrupt 0x55
    movl    $0xFEE00320, %eax
    movl    $0x20055, (%eax)//2: periodic mode, 01:one shot
                            //55: interruption
// Enable local APIC addr : FEE0 00F0 <- 0x100
    movl    $0xFEE000F0, %eax
    movl    $0x100, (%eax)    

    pop     %ebp //Return to the calling function
    ret

ISR就像现在一样:

isr0x55:
    cli
    sti
    iret

我可以看到计时器计数更改值(我检查寄存器0xFEE00390),但ISR永远不会被调用(我已经在其中设置了一个断点!!!)。

我忘记了什么吗?我怎么能确定每件事都设置为相关的?

1 个答案:

答案 0 :(得分:1)

我已通过使用EOI寄存器来重置ISR寄存器来解决此问题。