Page 1 of 1

ACPI or MP config

Posted: Tue Apr 27, 2010 6:22 pm
by gerryg400
Hi, I just tested my kernel on a Quad core, hyperthreaded Xeon machine and it failed to load because this machine doesn't have MP config tables. It only has ACPI tables. I guess I know what I'll be working on tonight!!!

Anyway, some machines seem to have both MP config tables and ACPI tables. If both exist which one should I read ?

tia

- gerryg400

Re: ACPI or MP config

Posted: Tue Apr 27, 2010 7:05 pm
by quok
Read both. Rely on ACPI first, and use the MP config tables as a fallback.

Of course, just because both exist doesn't mean that they're both correct, either. The ACPI tables may be broke in some way, in which case you'd again want to fall back on the MP config tables. Just make sure you verify checksums for all tables and such.

Re: ACPI or MP config

Posted: Tue Apr 27, 2010 8:35 pm
by gerryg400
Quok,

Thanks, I'll go with that. Read ACPI first then MP config.

Continuing, currently I get my memory config from grub multiboot structure. Is that the best way. I think I can also see the memory map in the MP config tables. Which should I use ?

- gerryg400

Re: ACPI or MP config

Posted: Wed Apr 28, 2010 10:35 pm
by bewing
Use the grub multiboot header. It comes from Int15h eax=e820 -- there is no way any other table could get more accurate than the e820 info. And the MP tables are technically obsolete -- so you shouldn't rely on anything from them, unless you have to. That is, only use MP table info as a fallback, after other sources fail.

Re: ACPI or MP config

Posted: Wed Apr 28, 2010 11:04 pm
by gerryg400
Thanks bewing.so it's

Code: Select all

void get_system_info() {

    mem_config = read_multiboot_tables();
    if (acpi_found()) {
        other_config = read_acpi_tables();
    }
    else if (mp_table_found()) {
        other_config = read_mp_config();
    }
    else {
        other_config = manual_config();
    }
}
- gerryg400