开机自检
有什么好地方可以了解 POST 以及如何设计和编码吗? 我是一名 C++ 程序员,对这个术语感到非常困惑。
谢谢
Any good place to learn about POST and how to design and code one? I am a C++ programmer and quite baffeled with the term.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可能想查看 coreboot 的代码,这是一个免费软件(开源)BIOS 项目运行在许多不同类型的硬件上。
You might want to take a look at the code for coreboot, a free software (open source) BIOS project that runs on many different kinds of hardware.
您可以查看 OpenBIOS 项目。
他们有大量开源 BIOS/固件实现的信息。
作为开源,您可以从 svn 获取代码或在线阅读所有这些代码。
You can checkout the OpenBIOS project.
They have information on numberous opensource bios/firmware implementations.
Being open source you can grab the code from svn or read it online for all of them.
BIOS? 这在嵌入式世界中并不常见,人们仍然在嵌入式世界中编写 POST。 通常,它们发生在操作系统本身启动之前,或者在操作系统启动时发生。
目标是确定设备是否可以运行、在降级模式下运行或者是否应该发出故障信号。 典型的顺序是测试 CPU 和 XIP 闪存,然后是内存、固定硬件,最后是可选硬件。 您定义一系列测试。 测试具有启动函数和检查函数。 启动函数启动测试; 检查轮询以查看结果是否可用。 测试具有依赖性,测试控制器启动那些依赖性已经通过的测试(CPU 和 RAM 是特殊情况,如果它们被破坏,那么拥有一个好的测试控制器是不可行的)。
正如您可以从 CPU 和 RAM 测试中推断出的那样,您没有 C++ 的优势。 您甚至不能假设您可以使用所有 C。在 POST 的第一部分中,您甚至可能没有堆栈(!)
BIOS? That's not too common in the embedded world, the one place where people still write POSTs. Typically, they happen before the OS itself starts, or alternatively, as the OS starts.
The goal is to figure out whether the device can run, run in degraded mode, or should signal malfunction. A typical sequence is test CPU and XIP flash, then memory, fixed hardware, and then optional hardware. You define a series of tests. A test has a start function and a check function. The start functions kicks off the test; the check polls to see if a result is already available. Tests have dependencies, and the test controller starts those tests for which the dependencies have passed (CPU and RAM being the special cases, if they're broken it's not feasible to have a nice test controller).
As you can infer from the CPU and RAM tests, you don't have the luxury of C++. You can't even assume you can use all of C. During the first part of the POST, you might not even have a stack (!)
开源 EFI BIOS,带有文档和规格(很好的学习方法):
https://www.tianocore.org/< /a>
Open source EFI BIOS, with documentation and specs (good way to learn):
https://www.tianocore.org/
POST(开机自检)是 BIOS 的一部分,编写 POST 而不是 BIOS 的其他部分,似乎确实是一项奇怪的任务。
处理器制造商网站的文档部分将是 BIOS 编程的良好开端。 我记得很久以前写过 80186 BIOS 和 POST,并且我专门使用 Intel 规范。
顺便说一句,您将在汇编器中而不是 C++ 中执行此操作。
POST (Power On Self Test) is part of the Bios, and writing a POST, but not other parts of the BIOS, seems like an odd task indeed.
The documentation section of the processor manufacturer's web site would be a good start for BIOS programming. I remember writing an 80186 BIOS and POST a long time ago, and I worked exclusively with the Intel specs.
And btw, you will be doing this in Assembler, not C++.