IRQ's not working on Socket A computers
Posted: Sun Jan 07, 2007 6:32 am
Hi,
In the context of compatability checks i have recently been testing my OS on my development machine. However, I do not get any IRQ's and consequently the kernel can not complete startup.
The problem is, all my other computers work perfectly (including 486s), except for this one. I've cross-checked it with one other AMD system, and my brother's computer also showed exactly the same symptoms. (No IRQs)
The only common denominator i can find between the two is that both are Socket A motherboards, and thus a similar generation of processors (Athlon XP vs Sempron). All my intels and my Athlon64 generate IRQs as expected.
Things i've tried:
- I've added some spare EOIs after the STI instruction in case the PIC was waiting for one
- I've checked that it isn't accidentally firing in the wrong range
Source code involved:
PIC initialisation
PIT code: (lpgTickCount returns the amount of IRQs from the PIT)
All sources can be viewed online:
[ Source Browser ] [ Kernel ]
In the context of compatability checks i have recently been testing my OS on my development machine. However, I do not get any IRQ's and consequently the kernel can not complete startup.
The problem is, all my other computers work perfectly (including 486s), except for this one. I've cross-checked it with one other AMD system, and my brother's computer also showed exactly the same symptoms. (No IRQs)
The only common denominator i can find between the two is that both are Socket A motherboards, and thus a similar generation of processors (Athlon XP vs Sempron). All my intels and my Athlon64 generate IRQs as expected.
Things i've tried:
- I've added some spare EOIs after the STI instruction in case the PIC was waiting for one
- I've checked that it isn't accidentally firing in the wrong range
Source code involved:
PIC initialisation
Code: Select all
InitializePIC: MOV AL, PIC_ICW1_INIT | PIC_ICW1_ICW4
OUT PIC1_COMMAND, AL
Call HardwareDelay
MOV AL, 0x20 ; ICW 2 = base vector
OUT PIC1_DATA, AL
Call HardwareDelay
MOV AL, 1 << 2 ; ICW 3 = slaves connected
OUT PIC1_DATA, AL
Call HardwareDelay
MOV AL, PIC_ICW4_8086 ; ICW 4 = operation mode
OUT PIC1_DATA, AL
Call HardwareDelay
MOV AL, 0x0 ; OCW 1 = mask
OUT PIC1_DATA, AL
Call HardwareDelay
; program chip: PIC2
MOV AL, PIC_ICW1_INIT | PIC_ICW1_ICW4
OUT PIC2_COMMAND, AL
Call HardwareDelay
MOV AL, 0x28 ; ICW 2 = base vector
OUT PIC2_DATA, AL
Call HardwareDelay
MOV AL, 0 ; ICW 3 = slaves connected
OUT PIC2_DATA, AL
Call HardwareDelay
MOV AL, PIC_ICW4_8086 ; ICW 4 = operation mode
OUT PIC2_DATA, AL
Call HardwareDelay
MOV AL, 0x0 ; OCW 1 = mask
OUT PIC2_DATA, AL
Call HardwareDelay
MOV EBX, [lpgTextPtr]
MOV word [EBX], 0x0750
ADD EBX, 2
MOV word [EBX], 0x0749
ADD EBX, 2
MOV word [EBX], 0x0743
ADD EBX, 2
MOV word [EBX], 0x0720
ADD EBX, 2
MOV [lpgTextPtr], EBX
RET
Code: Select all
InitializePIT: MOV EBX, [lpgTextPtr]
MOV word [EBX], 0x0700 + 'P' ; P: starting procedure
ADD EBX, 2
MOV AL, PIT_CW_CHAN0 | PIT_CW_LOHI | PIT_CW_RATE | PIT_CW_BINARY
OUT PIT_COMMAND, AL ; write the mode to the PIT
Call HardwareDelay
MOV AX, 10000
OUT PIT_CHAN0, AL
Call HardwareDelay
MOV AL, AH
OUT PIT_CHAN0, AL
Call HardwareDelay
; test if the PIT works
MOV dword [lpgTickCount], 0
MOV word [EBX], 0x0700 + '0' ; P0: entering test
.check1: CMP dword [lpgTickCount], 0
JE .check1
; The kernel does not reach this
MOV word [EBX], 0x0700 + '1' ; P1: PIT fired once
.check2: CMP dword [lpgTickCount], 1
JE .check2
MOV word [EBX], 0x0700 + '2' ; P2: PIT fired twice
.check3: CMP dword [lpgTickCount], 2
JE .check3
; once we get here, the PIT is pretty much stable:
; display completion
MOV word [EBX], 0x0700 + 'I'
ADD EBX, 2
MOV word [EBX], 0x0700 + 'T' ; PIT: initialization ok
ADD EBX, 2
MOV word [EBX], 0x0720
ADD EBX, 2
MOV [lpgTextPtr], EBX
RET
[ Source Browser ] [ Kernel ]