Exactly How Does FreeBSD Boot ?

Hello
New to FreeBSD.
Exactly what does FreeBSD do when it starts ? I'm looking for lower level stuff, not, "it gives you login;"
Stuff like;
loads u-boot ?
loads loader ?
loads FreeBSD
uses this file 1st;
this file 2nd;
3rd;
etc
 
The beginning of the process (at least) depends whether you boot from EFI or legacy BIOS, the scheme of your booting disk (GPT or MBR) and also on the root filesystem type (UFS or ZFS). So there is no simple answer to give.

Anyway, the system reaches the loader(8) (the boot menu with the beastie). After that, it loads and executes the kernel, then init(8) which launches rc(8) scripts. This part is well documented in the Handbook.
 
https://www.freebsd.org/ -> Documentation -> Handbook -> System Administration -> The FreeBSD Booting Process -> FreeBSD Boot Process
Note that this only describes the "traditional" CSM (aka BIOS) boot.

GPT works slightly different. Instead of loading the master boot record it loads the code from the freebsd-boot partition. Then it follows the same stage 3 as CSM booting.

EFI boots by loading and executing the /EFI/BOOT/BOOTx64.EFI from the efi partition. This in turn loads stage 3. See efi(7)
 
GPT works slightly different. Instead of loading the master boot record it loads the code from the freebsd-boot partition. Then it follows the same stage 3 as CSM booting.
In case of legacy BIOS booting on a GPT scheme, the MBR is actually loaded (pmbr). This code is responsible for locating and loading the code inside freebsd-boot (BTX client: gptboot or gptzfsboot).
 
Thx Thanks for all the replies...I have to lol as there seems to be 10 variations for every process regarding booting. I don't yet have the handbook on any unix box as my lab in not on the net, but cd-net for now. thx Thanks again.
 
with the beastie

1729881347110.pngWith modern hardware, more likely with the logo icon.
 
Explain to a dumb person what the number "8" means -loader.efi(8), init(8), etc.?

Not a dumb question :)

At the command line, you can type:

man man

or more specifically,

man 1 man

The description begins:

The man utility finds and displays online manual documentation pages. If mansect is provided, man restricts the search to the specific section of the manual.

The sections of the manual are:
  1. FreeBSD General Commands Manual
  2. FreeBSD System Calls Manual
  3. FreeBSD Library Functions Manual
  4. FreeBSD Kernel Interfaces Manual
  5. FreeBSD File Formats Manual
  6. FreeBSD Games Manual
  7. FreeBSD Miscellaneous Information Manual
  8. FreeBSD System Manager's Manual
  9. FreeBSD Kernel Developer's Manual

You can choose a pager, for example:

man -P less 2 intro

man -P cat 2 intro

Either way, you'll get the introduction to section 2 of the manual.

Last but not least,

man -P cat 8 loader.efi
 
Back
Top