IO-APIC
Posted: Mon Feb 20, 2006 1:16 pm
There isn?t much material about the io-apic and how to programe it! So I hope here are some who know how do work with it.
I?ve taken the code from o3one and used it as a start point:
Now I get the following error from Bochs and I think that I?m missing something.
I get this error on and on! I finish my irq function with an EOI to the apic. I could also imagine that I forgot something when configuring the apic!
I?ve taken the code from o3one and used it as a start point:
Code: Select all
;----------------------------
; map irqs 0-15
align 4
.loop@irq0_15:
;---------------------------
; mask irq
mov [edi+ioapic_regs_t.ioregsel],edx
mov [edi+ioapic_regs_t.iowin],IOAPIC_IRQ_MASK
;---------------------------
; write upper half first
add edx,1
mov [edi+ioapic_regs_t.ioregsel],edx
mov [edi+ioapic_regs_t.iowin],IOAPIC_IRQ_DEFAULT_HIGH
;---------------------------
; select lower half
sub edx,1
mov [edi+ioapic_regs_t.ioregsel],edx
;---------------------------
; get the int for the irq
mov eax,[irq2int+4*ecx]
;---------------------------
; set default bits and write lower half
or eax,IOAPIC_IRQ_DEFAULT_LOW
add edx,2
mov [edi+ioapic_regs_t.iowin],eax
;---------------------------
; next irq or we have finished
add ecx,1
cmp dl,30h
jne .loop@irq0_15
;----------------------------
; io-apic ignore loop, will be changed when I know from where I get the ints
mov eax,IOAPIC_IRQ_MASK
align 4
.loop@irq_ignore:
mov [edi+ioapic_regs_t.ioregsel],edx
add edx,2
mov [edi+ioapic_regs_t.iowin],eax
cmp dl,40h
jne .loop@irq_ignore
;----------------------------
; deactivate the PIC
mov al,70h
out 22h,al
mov al,01h
out 23h,al
Code: Select all
00001824027i[IOAP ] vector 0xd0 stuck?