汇编和多核 CPU

发布于 2024-08-06 09:14:00 字数 78 浏览 4 评论 0原文

哪些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

っ〆星空下的拥抱 2024-08-13 09:14:00

假设您正在谈论实现内核......

我的理解是它很大程度上基于此文档:

如果我没记错的话(没有双关语),要检测多处理器支持,您需要扫描某些内存范围以获取固件为您设置的一组神奇字节。从那里您可以了解描述 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.

剩余の解释 2024-08-13 09:14:00

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

萌酱 2024-08-13 09:14:00

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文