views:

421

answers:

3

What x86-64 instructions are used to enable/disable other cores/processors and how does one start executing code on them?

Is there documentation somewhere on how this is done by the operating system?

A: 

There are probably documentation from Intel/AMD on Model Specific Registers that you can set to do specific things like that. I'm not sure whether you have access to it unless you're writing something that sits at the kernel level...

Calyth
+1  A: 

Pretty painful to get an x86 up and going... it is not so much in the cores as in the APIC system. You need to look into the docs for your chipset, tends to be pretty much hidden unfortunately.

You will have to be at the kernel level, definitely. Looking at Linux sounds like a good idea.

jakobengblom2
A: 

Assuming you're talking about implementing a kernel....

My understanding is it's largely based on this document:

If memory serves me right (no pun intended), to detect multi-processor support you scan certain ranges of memory for a magic set of bytes that the firmware set up for you. From there you can walk the structures that describe the CPUs, and you can talk to the APIC controller about setting up interrupts on various CPUs, etc.

asveikau