News for hackers. Stuff that matters.
Re:Ask HN: Where can I find a primer on how computers boot? by vsupalov on Monday March 20, 2023 @10:45AM (#35232260)
I wondered about an adjacent topic recently ("what IS the kernel actually") and found out that a great way to understand it, would be to start with the boot process. Once I felt less lost, I tried to capture my learnings [1]

The text is not edited yet, but as I had the benefit of learning about it with fresh eyes, it should be very approachable (and hopefully accurate enough)

[1] https://vsupalov.com/demystifying-kernel/

Re:Ask HN: Where can I find a primer on how computers boot? by MuffinFlavored on Monday March 20, 2023 @11:21AM (#35232843)
> It’s firmware time. Your machine has a motherboard, there is a chip on it which has had BIOS (Basic Input/Output System) flashed on it.

I wonder if it's worth it to call out the "processor microcode" firmware? Any cool startup things happen at that low level as well?

Re:Ask HN: Where can I find a primer on how computers boot? by vsupalov on Monday March 20, 2023 @11:47AM (#35233332)
Way out of my depth! However, the stuff I saw the folks from Oxide [1] talk about comes to mind. Hardware stuff with Rust. If you want to look at a specific project, Hubris [2] is a kernel for "deeply-embedded" systems.

[1] https://oxide.computer/blog/building-big-systems-with-remote...

[2] https://github.com/oxidecomputer/hubris

Re:Ask HN: Where can I find a primer on how computers boot? by bcantrill on Monday March 20, 2023 @02:37PM (#35236454)
Hubris is a part of booting on our systems in that it executes on both our root of trust and on our service processor -- but both of these execute long before the host CPU. To understand how we boot our host CPU (AMD Milan) on an Oxide compute sled, see my OSFC 2022 talk[0][1], as well as the episode of our Oxide and Friends podcast on holistic boot.[2]

[0] https://speakerdeck.com/bcantrill/i-have-come-to-bury-the-bi...

[1] https://www.osfc.io/2022/talks/i-have-come-to-bury-the-bios-...

[2] https://share.transistor.fm/s/24beb248

Re:Ask HN: Where can I find a primer on how computers boot? by vsupalov on Tuesday March 21, 2023 @02:44PM (#35250611)
Thanks a lot for sharing! I ended up watching the referenced "It's Time for Operating Systems to Rediscover Hardware" talk as well. Fascinating stuff.
Re:Ask HN: Where can I find a primer on how computers boot? by pjc50 on Monday March 20, 2023 @11:49AM (#35233350)
The microcode is mostly irrelevant, and is also opaque. It might be doing something but Intel won't give you more details beyond the programmer's reference model.

"Microcode" generally looks more like expanding a CISC instruction into other instructions, rather than something that looks like a program.

Extremely low level paper: https://www.researchgate.net/publication/295010710_Booting_a... ; good to confirm that Intel systems still boot at 0xFFFFFF0 in real (16-bit!) mode. It also points out that microcode updates are applied after execution has started.

There is also the fun of "cache as RAM"; it's usually quite a time consuming operation to get the DRAM controller up and running and "trained" to the particular signal properties of the motherboard, so the early boot phase has no RAM.

Re:Ask HN: Where can I find a primer on how computers boot? by MonaroVXR on Monday March 20, 2023 @07:34PM (#35240406)
I knew it would boot at 16bit mode, I need to make an article.
Re:Ask HN: Where can I find a primer on how computers boot? by blep-arsh on Monday March 20, 2023 @11:55AM (#35233462)
There's indeed a lot of firmware (not just microcode). A bunch of code is signature-checked and executed from the boot ROM and firmware flash in order to bring up the CPU and its various auxiliary cores (starting with the security processor/management engine nowadays), the PCH and the DRAM controller - all before the CPU can start executing any bootloader code from RAM.