diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-03 15:25:06 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-03 15:25:06 +0100 |
| commit | bf2fc74c6552f9359955210c8f60e45308ae1d31 (patch) | |
| tree | 903ea813d3ef69b7c5c3a45bc7268fc990d6b191 /dev/Boot/src/HEL | |
| parent | 4be14ab92ed6456e6d5bec5777fe7df5738112e7 (diff) | |
IMPL: Work In Progress efforts in Journaling and SysChk.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Boot/src/HEL')
| -rw-r--r-- | dev/Boot/src/HEL/AMD64/BootATA.cc | 7 | ||||
| -rw-r--r-- | dev/Boot/src/HEL/AMD64/BootMain.cc | 17 |
2 files changed, 17 insertions, 7 deletions
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<BootDeviceATA>::BFileDescriptor root{}; - Boot::BDiskFormatFactory<BootDeviceATA>::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(); |
