Js2xxx wrote:
Brendan wrote:
This is completely broken - there's no guarantee that the PIC chip/s are connected to LINT0. For example; the PIC chips can be connected to an IO APIC input (configured as "extInt").
So I add this to that code:
Code:
mov rax, 10h
mov ebx, 0FEC00000h
mov [ebx], eax
mov rax, 0
bts rax, 16
mov ebx, 0FEC00010h
mov [ebx], eax
However, it makes little sense.
This would make a little more sense:
Code:
mov dword [0FEC00000h], 10h
mov dword [0FEC00010h], (1 << 16)
However there is no guarantee that the PIC chips are connected to "IO APIC input #0" (and not another IO APIC input), no guarantee that there isn't multiple separate IO APICs, and no guarantee that any of the IO APICs that exist are at that specific address.
My advice is:
- Mask the PIC's IRQs in the PIC chips themselves
- Do "STI" to allow BIOS/firmware/whatever to handle any IRQs that were buffered/postponed before you masked them
- Don't bother using CLI after this because there is no point (all IRQs masked)
- Configure PICs regardless of whether you use them or not; to ensure that spurious IRQs don't cause "interrupt 0x0F" (or "interrupt 0x77") but will use something nicer (like "interrupt 0x37" and "interrupt 0x3F" instead).
Cheers,
Brendan