- MBR source:
- MBR binaries:
- "Error x"
- "No active partition" - self-explanatory
- "Disk read error"
- "No operating system" - PBR magic number was wrong
- "Invalid CHS read" - CHS vs LBA check selected LBA reads, but BIOS does not support them
MBR is read by the BIOS and then validated (checked for magic number 0xaa55 at the end). If validation fails, BIOS may print evil error message and/or try next boot device; otherwise, BIOS passes control to MBR.
Unless it was compiled with
NO_BANNER, MBR displays its banner: "NetBSD MBR
Boot". Next, it checks if CHS or LBA addressing must be used in further BIOS
I/O calls. Since partition table entry stores both linear and CHS address,
linear address is computed from CHS address, and if it matches stored linear
address - MBR will use CHS addressing. LBA addressing will be tried otherwise,
even if it is not supported by BIOS.
PBR is then loaded from 1st sector of active partition (or, if boot selector was compiled into this MBR, it may be loaded from another partition or disk).
- PBR source:
- bootxx source:
- combined PBR+bootxx binaries:
- '2' or "Disk read"
- 'B' or "Not a bootxx image" - phase 1 bootstrap's magic number was wrong
- 'P' or "No NetBSD partition"
- 'L' or "Invalid CHS read" - see above
PBR loads phase 1 bootstrap (bootxx) from next 15 sectors on disk, validates and runs it.
bootxx displays its banner:
NetBSD/(machine) (filesystem) Primary Bootstrap
and tries to load phase 2 bootstrap (boot2) from several locations:
- start of MBR partition; or
- start of MBR partition + RAIDframe offset; or
start of partition 'a' in disklabel.
bootxx error messages:
- "Boot failed (errno <...>): <...>"
- All further messages are printed by boot2. For example, a single "0" and no other messages on PC console means that boot2 has autodetected and is using serial console.
- boot2 source:
- boot2 binary:
Basic Input-Output System
Main Boot Record, stored at LBA 0
Partition Boot Record, stored in first sector of bootable partition
Cylinder, Head, Sector addressing
Linear Block Address[ing]