summaryrefslogtreecommitdiffhomepage
path: root/Boot
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-10 10:35:44 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-10 10:35:44 +0200
commit192892221333113b28353fbe428adfc1bf6bbaae (patch)
tree04f2da30b021880ea3c5ca1bac030fcd206c5c52 /Boot
parent80039963ff08d1810e22a0ae41497b156e861db0 (diff)
[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 <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Boot')
-rw-r--r--Boot/Sources/HEL/AMD64/BootMain.cxx10
-rw-r--r--Boot/Sources/KernelLoader.cxx2
-rw-r--r--Boot/amd64-efi.make5
3 files changed, 12 insertions, 5 deletions
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<BootDeviceATA> 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