ACPI or MP?
- samueldotj
- Member
- Posts: 32
- Joined: Mon Nov 13, 2006 12:24 am
ACPI or MP?
I am thinking of implementing a multiprocessing kernel. I want to know which specification I should read - ACPI or MP?
I started reading MP but confused by some threads, that ACPI superseds MP. Although I can go through the ACPI spec and clear that out, I just want a quick clarification.
Thanks
Sam
I started reading MP but confused by some threads, that ACPI superseds MP. Although I can go through the ACPI spec and clear that out, I just want a quick clarification.
Thanks
Sam
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
MP Tables are a good way to start and are extremely simple to parse and get useful information from. I was able to do everything except start APs in under a hundred lines of C code, which isn't bad (I still have to get around to starting the things ).
ACPI can be implemented once MP Tables are done and you know that your multiprocessor code works. Having both means you have maximum compatibility.
ACPI can be implemented once MP Tables are done and you know that your multiprocessor code works. Having both means you have maximum compatibility.
They're really not that much easier than parsing the ACPI tables. Not to mention that the MP spec is seriously out of date and doesn't always report things like multiple cores correctly. I've seen more than one machine where the MP tables did not match the ACPI tables. For example, a dual core dual proc machine, where the MP tables reported two single core CPUs, but the MADT showed all 4 cores.lukem_95 wrote:Im thinking of doing the same thing.
i think MP tables seem easier, and are whats advised in the intel spec.
In short, implement both, but rely on ACPI over the MP tables.
When I read ACPI tables and I know there are (for example) two CPUs. What must I do?quok wrote:They're really not that much easier than parsing the ACPI tables. Not to mention that the MP spec is seriously out of date and doesn't always report things like multiple cores correctly. I've seen more than one machine where the MP tables did not match the ACPI tables. For example, a dual core dual proc machine, where the MP tables reported two single core CPUs, but the MADT showed all 4 cores.lukem_95 wrote:Im thinking of doing the same thing.
i think MP tables seem easier, and are whats advised in the intel spec.
In short, implement both, but rely on ACPI over the MP tables.
Are there any differences between multitasking for single core and multitasking for multiple core?
However, have you any source code about ACPI parsing? I read RSDP table, and after?
I've got some code that'll look at the ACPI tables and the MP tables and decide which to use. I can PM it to you once I get home from work.MarkOS wrote: When I read ACPI tables and I know there are (for example) two CPUs. What must I do?
Are there any differences between multitasking for single core and multitasking for multiple core?
However, have you any source code about ACPI parsing? I read RSDP table, and after?
- zaleschiemilgabriel
- Member
- Posts: 232
- Joined: Mon Feb 04, 2008 3:58 am
Hi,
In general you'd use ACPI *or* MP specification (but not both at the same time). For example, your OS might check if ACPI tables are present and use them if they are, but also try to use MP specification tables if ACPI tables aren't present.
Cheers,
Brendan
The MADT ACPI table has the same information as the MP specification for detecting and starting CPUs (except for differences involving hyper-threading, where MP specification only reports the first logical CPU in the core and ACPI reports all logical CPUs).zaleschiemilgabriel wrote:So you have to use data from the MADT ACPI table and apply it to the MP spec to use multiprocessing? Or does ACPI have it's own initialization methods?
In general you'd use ACPI *or* MP specification (but not both at the same time). For example, your OS might check if ACPI tables are present and use them if they are, but also try to use MP specification tables if ACPI tables aren't present.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- zaleschiemilgabriel
- Member
- Posts: 232
- Joined: Mon Feb 04, 2008 3:58 am
Thanks Brendan. That makes a little bit more sense now, but what I meant to ask about was the part of the Intel MP spec where it describes how the operating system initializes each processor, not the enumeration of the processors. The MP spec says that to initialize a processor other than the BSP, you have to send it an "INIT IPI". Does that apply to the ACPI spec? I mean - does ACPI provide a different way of initializing processors?
DeviOuS - what a stupid name
Ok thank you!quok wrote:I've got some code that'll look at the ACPI tables and the MP tables and decide which to use. I can PM it to you once I get home from work.MarkOS wrote: When I read ACPI tables and I know there are (for example) two CPUs. What must I do?
Are there any differences between multitasking for single core and multitasking for multiple core?
However, have you any source code about ACPI parsing? I read RSDP table, and after?
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Quok when do you send me your code?
However I'm writing something to handle MPS:
Is this good?
However I'm writing something to handle MPS:
Code: Select all
unsigned int *address = (unsigned int*)0x0000040E;
while(address < (address+1024))
{
if(*address == '_MP_')
{
mp.signature = *address;
mp.config = *(address+4);
mp.length = *(unsigned char*)(address+8);
mp.version = *(unsigned char*)(address+9);
mp.checksum = *(unsigned char*)(address+10);
mp.features1 = *(unsigned char*)(address+11);
mp.features2 = *(unsigned char*)(address+12);
mp.features3[0] = *(unsigned char*)(address+13);
mp.features3[1] = *(unsigned char*)(address+14);
mp.features3[2] = *(unsigned char*)(address+15);
if(mp.length != 0)
if((mp.signature+mp.mpconfig+mp.length+mp.version+mp.checksum+mp.features1+mp.features2+mp.features3[0]+mp.features[1]+mp.features[2]) == 0)
break;
}
}
//Se non l'ha ancora trovato cerca nella memoria ROM del BIOS tra 0xF0000 e 0xFFFFF
if(address == address+1024)
{
address = (unsigned int*)0xF0000
while(address < 0xFFFFF)
{
if(*address = '_MP_')
{
mp.signature = *address;
mp.config = *(address+4);
mp.length = *(unsigned char*)(address+8);
mp.version = *(unsigned char*)(address+9);
mp.checksum = *(unsigned char*)(address+10);
mp.features1 = *(unsigned char*)(address+11);
mp.features2 = *(unsigned char*)(address+12);
mp.features3[0] = *(unsigned char*)(address+13);
mp.features3[1] = *(unsigned char*)(address+14);
mp.features3[2] = *(unsigned char*)(address+15);
if(mp.length != 0)
if((mp.signature+mp.mpconfig+mp.length+mp.version+mp.checksum+mp.features1+mp.features2+mp.features3[0]+mp.features[1]+mp.features[2]) == 0)
break;
}
}
}