The Linux Boot Process: From Power Button to Kernel
- deivid - 12737 sekunder sedanReally nice post, some months ago I also wrote about linux boot, but a bit more focused on the IO side (what's on disk, how is it loaded), here: https://blog.davidv.dev/posts/booting-x86-64/
- zahlman - 40735 sekunder sedanIn the page source:
OwO what's this?<body> <!-- Femboy Mode Button - Hidden on Mobile --> <button class="rave-button" id="raveButton" onclick="toggleRaveMode()" title="Femboy Mode" style="display: none;"> <span class="button-text">uwu</span> </button> - nickelpro - 38525 sekunder sedanUEFI is an interface implemented by firmware (literally, Unified Extensible Firmware Interface), it's not the firmware itself. Saying "it starts the machine" is a bit of a nomenclature faux pas. The firmware starts the machine, you talk to the firmware via UEFI.
This post skips all the interesting things in the modern firmware dance. Not the least of which is when you call ExitBootServices() you're already in long mode. There's no need for the journey through real and protected.
- zaxioms - 27794 sekunder sedanDoes anyone have a similar article with more detail? I don't quite want to read the datasheet of your favorite microprocessor, but I would like a decent amount more detail than what's provided. Especially before UEFI/BIOS.
- gblargg - 7285 sekunder sedanI wonder whether the power button really directly starts the CPU. I wouldn't be surprised if the Intel Management Engine (or AMD equivalent), a CPU that's running all the time, is what gets the power button signal and starts the CPU.
- dgrin91 - 31387 sekunder sedanIt's a weird article for me. On one side it is an interesting topic. On the other hand why are we explaining what a hex number is? Who is interested in this level of detail but doesn't know hex? Maybe I'm overanalyzing.
At the same time this doesn't address my biggest open question on the topic - how do we get from the physical push to the reset vector? Somehow that magic works in HW, physics and electronics - how?
- nightshift1 - 41142 sekunder sedanThe topic is interesting but it seems to be targeted for my grandmother.
- metabagel - 42530 sekunder sedanHard to read on my phone due to faded text.
- pixelbeat__ - 42568 sekunder sedanGRUB is mentioned but not detailed.
Here are some details: https://www.pixelbeat.org/docs/disk/
- liqilin1567 - 31381 sekunder sedanSeems like there are many useful suggestions for the author. Here is mine: maybe an interactive style would work much better for educational content.
There is a well praised post on HN: https://www.nan.fyi/database, built with the framework: https://github.com/nandanmen/NotANumber
- ramanvarma - 17438 sekunder sedanReading this just reinforces how much of the x86/Linux boot chain is fossilized ceremony glued together for backward compatibility.
- gmueckl - 34973 sekunder sedanThis is old school BIOS boot. EFI bootloaders work very differently.
- darkwater - 6132 sekunder sedanThis post made me remember the technical interview by phone I had with Facebook circa 2010 for a Production Engineer role (but maybe it wasn't called yet that way back then) where they asked me exactly this. Well, they actually asked "explain me the boot process of a Linux server", with no more hints and "go into the details you feel are important" as the only help.
Anyway I should have moved to Dublin and something something surveillance capitalism so the grape wasn't ripe enough anyway.
- gldrk - 22278 sekunder sedanAs should be clear from the reset vector, the 80286 and its successors actually boot in unreal mode. On the 80386, the base address of the code segment is 0xffff0000, which cannot be obtained by shifting the 16-bit CS register by 4. The descriptor cache simply gets loaded with the correct value at reset. Writing to CS in real mode overwrites the cached value with CS * 16.
- aborsy - 27688 sekunder sedanRelated to this topic, what is the best way to replace the code involved in the entire boot process? This is useful when sanitizing a system received from a provider that may not be trustworthy, as malware could be hidden at low levels.
The disk could be wiped from the BIOS. One could also run “fwupdmgr update” from a live USB to update the motherboard firmware and then reinstall the operating system. However, I’m not sure if this would completely clear the system.
- phendrenad2 - 13525 sekunder sedanKinda missing the point of UEFI if you don't mention that it skips the first 3 sections and allows your kernel to boot directly from 64-bit mode ("long mode") with paging, a framebuffer, and a function to read files from your boot drive, already set up for you. Removes the need for GRUB entirely.
- e-dant - 29445 sekunder sedanARM and lots of non-x86 architectures often use a series of bootloaders to kick up ram, wake up parts of the hardware, blah blah, and read devicetree blobs to know what the hardware looks like
- pwpwp - 41170 sekunder sedanLight gray text on white??
- neoattikos - 36615 sekunder sedanNice to see the good old hacker energy & independent blogs explaining things showing up on top of hacker news. Welcome change from insufferable agent this and vibe that
- jiveturkey - 35063 sekunder sedanfascinating how it's all over the place wrt level of detail. and absolutely unreadable. luckily the layout is simple and reader mode works.
> Hex is base 16
i would argue that someone that understand bases (in the first place), understands what the << operator does (context where base 16 is explained), but doesn't understand what base 16 is, doesn't exist. this is the kind of haphazard approach of this article i'm talking about. even the author's name, 0xkato, is an example of this.
as to the content, i wish it had touched on TPM, PCRs, UEFI secure boot, and ME pre-boot.
i'm forgiving all the actual errors since it is a pretty broad overview.
i'm guessing first-year uni student.
rather amazed a post like this can make it to the #1 spot.
- zzzeek - 37601 sekunder sedanI'm going to save this guys blog in one step
https://webaim.org/resources/contrastchecker/
(this is the site: https://webaim.org/resources/contrastchecker/?fcolor=D0D0D0&...)
- panny - 38315 sekunder sedanI'm probably going to read this, but who thought putting light grey text on a white background was a good idea?
- superkuh - 41587 sekunder sedanVideo device initialization is intimately intertwined and a dependency for all this early boot stuff. I was hoping to learn more but it's not even mentioned. Still, neat.
- hamasho - 39334 sekunder sedanFunny how those three posts are in hacker news top 5 now. I guess today is the low level appreciation day.
edit: format* The Linux Boot Process: From Power Button to Kernel * The Journey Before main() * How programs get run: ELF binaries (2015) (lwn.net)
Nördnytt! 🤓