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 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dev/Boot/src/HEL/AMD64/BootATA.cc') 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); -- cgit v1.2.3