#bootloader #x86-64 #bios #boot #sector #elf #elf-file

app bootloader-x86_64-bios-boot-sector

BIOS boot sector for the bootloader crate

16 releases

0.11.9 Nov 30, 2024
0.11.7 Feb 16, 2024
0.11.5 Dec 28, 2023
0.11.4 Jul 5, 2023
0.11.0-beta.4 Nov 27, 2022

#203 in Operating systems

Download history 207/week @ 2024-08-18 268/week @ 2024-08-25 164/week @ 2024-09-01 225/week @ 2024-09-08 215/week @ 2024-09-15 303/week @ 2024-09-22 226/week @ 2024-09-29 246/week @ 2024-10-06 180/week @ 2024-10-13 123/week @ 2024-10-20 289/week @ 2024-10-27 230/week @ 2024-11-03 321/week @ 2024-11-10 209/week @ 2024-11-17 353/week @ 2024-11-24 302/week @ 2024-12-01

1,207 downloads per month

MIT/Apache

11KB
252 lines

First Stage: Bootsector

This executable needs to fit into the 512-byte boot sector, so we need to use all kinds of tricks to keep the size down.

Build Commands

  1. cargo build --profile=stage-1 -Zbuild-std=core --target ../../i386-code16-boot-sector.json -Zbuild-std-features=compiler-builtins-mem
  2. objcopy -I elf32-i386 -O binary ../../target/i386-code16-boot-sector/stage-1/bootloader-x86_64-bios-boot-sector ../../target/disk_image.img

To run in QEMU:

  • qemu-system-x86_64 -drive format=raw,file=../../target/disk_image.img

To print the contents of the ELF file, e.g. for trying to bring the size down:

  • objdump -xsdS -M i8086,intel ../../target/i386-code16-boot-sector/stage-1/bootloader-x86_64-bios-boot-sector

No runtime deps