From 192892221333113b28353fbe428adfc1bf6bbaae Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sat, 10 Aug 2024 10:35:44 +0200 Subject: [FIX] [newoskrnl.dll] Fixed it's heap and improved it as well. [FIX] Fix memory leak in TrySave. (\Kernel\Sources\User.cxx) Signed-off-by: Amlal EL Mahrouss --- Boot/Sources/HEL/AMD64/BootMain.cxx | 10 +++++++++- Boot/Sources/KernelLoader.cxx | 2 +- Boot/amd64-efi.make | 5 ++--- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'Boot') diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index 0e2be7ac..53587e40 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -118,7 +118,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, vendorTable[4] == 'P' && vendorTable[5] == 'T' && vendorTable[6] == 'R' && vendorTable[7] == ' ') { - writer.Write(L"newosldr: Filling rsdptr...\r"); + writer.Write(L"newosldr: Filling RSD PTR...\r"); handoverHdrPtr->f_HardwareTables.f_VendorPtr = (VoidPtr)vendorTable; break; @@ -163,6 +163,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, handoverHdrPtr->f_VirtualStart = (VoidPtr)Descriptor[cDefaultMemoryMap].VirtualStart; + handoverHdrPtr->f_VirtualSize = Descriptor[cDefaultMemoryMap].NumberOfPages; /* # of pages */ @@ -195,6 +196,13 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, CGDrawInRegion(CGColor(0xFF, 0xFF, 0xFF), handoverHdrPtr->f_GOP.f_Height, handoverHdrPtr->f_GOP.f_Width, 0, 0); CGFini(); + BDiskFormatFactory checkPart; + + if (!checkPart.IsPartitionValid()) + { + writer.Write("newosldr: Warning, partition isn't valid! Need to repartition it.\r"); + } + // ---------------------------------------------------- // // The following checks for an exisiting partition // inside the disk, if it doesn't have one, diff --git a/Boot/Sources/KernelLoader.cxx b/Boot/Sources/KernelLoader.cxx index 02fa97e4..aaabddc3 100644 --- a/Boot/Sources/KernelLoader.cxx +++ b/Boot/Sources/KernelLoader.cxx @@ -93,7 +93,7 @@ namespace Boot UInt64 HandoverMagic; UInt32 HandoverType; - }* structHandover = (struct HANDOVER_INFORMATION_STUB*)(fBlob + sect->mPointerToRawData); + }* structHandover = (struct HANDOVER_INFORMATION_STUB*)((UIntPtr)fBlob + sect->mPointerToRawData); if (structHandover->HandoverMagic != kHandoverMagic || structHandover->HandoverType != kHOTypeKernel) diff --git a/Boot/amd64-efi.make b/Boot/amd64-efi.make index c5f51112..4cf707bd 100644 --- a/Boot/amd64-efi.make +++ b/Boot/amd64-efi.make @@ -29,12 +29,11 @@ IMG=epm-master-1.img IMG_2=epm-slave.img IMG_3=epm-master-2.img -EMU_FLAGS=-net none -smp 2 -m 6G -M q35 \ +EMU_FLAGS=-net none -smp 2 -m 8G -M q35 \ -bios $(BIOS) -device piix3-ide,id=ide \ -drive id=disk,file=$(IMG),format=raw,if=none \ -device ide-hd,drive=disk,bus=ide.0 -drive \ - file=fat:rw:Sources/Root/,index=2,format=raw -d int -hdd $(IMG_2) \ - -drive file=$(IMG_3),if=none,id=nvm -device nvme,serial=Zeta,drive=nvm + file=fat:rw:Sources/Root/,index=2,format=raw -d int -hdd $(IMG_2) LD_FLAGS=-e Main --subsystem=10 -- cgit v1.2.3