Hi,
digo_rp wrote:
but do you know the best way to discover if acpi is using apic or picm without an interpreter?
This is a bit backwards - typically you don't discover what ACPI is using; the OS decides what it wants to use (e.g. using FADT to determine if PIC chips exist, using MADT to determine of IO APICs exist) and then tells ACPI what it wants to use. If the OS doesn't tell ACPI that it wants to use IO APICs; then (if PIC chips exist) ACPI assumes the OS will be using PIC chips and won't be using IO APICs at all.
It's also not going to help much - you will need "something" to determine (and possibly reconfigure) IRQ routing, and to switch to different sleep states, and to control fan speeds, and to handle various events (to wake the OS up, to inform it a device was inserted, ...) and for many other things. Trying to figure out "PIC or IO APIC" without an AML interpreter today just postpones the problem until tomorrow when you want to do everything else without an AML interpreter.
There's are only 4 actual solutions that I know of:
- Use an AML interpreter (e.g. port ACPICA)
- Spend ages researching and implementing an "AML to native" compiler so that you can convert the AML to native and execute it without an interpreter. Note: This doesn't make much sense because AML isn't performance critical, the native compiler won't be portable, and AML is only part of the problem anyway.
- Write a motherboard driver for every motherboard (most likely based on any motherboard/chipset datasheet you can get your hands on combined with a disassembly of the motherboard's AML)
- Don't use ACPI at all (and rely on backward compatibility), which means no power management, no IO APIC, no hot-plug PCI, ...
digo_rp wrote:
Because using virtualbox with PIIX3 chipset with IOAPIC, just work PIC 8259 ISA Interrupt routed to PCI. and when I change to ICH9, then I can use APIC Interrupts.
example: my network card is at legacy IRQ 9 PIN 1 <- INTA, with PIIX3 with IOAPIC, with apic enable, all pci are routed to PIC 8259 ISA IRQ.
The worse type of bug a programmer can have is "works by accident" because there's no symptoms to tell the programmer that their code is completely wrong.
If VirtualBox uses "IO APIC input number = legacy PIC input number" then that's just a trap to lead unsuspecting victims towards "works by accident" bugs.
Cheers,
Brendan