汇编和多核 CPU
哪些 x86-64 指令用于启用/禁用其他内核/处理器以及如何开始在它们上执行代码?
是否有关于操作系统如何完成此操作的文档?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
假设您正在谈论实现内核......
我的理解是它很大程度上基于此文档:
如果我没记错的话(没有双关语),要检测多处理器支持,您需要扫描某些内存范围以获取固件为您设置的一组神奇字节。从那里您可以了解描述 CPU 的结构,并且可以与 APIC 控制器讨论在各种 CPU 上设置中断等。
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.
我知道这是一个老问题,但这里有一个关于英特尔多核芯片的最新参考。
http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-3a-part -1-manual.html
链接位于:http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
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
让 x86 启动并运行是相当痛苦的……与其说是在内核中,不如说是在 APIC 系统中。您需要查看芯片组的文档,不幸的是,这些文档往往被隐藏起来。
当然,你必须处于内核级别。研究 Linux 听起来是个好主意。
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.
Intel/AMD 可能有关于模型特定寄存器的文档,您可以设置它们来执行类似的特定操作。我不确定你是否有权访问它,除非你正在编写位于内核级别的东西......
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...