wrote a basic bootloader

This commit is contained in:
2025-02-25 01:14:52 +00:00
commit 012b0454ed
36 changed files with 1667 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
# Set root directory
cd "$(dirname "$0")/.."
# Create build directory if it doesn't exist
mkdir -p build/bios
# Assemble stage1
nasm -f elf32 boot/bios/stage1/stage1.s -o build/bios/stage1.o
# Link to binary
ld -m elf_i386 -T boot/bios/stage1/stage1.ld build/bios/stage1.o -o build/bios/stage1.bin
# Verify size
size=$(wc -c < build/bios/stage1.bin)
if [ "$size" -gt 446 ]; then
echo "Error: stage1.bin is larger than 446 bytes ($size bytes)"
exit 1
fi
echo "Successfully built stage1.bin ($size bytes)"