A minimalist x86 bootloader that prints a message from the Master Boot Record (MBR). This bootloader fits within 512 bytes and demonstrates how to initialize registers, print a string via BIOS interrupts, and safely halt the CPU. This was done as a learning experience, if you notice any error, please open an issue!
This project serves as a foundational step into low-level and systems programming using 16-bit real mode x86 assembly. It provides a fully working example of:
- Writing a valid MBR boot sector
- Using BIOS interrupt
0x10for TTY output - Initializing segment registers manually
- Embedding null-terminated strings
For a line-by-line breakdown of the code, see here.
To build and run this bootloader, you will need:
- nasm (Netwide Assembler)
- qemu-system-x86_64 (or any other x86 emulator for testing)
- Clone the repository and initialize the build directory:
git clone https://github.com/wellatleastitried/MBR-Bootloader.git cd MBR-Bootloader && mkdir build
- Build the bootloader and run it with QEMU:
OR only build the bootloader:
make run
make
- To clean up the build files, run:
make clean