Feat: Finnaly in 32-bits

This commit is contained in:
AfonsoCMSousa
2025-11-18 20:28:27 +00:00
parent 751c1f527d
commit af903b190a
5 changed files with 113 additions and 88 deletions
+10 -6
View File
@@ -1,8 +1,12 @@
echo ">>> Compiling bootloader"
nasm boot.asm -o boot.o -f elf32
#!/bin/sh
export PATH=/usr/local/cross/bin:$PATH
echo ">>> Compiling kernel"
gcc kernel.c -o kernel.o -c -m32 -ffreestanding -nostdlib -no-pie
# 1. Assemble raw binary
echo ">>> Assembling boot.asm to boot.bin..."
nasm -f bin boot.asm -o boot.bin
echo ">>> Linking kernel"
gcc -m32 -nostdlib -no-pie -T linker.ld -o SoraOS boot.o kernel.o
# 2. Run QEMU as a raw disk drive
echo ">>> Running QEMU with boot.bin..."
qemu-system-x86_64 -drive format=raw,file=boot.bin
echo "Done!"