2011-10-25 29 views
1

我正在使用N450板(Intel Atom),Eclipse作爲IDE,我在C和AT編碼中使用匯編代碼。APIC定時器代碼不工作?

我嘗試在週期模式,並與我ISR_55

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使用API​​C定時器就像是對現在:

isr0x55: 
    cli 
    sti 
    iret 

我可以看到定時器計數變化值(I檢查寄存器0xFEE00390),但ISR永遠不會被調用(我已經把一箇中斷點!!!)。

我忘了設置一些東西嗎?我怎麼能確定每件事情都是正確的?

回答

1

我已通過使用EOI寄存器來重置ISR寄存器來解決該問題。

+0

恭喜! –

+0

10x Alex,...... –