From be29b406526c931a606d4d4de545f71e62bc893a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 25 Mar 2024 16:43:00 +0100 Subject: Kernel: A lot of preliminary changes before AHCI and SMP support. --- Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx | 2 +- Private/NewBoot/Source/HEL/AMD64/BootMain.cxx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Private/NewBoot/Source') diff --git a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx index 36702198..da28a3f3 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx @@ -13,7 +13,7 @@ STATIC const BlockGUID kEPMGuid = { 0x425d, {0xbe, 0x7b, 0x75, 0xa3, 0x7c, 0xc6, 0x79, 0xbc}}; -Void boot_try_write_partition_map(const Char* namePart, SizeT namePartLength, +Void boot_try_read_partition_map(const Char* namePart, SizeT namePartLength, BDeviceATA* ataInterface) { if (namePartLength > kEPMNameLength || !namePart) return; if (!ataInterface) return; diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx index 1f0bbc9b..21481f85 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx @@ -47,7 +47,9 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle, if (ataDrv) { Char namePart[kEPMNameLength] = { "BootBlock" }; - boot_try_write_partition_map(namePart, kEPMNameLength, &ataDrv); + + /// tries to read an EPM block, or writes one if it fails. + boot_try_read_partition_map(namePart, kEPMNameLength, &ataDrv); } /// Read Kernel blob. -- cgit v1.2.3