now my local APIC and 8259 works together smoothly in x86_64 mode.And i hope to get my IOAPIC to work.but i found it is so hard to get some practical information.i've searched here for long.
i read the MultiProcessorSpecificationV1.4. but i got only these:
so,does it mean these code will enable the IOAPIC and disable i8259 or do i have to do smth more?The IMCR is supported by two read/writable or write-only I/O ports, 22h and 23h, which receive address and data respectively. To access the IMCR, write a value of 70h to I/O port 22h, which selects the IMCR. Then write the data to I/O port 23h. Writing a value of 01h forces the NMI and 8259 INTR signals to pass through the APIC.When the operating system is ready to switch to MP operation, it writes a 01H to the IMCR register, if that register is implemented, and enables I/O APIC Redirection Table entries. The hardware must not require any other action on the part of software to make the transition to Symmetric I/O mode.
Code: Select all
mov al,0x70
out 0x22,al
mov al,0x01
out 0x23,al
but the most cofusing thing i think is,
is there a fixed base address in x86(_64) or could i get the base address from a simple way? (say,not to search so much place for the stuctures metioned in MPSpecification?)The default base address for the first I/O APIC is 0FEC0_0000h.Non-default APIC base addresses can be used if the MP configuration table is provided.
and where should i send the EOI ? to the local APIC or somewhere in IOAPIC? i can't find it.
i'm working on it.and i'll appreciate it if someone help me with these problems.
thx