diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-07-09 16:49:29 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-07-09 16:49:29 +0200 |
| commit | 560a6c233286ec736a7a7c570efc68161c9953be (patch) | |
| tree | 0c1154e75966870d11204a9d7f91d72943c3ab54 /Kernel/arm64-efi.make | |
| parent | 631de363c6f353328a358d7c1d50e1781e5402cc (diff) | |
MHR-36: newoskrnl: Adding support for ARM64 based UEFI machines, (EPM
UEFI)
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/arm64-efi.make')
| -rw-r--r-- | Kernel/arm64-efi.make | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Kernel/arm64-efi.make b/Kernel/arm64-efi.make new file mode 100644 index 00000000..cf46cee6 --- /dev/null +++ b/Kernel/arm64-efi.make @@ -0,0 +1,71 @@ +################################################## +# (C) Zeta Electronics Corporation, all rights reserved. +# This is the microkernel makefile. +################################################## + +CC = clang++ +LD = lld-link +CCFLAGS = -c -ffreestanding -MMD -mno-red-zone -D__NEWOS_ARM64__ -fno-rtti -fno-exceptions -I./ \ + -target aarch64-unknown-windows \ + -std=c++20 -D__FSKIT_USE_NEWFS__ -D__ZETA_MACHINE__ -D__KERNEL__ -D__HAVE_MAHROUSS_APIS__ -D__MAHROUSS__ + +ASM = clang++ + +DISKDRIVER = -D__FLASH_MEM__ + +ifneq ($(SDCARD_SUPPORT), ) +DISKDRIVER = -D__SDCARD__ +endif + +ifneq ($(DEBUG_SUPPORT), ) +DEBUG = -D__DEBUG__ +endif + +COPY = cp + +LDFLAGS = -subsystem:efi_application -entry:hal_init_platform /nodefaultlib +LDOBJ = Objects/*.obj + +# This file is the kernel, responsible of task management and memory. +KERNEL = newoskrnl.exe +KERNEL_512K = newoskrnl.512k.exe + +.PHONY: error +error: + @echo "=== ERROR ===" + @echo "=> Use a specific target." + +MOVEALL=./MoveAll.ARM64.sh + +.PHONY: newos-arm64-epm +newos-arm64-epm: clean + $(CC) $(CCFLAGS) $(DISKDRIVER) $(DEBUG) $(wildcard Sources/*.cxx) \ + $(wildcard Sources/FS/*.cxx) $(wildcard HALKit/ARM64/Storage/*.cxx) \ + $(wildcard HALKit/ARM64/PCI/*.cxx) $(wildcard Sources/Network/*.cxx) $(wildcard Sources/Storage/*.cxx) \ + $(wildcard HALKit/ARM64/*.cxx) $(wildcard HALKit/ARM64/*.cpp) \ + $(wildcard HALKit/ARM64/*.s) + + $(MOVEALL) + +OBJCOPY=x86_64-w64-mingw32-objcopy + +.PHONY: link-arm64-epm +link-arm64-epm: + $(LD) $(LDFLAGS) $(LDOBJ) /out:$(KERNEL) + +.PHONY: all +all: newos-arm64-epm link-arm64-epm + qemu-img create -f raw $(KERNEL_512K) 512K + dd if=newoskrnl.exe of=$(KERNEL_512K) bs=1 seek=0 conv=notrunc + @echo "NewOSKrnl => OK." + +.PHONY: help +help: + @echo "=== HELP ===" + @echo "all: Build kernel and link it." + @echo "link-arm64-epm: Link kernel for EPM based disks." + @echo "newos-arm64-epm: Build kernel for EPM based disks." + +.PHONY: clean +clean: + rm -f $(LDOBJ) $(wildcard *.o) $(KERNEL) $(KERNEL_512K) |
