Learning about the miracle of boot
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
pantonshire 20e857b453 explain big code segment 1 month ago
.cargo cargo xtask alias 8 months ago
boot1 print to vga on panic 1 year ago
buildtools library-ify nasm helper 10 months ago
docs expand protected mode code segment 1 month ago
elf fix hexdump alignment for non-multiple-of-16 size 1 year ago
include move gdt, use fixed addr 5 months ago
memregion_merge memory region merge algorithm 12 months ago
patches add seabios as submodule 1 year ago
seabios@e5f2e4c696 add seabios as submodule 1 year ago
stage_1 load and jump to stage 3 separately from stage 2 8 months ago
stage_2 explain big code segment 1 month ago
stage_3 move gdt, use fixed addr 5 months ago
xtask fixed addr gdt, serial 5 months ago
.gitignore add build to gitignore 8 months ago
.gitmodules add seabios as submodule 1 year ago
Cargo.toml workspace for build tools 8 months ago
justfile use nographic for run_serial 5 months ago
readme.md enable a20 1 year ago
reset.s fixed addr gdt, serial 5 months ago
resources.md update resouces 8 months ago
rust-toolchain.toml default to nightly compiler 8 months ago

readme.md

Overview

Currently we boot from BIOS on a GPT-partitioned disk.

boot0.s is the first-stage bootloader. It lives in the MBR bootstrap field, and must therefore fit into 440 bytes. Its tasks are:

  • Set up a stack etc.
  • Get the boot drive geometry
  • Load and parse the GPT
  • Find the partition of the second stage
  • Load and jump to the first sector of the second stage

boot1.s is the second-stage bootloader. Its tasks are:

  • Load its own sectors not loaded by the first stage
  • Enable A20
  • Detect available memory
  • Enter unreal mode
  • Read the kernel ELF from disk (don't have to parse the ELF just yet)
  • Get all the useful information we can from the BIOS before we leave unreal mode
  • Enter long mode (possibly via protected mode?)
  • Load the kernel ELF
  • Initialise stack etc. for the kernel
  • Jump to kernel