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

app bootloader-x86_64-bios-boot-sector

BIOS boot sector for the bootloader crate

15 releases

0.11.8 Nov 2, 2024
0.11.7 Feb 16, 2024
0.11.6 Jan 28, 2024
0.11.5 Dec 28, 2023
0.11.0-beta.4 Nov 27, 2022

#212 in Operating systems

Download history 272/week @ 2024-07-29 319/week @ 2024-08-05 206/week @ 2024-08-12 203/week @ 2024-08-19 267/week @ 2024-08-26 171/week @ 2024-09-02 230/week @ 2024-09-09 210/week @ 2024-09-16 331/week @ 2024-09-23 231/week @ 2024-09-30 216/week @ 2024-10-07 170/week @ 2024-10-14 126/week @ 2024-10-21 312/week @ 2024-10-28 215/week @ 2024-11-04 317/week @ 2024-11-11

977 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