Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo | set /p="Compiling boot.asm..."
- fasm boot.asm
- echo Done
- echo | set /p="Compiling loader.asm..."
- fasm loader.asm
- echo Done
- echo | set /p="Compiling kernel.c..."
- wsl gcc -fno-pie -m32 -ffreestanding drivers/ports.h drivers/screen.h kernel.c drivers/ports.c drivers/screen.c -o kernel.o
- echo Done
- echo | set /p="Copying kernel.o to kernel.elf..."
- wsl objcopy kernel.o -O elf32-i386 kernel.elf
- echo Done
- echo | set /p="Linking..."
- wsl /usr/local/i386elfgcc/bin/i386-elf-ld -o kernel.bin -Ttext 0x1000 loader.o kernel.elf --oformat binary
- echo Done
- echo | set /p="Merging boot.bin and kernel.bin..."
- type boot.bin kernel.bin >> os_image.bin
- echo Done
- qemu-system-x86_64 os_image.bin
- echo | set /p="Cleaning up..."
- del *.bin
- del *.o
- del *.elf
- echo Done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement