A tiny 32-bit x86 operating system kernel http://3zanders.co.uk/2017/10/13/writing-a-bootloader/
Find a file
2025-01-11 20:19:02 +01:00
.gitignore Initial commit 2025-01-10 20:46:47 +00:00
boot1.asm Bootloader 2025-01-11 20:19:02 +01:00
boot2.asm Bootloader 2025-01-11 20:19:02 +01:00
boot3.asm Bootloader 2025-01-11 20:19:02 +01:00
boot4.asm Bootloader 2025-01-11 20:19:02 +01:00
fun.zig Bootloader 2025-01-11 20:19:02 +01:00
LICENSE Initial commit 2025-01-10 20:46:47 +00:00
linker.ld Bootloader 2025-01-11 20:19:02 +01:00
README.md Bootloader 2025-01-11 20:19:02 +01:00

bootloader

A tiny 32-bit x86 operating system kernel

http://3zanders.co.uk/2017/10/13/writing-a-bootloader/

Real Mode Boot 1

16-bit mode.

Assemble with

nasm -f bin boot1.asm -o boot1.bin

Run with

qemu-system-x86_64 -fda boot1.bin

Protected Mode Boot 2

32-bit mode.

Assemble with

nasm -f bin boot2.asm -o bin2.bin

Run with

qemu-system-x86_64 -fda boot2.bin

Extended Boot 3

32-bit, 1024 byte.

Assemble with

nasm -f bin boot3.asm -o boot3.bin

Run with

qemu-system-x86_64 -fda boot3.bin

Linking with Zig

32-bit, 1024 byte, building and linking in Zig code.

Build with

zig build-exe boot4.o fun.zig -T linker.ld -nostdlib -target x86-freestanding

Convert to raw binary (strip ELF)

objcopy -Obinary fun fun.bin

Run with

qemu-system-x86_64 -fda fun.bin