-2

I am trying to write an os that support multiprocessor, however I don't know how to bootstrap multiprocessor for AMD, and I have searched the AMD homepage to find the MP Specification, but haven't find it, can anyone tells me the link address?

Cœur
  • 37,241
  • 25
  • 195
  • 267
chry
  • 1
  • 2

2 Answers2

1

There are two standards that allows you to get information about logical processors in the system. First is Intel MultiProcessor Specification (MP), second is Advanced Configuration and Power Interface (ACPI).

MP is older and now deprecated. While it still can be used on older machines, where ACPI tables aren't present, it shouldn't be relied upon on newer ones. In fact, when ACPI tables are present, MP tables are not required to be sane and most probably contain garbage; that's probably the reason your code works on 32 bit machines, but not 64 bit ones.

When writing (S)MP code, you should first check if there are ACPI tables available (find RSDP, if XSDT is present, use it, otherwise use RSDT; next, find MADT and parse LAPIC entries of the table to find LAPIC IDs of present logical cores), and only if they are not present fall back to MP.


It doesn't really matter whether the CPU in question is AMD or Intel; they are mostly compatible, except few corner-case incompatible instruction implementations or interpretations. The only thing that can vary between different CPU models is AP booting sequence, but the differences between microarchitectures in this regard are described in Intel and AMD manuals.

Griwes
  • 8,805
  • 2
  • 43
  • 70
0

There doesn't seem to be a version specific to AMD. And I think that's reasonable since AMD's x86 CPUs are supposed to be mostly compatible with Intel x86 CPUs.

Quote from Wikipedia:

The MultiProcessor Specification (MPS) for the x86 architecture is an open standard describing enhancements to both operating systems and firmware, which will allow them to work with x86-compatible processors in a multi-processor configuration.

Use the one from Intel.

Alexey Frunze
  • 61,140
  • 12
  • 83
  • 180
  • But the code I write for 32bit intel cannot be run well for 64bit. In 32bit I can detect multiprocessors correctly,but in 64bit AMD I can only detect one cpu~ – chry Aug 20 '12 at 00:56
  • to be specifically,in the 64bit I can't find the MP Floating Pointer Structure,I just wondering why?can anyone tells me why?the 32 bit code I use is in the following address,http://www.scs.stanford.edu/histar/src/kern/arch/amd64/mp.cThanks in advance~ – chry Aug 20 '12 at 02:08
  • the address is scs.stanford.edu/histar/src/kern/arch/amd64/mp.c – chry Aug 20 '12 at 02:51
  • Most likely you have a bug in your code. I can't tell more and that would be outside of the scope of the original question. – Alexey Frunze Aug 20 '12 at 06:15