diff options
| author | amlal <amlal@el-mahrouss-logic.com> | 2024-03-08 12:35:05 +0000 |
|---|---|---|
| committer | amlal <amlal@el-mahrouss-logic.com> | 2024-03-08 12:43:36 +0000 |
| commit | 6f5eddc17785607e1cd5e8245d576874f1939beb (patch) | |
| tree | dbc1f113be4e90b0de8de6916c7bd5084f6f604b /Private/NewBoot/Source | |
| parent | 842d35cdd8511adf379c4ccb52010b9b71e0757f (diff) | |
HCR-14: Fixes and improvements.
Signed-off-by: amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot/Source')
| -rw-r--r-- | Private/NewBoot/Source/FileReader.cxx | 7 | ||||
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/AMD64-VirtualMemory.asm | 8 | ||||
| -rw-r--r-- | Private/NewBoot/Source/makefile | 11 | ||||
| -rw-r--r-- | Private/NewBoot/Source/run-qemu.ps1 | 1 |
4 files changed, 13 insertions, 14 deletions
diff --git a/Private/NewBoot/Source/FileReader.cxx b/Private/NewBoot/Source/FileReader.cxx index 158f9ab4..f24329e8 100644 --- a/Private/NewBoot/Source/FileReader.cxx +++ b/Private/NewBoot/Source/FileReader.cxx @@ -8,7 +8,7 @@ Revision History: - + Fix stupid implementation for a more smarter one. ------------------------------------------- */ @@ -92,11 +92,12 @@ BFileReader::~BFileReader() { this->mFile = nullptr; } + if (this->mBlob) + BS->FreePool(mBlob); + BSetMem(this->mPath, 0, kPathLen); } -#define hTransferBufferAddress 0xffffffff10000000 - /** @brief this reads all of the buffer. @param ImageHandle used internally. diff --git a/Private/NewBoot/Source/HEL/AMD64/AMD64-VirtualMemory.asm b/Private/NewBoot/Source/HEL/AMD64/AMD64-VirtualMemory.asm deleted file mode 100644 index 46928cf7..00000000 --- a/Private/NewBoot/Source/HEL/AMD64/AMD64-VirtualMemory.asm +++ /dev/null @@ -1,8 +0,0 @@ -bits 64 -global __cr3 - -section .text - -__cr3: - mov rax, cr3 - ret diff --git a/Private/NewBoot/Source/makefile b/Private/NewBoot/Source/makefile index c3b02fc6..057a5d44 100644 --- a/Private/NewBoot/Source/makefile +++ b/Private/NewBoot/Source/makefile @@ -5,8 +5,14 @@ CC_GNU=x86_64-w64-mingw32-g++ LD_GNU=x86_64-w64-mingw32-ld + +ifeq ($(shell uname), Darwin) +EMU=qemu-system-x86_64 +else +EMU=qemu-system-x86_64w.exe +endif + LD_FLAGS=-e efi_main --subsystem=10 -ASM=nasm OBJ=$(wildcard *.o) $(wildcard ../../Obj/*.obj) $(wildcard HEL/AMD64/*.obj) REM=rm @@ -22,7 +28,6 @@ invalid-recipe: .PHONY: bootloader-amd64 bootloader-amd64: $(CC_GNU) $(FLAG_GNU) HEL/AMD64/*.cxx *.cxx - $(ASM) $(FLAG_ASM) HEL/AMD64/AMD64-VirtualMemory.asm $(LD_GNU) $(OBJ) $(LD_FLAGS) -o HCoreLdr.exe cp HCoreLdr.exe CDROM/EFI/BOOT/BOOTX64.EFI cp HCoreLdr.exe CDROM/EFI/BOOT/HCORELDR.EFI @@ -30,7 +35,7 @@ bootloader-amd64: .PHONY: run-efi-amd64 run-efi-amd64: - qemu-system-x86_64 -net none -smp 2 -m 4G -M q35 -bios OVMF.fd -drive file=fat:rw:CDROM,index=1,format=raw -d int + $(EMU) -net none -smp 2 -m 4G -M q35 -bios OVMF.fd -drive file=fat:rw:CDROM,index=1,format=raw -d int .PHONY: download-edk download-edk: diff --git a/Private/NewBoot/Source/run-qemu.ps1 b/Private/NewBoot/Source/run-qemu.ps1 new file mode 100644 index 00000000..d84c9327 --- /dev/null +++ b/Private/NewBoot/Source/run-qemu.ps1 @@ -0,0 +1 @@ +qemu-system-x86_64w.exe -net none -smp 2 -m 4G -M q35 -bios OVMF.fd -drive file=fat:rw:CDROM,index=1,format=raw -d int
\ No newline at end of file |
