From 9828f432fe1ec678a5a78ad841b4f4d6beb3795b Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 4 Jun 2025 10:04:44 +0200 Subject: fix: Better architectural design of BootZ's SATA device. fix: Use 512 instead of 4096 as a sector size inside SATA's BootZ device. Signed-off-by: Amlal El Mahrouss --- dev/boot/BootKit/Device.h | 4 ++-- dev/boot/BootKit/HW/SATA.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'dev/boot/BootKit') diff --git a/dev/boot/BootKit/Device.h b/dev/boot/BootKit/Device.h index 8f5bf854..6ae8cd6b 100644 --- a/dev/boot/BootKit/Device.h +++ b/dev/boot/BootKit/Device.h @@ -20,8 +20,8 @@ class Device { NE_MOVE_DEFAULT(Device) struct Trait { - SizeT mBase{1024}; - SizeT mSize{1024}; + SizeT mBase{0}; + SizeT mSize{0}; }; virtual Trait& Leak() = 0; diff --git a/dev/boot/BootKit/HW/SATA.h b/dev/boot/BootKit/HW/SATA.h index eecf426d..ebb1151e 100644 --- a/dev/boot/BootKit/HW/SATA.h +++ b/dev/boot/BootKit/HW/SATA.h @@ -10,7 +10,7 @@ #include #include -#define kAHCISectorSz (4096) +#define kAHCISectorSz (512) class BootDeviceSATA final { public: @@ -19,11 +19,9 @@ class BootDeviceSATA final { NE_COPY_DEFAULT(BootDeviceSATA) - struct SATATrait final { - Kernel::SizeT mBase{1024}; + struct SATATrait final : public Device::Trait { Kernel::Boolean mErr{false}; Kernel::Boolean mDetected{false}; - Kernel::SizeT mSize{0}; operator bool() { return !this->mErr; } }; -- cgit v1.2.3