Skip to content(if available)orjump to list(if available)

The Linux Boot Process: From Power Button to Kernel

aborsy

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

zaxioms

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

zahlman

In the page source:

  <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>
OwO what's this?

0xkato

Its a working progress.

null

[deleted]

kgasser88

Stunning and brave

null

[deleted]

juggerl

[flagged]

juggerl

[dead]

e-dant

ARM 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

liqilin1567

Seems 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

metabagel

Hard to read on my phone due to faded text.

Brybry

The styling is bad on a desktop browser too. If you use Firefox or Firefox Mobile then reader mode is good for cases like this.

DonHopkins

The self deprecatingly downvoted look.

dgrin91

It'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

The topic is interesting but it seems to be targeted for my grandmother.

zahlman

> When power stabilizes, the CPU resets itself to a tiny, old‑fashioned mode called real mode. Real mode dates back to the original 8086 chip. The rules are simple on purpose. Memory addresses are built from two values the CPU keeps in special fast storage called registers. You combine a segment and an offset like this:

  physical_address = (segment << 4) + offset
Your grandmother sounds unusually proficient with this sort of thing.

nightshift1

I dont know, i just don't like the tone. This is a complex subject where the target audience should probably already know what is an hexadecimal number or an interrupt and the explanation of a cpu register ought to be better than: "A register is a tiny slot inside the CPU. It holds a number the CPU is using right now." If the subject interest you, you deserve better.

typpilol

Agreed. A lot of these articles leave me with more questions than answers.

These blog posts really annoy me because I feel like with 20% more effort you could have something worth reading.

Neywiny

One of the things we were taught in uni was audience analysis. I think about it a lot. What's expected to already be known? What acronyms or phrases need defining? Etc. This is an art I'm far from perfect at and it seems a lot of tech writers are too

pixelbeat__

GRUB is mentioned but not detailed.

Here are some details: https://www.pixelbeat.org/docs/disk/

gmueckl

This is old school BIOS boot. EFI bootloaders work very differently.

okanat

and with GRUB running under UEFI, it actually uses UEFI load procedures instead of fumbling with 16-bit CS, DS, SS registers

nickelpro

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

pwpwp

Light gray text on white??