Как NetBSD грузится с HDD на x86

shattered аватар

Статья обновлена и перенесена в NetBSD wiki: http://wiki.netbsd.se/How_NetBSD_boots_on_x86, здесь старый вариант.

  1. MBR is read and validated (checked for 0xaa55 at the end) by BIOS. If validation fails, BIOS may print evil error message. source: sys/arch/i386/stand/mbr/mbr.S
    binary: /usr/mdec/mbr_*
  2. MBR is executed; unless compiled with NO_BANNER, prints "NetBSD MBR Boot"
  3. MBR loads PBR from 1st sector of active partition (or another disk, or another partition — if bootselector is used) CHS vs LBA: convert CHS start address to LBA, if matches LBA start - use CHS reads; otherwise - use LBA reads.
    "Error x"
    "No active partition" - self-explanatory
    "Disk read error"
    "No operating system" - first sector of active partition does not have magic number (0xaa55)
    "Invalid CHS read" - CHS vs LBA check selected LBA reads, but BIOS does not support them
  4. PBR loads phase 1 bootstrap from next 15 sectors on disk, checks magic and runs it sys/arch/i386/stand/bootxx/pbr.S, /usr/mdec/bootxx_*
    '2' "Disk read"
    'B' "Not a bootxx image" - magic number wrong
    'P' "No NetBSD partition"
    'L' "Invalid CHS read" - CHS vs LBA check selected LBA reads, but BIOS does not support them
  5. bootxx is executed, prints "NetBSD/{machine} {filesystem} Primary Bootstrap" sys/arch/i386/stand/bootxx/bootxx.S
  6. bootxx loads phase 2 bootstrap (/boot): * from the start of MBR partition; or
    * from the start of MBR partition + raidframe offset; or
    * from the start of partition 'a' in disklabel.
cv writing services

Настройки просмотра комментариев

Выберите нужный метод показа комментариев и нажмите "Сохранить установки".
BSDobermann аватар

Да на

Да на английском, очень познaвательно :)