From 9cf4007cc5a2d37c8a49cbc25a564cde5981e7b0 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 26 Apr 2024 08:26:54 +0200 Subject: MHR-16: Last fix and improvements. Signed-off-by: Amlal El Mahrouss --- Private/NewBoot/BootKit/BootKit.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Private/NewBoot/BootKit/BootKit.hxx') diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 6272e4c9..ffa3af15 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -213,6 +213,17 @@ public: /// @retval False failed to format. Boolean Format(const char* partName, BFileDescriptor* fileBlobs, SizeT blobCount); + operator bool() noexcept { + fDiskDev.Leak().mBase = (kNewFSAddressAsLba / BootDev::kSectorSize); + fDiskDev.Leak().mSize = BootDev::kSectorSize; + + Char buf[BootDev::kSectorSize] = { 0 }; + + fDiskDev.Read(buf, BootDev::kSectorSize); + + return buf[0] == kNewFSIdent[0]; + } + private: /// @brief Write all of the requested catalogs into the filesystem. Boolean WriteContent(BFileDescriptor* fileBlobs, SizeT blobCount, -- cgit v1.2.3