Advertisement
lylythechosenone

compile.bat

Nov 13th, 2020
1,073
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.78 KB | None | 0 0
  1. @echo off
  2.  
  3. echo | set /p="Compiling boot.asm..."
  4. fasm boot.asm
  5. echo Done
  6.  
  7. echo | set /p="Compiling loader.asm..."
  8. fasm loader.asm
  9. echo Done
  10.  
  11. echo | set /p="Compiling kernel.c..."
  12. wsl gcc -fno-pie -m32 -ffreestanding drivers/ports.h drivers/screen.h kernel.c drivers/ports.c drivers/screen.c -o kernel.o
  13. echo Done
  14.  
  15. echo | set /p="Copying kernel.o to kernel.elf..."
  16. wsl objcopy kernel.o -O elf32-i386 kernel.elf
  17. echo Done
  18.  
  19. echo | set /p="Linking..."
  20. wsl /usr/local/i386elfgcc/bin/i386-elf-ld -o kernel.bin -Ttext 0x1000 loader.o kernel.elf --oformat binary
  21. echo Done
  22.  
  23. echo | set /p="Merging boot.bin and kernel.bin..."
  24. type boot.bin kernel.bin >> os_image.bin
  25. echo Done
  26.  
  27. qemu-system-x86_64 os_image.bin
  28.  
  29. echo | set /p="Cleaning up..."
  30. del *.bin
  31. del *.o
  32. del *.elf
  33. echo Done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement