如果我构建新的CPU,BIOS应该包含什么?(阅读详细信息)

发布于 2025-01-31 04:59:18 字数 1457 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

徒留西风 2025-02-07 04:59:18

我可以向您推荐“计算的结构”文章系列: https://jeelabs.orgs.orgs.org/202x/tfoc/

每台计算机中都会有一些初始代码,但是它的作用完全取决于您!在嵌入式中,“ BIOS”是完整的应用程序。

直接从焊接大门直接是一种漫长而艰巨的方式。我在FPGA上进行CPU设计,我是一门课程的撰稿人,它将您从逻辑的第一步到完整的risc-v CPU,其中包含C程序:

https://github.com/brunolevy/learn-fpga

祝你好运!使用FPGA,实际上可以使用自定义设计达到启动Linux:

https://github.com/享受数字/litex

I can recommend you "The Fabric of Computing" article series: https://jeelabs.org/202x/tfoc/

There will be some initial code in every computer, but what it does is entirely up to you! In embedded, the "bios" is the complete application.

Going straight from soldering gates is a long and arduous way. I am doing CPU design on FPGAs, and I am contributor in a course that takes you from the first steps in logic to a full RISC-V CPU with compiled C programs:

https://github.com/BrunoLevy/learn-fpga

Good luck! With FPGAs, it is actually possible to reach booting Linux with a custom design:

https://github.com/enjoy-digital/litex

つ低調成傷 2025-02-07 04:59:18

只是试图了解事物的工作方式。

事情的工作方式是,CPU只是系统的一个。没有RAM,它是毫无用处的,没有某种形式的持续存储,它是没有用的,并且没有某种IO与外界交谈(例如串行端口),这是没有用的。

BIOS将扮演什么角色?

“ BIOS”(或更正确的是,在系统打开时使用的某种ROM)扮演“存储”的角色 - CPU获得可执行的代码的一种方式,该代码可以初始化其他存储设备并加载更多可执行的代码。

对于您的“或大门散布在数百个面包板上”,您最终可能会直接将一个非常最小的“ OS”放入ROM中,因此您不必担心提供额外的持久存储空间;而且,有了大约10年的奉献精神,您最终可能会看到您的最小操作系统工作3次(在厌倦了“本周哪种电线之间的连接不良?”持续的断裂)。

对于某些观点; 1位RAM将花费您4个或大门,因此,一个少量的512字节RAM会花费您16384或门(更多用于行/列选择逻辑等)。这可用于超过4000“ 74LS02四倍的两个输入和门”芯片。如果您可以在面包板上打包40个这样的薯条,那么您正在寻找大约100个面包板,最终没有足够的RAM来运行任何操作系统。

Just trying to understand how things work.

How things work is that a CPU is just one piece of a system. Without RAM it's useless, without some form of persistent storage it's useless, and without some kind of IO to talk to the outside world (e.g. a serial port maybe) it's useless.

What role the BIOS will play?

"BIOS" (or more correctly, some kind of ROM used when the system is turned on) plays the role of "storage" - a way for the CPU to obtain executable code that's needed to initialize other storage devices and load more executable code.

For your "NOR gates spread across hundreds of breadboards" you'll probably end up putting a very minimal "OS" directly in the ROM so that you don't have to worry about providing additional persistent storage; and with about 10 years of dedication you might eventually see your minimal OS work 3 times (before getting tired of "which wire is having a bad connection this week?" continual breakage).

For some perspective; 1 bit of RAM will cost you 4 NOR gates, so a measly 512 bytes of RAM will cost you 16384 NOR gates (more for row/column select logic, etc). That works out to over 4000 "74LS02 Quadruple Two Input NOR Gate" chips. If you can pack 40 of these chips on a breadboard then you're looking at about 100 breadboards just to end up with not enough RAM to run any OS.

舟遥客 2025-02-07 04:59:18

操作系统可能非常非常简单 - 如果您只希望该系统启动并执行一些设备和线程之类的事情,但不希望全面操作系统的所有保护和功能。

您真正需要的是能够响应中断并发出数据准备就绪的用户级软件(缓冲输入)或设备准备就绪的能力,并且相反,该用户级软件可以指示(例如,通过SYSCALLS)数据它希望发送到设备(缓冲输出)或从中获取。 可以用几百行的组装,用于中断处理程序,一个迷你操作系统。

但是,有许多系统甚至没有那种水平。一些程序微控制器可以简单地运行一个程序,而无需中断,它们具有一个主要的事件循环,可连续检查按钮按下或其他情况。

Operating systems can be very very simple — if you just want the system to boot and do a few things like devices and threads but don't want all the protections and features of a full-fledged operating system.

All you really need is the ability to respond to interrupts and signal the user level software that data is ready (buffering input) or the device is ready, and, sort of the reverse, that user level software can indicate (e.g. via syscalls) data it wants to send to devices (buffered output) or obtain from them.  That can be had with a few hundred lines of assembly for an interrupt handler, a mini os.

But there are many systems that don't even have that level of sophistication.  Some program micro controllers to simply run one program, without interrupts, they have one main event loop that continuously checks for button presses or other.

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