summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source/makefile
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 10:53:58 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-05 10:53:58 +0100
commitf8c9b81ff120160af60af6e9d44cba338aceb65a (patch)
treecb4683589aab4d50470628f189dc366814fd80ad /Private/NewBoot/Source/makefile
parente03903b98aa0b4d2dc3ed4637863124f28c4e1fe (diff)
Kernel: Improved kernel design and Bootloader runs on real hardware!
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source/makefile')
-rw-r--r--Private/NewBoot/Source/makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile
index 2c08426e..02990084 100644
--- a/Private/NewBoot/Source/makefile
+++ b/Private/NewBoot/Source/makefile
@@ -5,10 +5,12 @@
CC_GNU=x86_64-w64-mingw32-g++
LD_GNU=x86_64-w64-mingw32-ld
+LD_FLAGS=-e efi_main -shared --subsystem=10 -ffreestanding
ASM=nasm
+OBJ=$(wildcard *.obj) $(wildcard *.o) $(wildcard HEL/AMD64/*.obj) $(wildcard HEL/AMD64/*.o)
FLAG_ASM=-f win64
-FLAG_GNU=-fshort-wchar -D__DEBUG__ -fPIC -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -D__HAVE_HCORE_APIS__ -D__HCORE__ -I./ -I$(HOME)/
+FLAG_GNU=-fshort-wchar -O0 -D__DEBUG__ -fPIC -DEFI_FUNCTION_WRAPPER -I../ -I../../ -I./ -c -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -D__HAVE_HCORE_APIS__ -D__HCORE__ -I./ -I$(HOME)/
.PHONY: invalid-recipe
invalid-recipe:
@@ -18,7 +20,7 @@ invalid-recipe:
bootloader-amd64:
$(CC_GNU) $(FLAG_GNU) HEL/AMD64/*.cxx *.cxx
$(ASM) $(FLAG_ASM) HEl/AMD64/AMD64-VirtualMemory.asm
- $(LD_GNU) *.o HEL/AMD64/*.obj -e efi_main -shared --subsystem=10 -ffreestanding -o HCoreLdr.exe
+ $(LD_GNU) $(OBJ) $(LD_FLAGS) -o HCoreLdr.exe
cp HCoreLdr.exe CDROM/EFI/BOOT/BOOTX64.EFI
cp ../../HCoreKrnl.exe CDROM/HCOREKRNL.EXE
@@ -29,8 +31,8 @@ make-disk:
.PHONY: run-efi-debug
run-efi-debug:
wget https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd
- qemu-system-x86_64 -smp 8,maxcpus=16 -m 8G -M q35 -bios OVMF.fd -drive file=os.epm,index=0,if=ide,format=qcow2 -drive file=fat:rw:CDROM,index=1,format=raw -serial stdio
+ qemu-system-x86_64 -smp 2 -m 4G -M q35 -bios OVMF.fd -drive file=os.epm,index=0,if=ide,format=qcow2 -drive file=fat:rw:CDROM,index=1,format=raw -serial stdio
.PHONY: clean
clean:
- rm -f *.o HCoreLdr.exe OVMF.fd
+ rm -f $(OBJ) HCoreLdr.exe OVMF.fd