ACPI or MP config

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

ACPI or MP config

Post 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
If a trainstation is where trains stop, what is a workstation ?
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: ACPI or MP config

Post 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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: ACPI or MP config

Post 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
If a trainstation is where trains stop, what is a workstation ?
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: ACPI or MP config

Post 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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: ACPI or MP config

Post 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
If a trainstation is where trains stop, what is a workstation ?
Post Reply