From bf2fc74c6552f9359955210c8f60e45308ae1d31 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 3 Jan 2025 15:25:06 +0100 Subject: IMPL: Work In Progress efforts in Journaling and SysChk. Signed-off-by: Amlal El Mahrouss --- dev/Boot/src/HEL/AMD64/BootATA.cc | 7 ++++++- dev/Boot/src/HEL/AMD64/BootMain.cc | 17 +++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'dev/Boot/src') diff --git a/dev/Boot/src/HEL/AMD64/BootATA.cc b/dev/Boot/src/HEL/AMD64/BootATA.cc index cdf0d180..4222792f 100644 --- a/dev/Boot/src/HEL/AMD64/BootATA.cc +++ b/dev/Boot/src/HEL/AMD64/BootATA.cc @@ -169,6 +169,8 @@ Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, rt_out16(IO + ATA_REG_DATA, Buf[IndexOff]); boot_ata_wait_io(IO); } + + boot_ata_wait_io(IO); } /// @check is ATA detected? @@ -246,8 +248,11 @@ BootDeviceATA& BootDeviceATA::Write(CharacterTypeUTF8* Buf, const SizeT& SectorS Leak().mErr = false; - if (!Buf || SectorSz < 1) + if (!Buf || SectorSz < 1 || this->Leak().mSize < 1) + { + Leak().mErr = true; return *this; + } boot_ata_write(this->Leak().mBase, this->Leak().mBus, this->Leak().mMaster, Buf, SectorSz, this->Leak().mSize); diff --git a/dev/Boot/src/HEL/AMD64/BootMain.cc b/dev/Boot/src/HEL/AMD64/BootMain.cc index 6744438f..da618625 100644 --- a/dev/Boot/src/HEL/AMD64/BootMain.cc +++ b/dev/Boot/src/HEL/AMD64/BootMain.cc @@ -222,16 +222,21 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, if (syschk_thread->Start(handover_hdr, NO) != kEfiOk) { - fb_init(); + if (partition_factory.IsPartitionValid() == NO) + { + Boot::BDiskFormatFactory::BFileDescriptor root{}; - Boot::BDiskFormatFactory::BFileDescriptor root{}; + root.fFileName[0] = kNeFSRoot[0]; + root.fFileName[1] = 0; - root.fFileName[0] = kNeFSRoot[0]; - root.fFileName[1] = 0; + root.fKind = kNeFSCatalogKindDir; - root.fKind = kNeFSCatalogKindDir; + const auto kFSName = "SSD"; - partition_factory.Format("HD", &root, 1); + partition_factory.Format(kFSName, &root, 1); + } + + fb_init(); UI::fb_clear_video(); -- cgit v1.2.3