Assembly and multicore CPUs

空扰寡人 提交于 2019-12-05 19:00:37

问题


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?


回答1:


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.




回答2:


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

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

  • Intel Multiprocessor Specification

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.




回答3:


I know this is an old question, but here's a more recent reference to intel multicore chips.

http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.html

Link found on: http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html




回答4:


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



来源:https://stackoverflow.com/questions/1516530/assembly-and-multicore-cpus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!