Ask HN: Where can I find a primer on how computers boot?
The following is a pretty decent historical page about the pre-(U)EFI MBR (Master Boot Record) boot process:<p><a href="https:&#x2F;&#x2F;thestarman.pcministry.com&#x2F;asm&#x2F;mbr&#x2F;STDMBR.htm" rel="nofollow">https:&#x2F;&#x2F;thestarman.pcministry.com&#x2F;asm&#x2F;mbr&#x2F;STDMBR.htm</a><p>Note that EFI&#x2F;UEFI -- occurred much later in time than MBR...<p>The MBR boot process is also called &quot;Legacy Boot&quot; -- and is emulated on (U)EFI -- although it may not show as an option on some (U)EFI BIOS&#x27;es if the option is turned off...<p>Related: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Master_boot_record" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Master_boot_record</a><p>You might also wish to check out some emulators, most notably Bochs (<a href="https:&#x2F;&#x2F;bochs.sourceforge.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bochs.sourceforge.io&#x2F;</a>) and QEMU (<a href="https:&#x2F;&#x2F;www.qemu.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.qemu.org&#x2F;</a>) because they simulate the boot process, and if you&#x27;re in their debuggers, you should be able to inspect that process step by step -- but also more generally emulators for other machines&#x2F;platforms&#x2F;architectures (<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;List_of_computer_system_emulators" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;List_of_computer_system_emulat...</a>) because in general, most of those emulators should realistically simulate the given machine&#x2F;platform&#x2F;architecture&#x27;s boot process...<p>The basic theory of booting is that when a system starts, it contains a little bit of persistent memory (BIOS ROM, EPROM?) that contains a little bit of code, which is just enough code to load the data of the first block&#x2F;sector of the hard disk (or other persistent storage boot device) to a specific address in memory as code -- and jump to it.<p>This data on the first block&#x2F;sector -- is a small bit of machine code -- which although fairly stupid -- knows enough about the system to load the next N blocks&#x2F;sectors of the hard disk (or other storage device) -- again into memory at a specific address -- and then jump (transfer control) to it.<p>This pattern may repeat several times, for example, GRUB&#x27;s first bootsector then loads an intermediate length program (a &quot;chainloader&quot;) from the next N contiguous blocks&#x2F;sectors of the storage device, this chainloader knows more about the hardware and filesystems than the initial boot block did, and then it proceeds to do a yet longer&#x2F;more complex load of the main Operating System into memory.<p>During the final load, the main Operating System might be on discontiguous blocks&#x2F;sectors and those blocks&#x2F;sectors may be part of a filesystem.  But that doesn&#x27;t have to be the case.<p>But whatever the case, the final load (or perhaps &quot;bootstrap phase&quot;) is usually more complex than reading continuous blocks&#x2F;sectors into memory and subsequently jumping to its start address in memory -- but not always...<p>Another way to think about it is that a 512 byte program (the bootsector) is loaded that then loads a 32K (let&#x27;s say) program (the chainloader on N contiguous blocks&#x2F;sectors) which then loads the multi-megabyte (or multi-gigabyte!) OS from multiple files from multiple file systems from multiple discontinuous blocks&#x2F;sectors on the physical device (let&#x27;s say, for example...)<p>Simple Program (loads) -&gt; More Complex Program (loads) -&gt; Most Complex Program (OS)...<p>Anyway, there&#x27;s your basic theory...<p>Good luck!