dvl
dvl

Reputation: 233

Assembly and multicore CPUs

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?

Upvotes: 9

Views: 6236

Answers (4)

asveikau
asveikau

Reputation: 40264

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.

Upvotes: 2

jakobengblom2
jakobengblom2

Reputation: 5888

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.

Upvotes: 0

Calyth
Calyth

Reputation: 1673

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...

Upvotes: -1

Related Questions