From 9452e6c705674ce6194b5b3f99b69bdbffd98ddc Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Fri, 7 Feb 2025 17:50:39 -0800 Subject: [PATCH] [Denali] Assert sector size is 512. --- rust/sys/denali/src/ahci/controller.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rust/sys/denali/src/ahci/controller.rs b/rust/sys/denali/src/ahci/controller.rs index 059f3a7..f62645d 100644 --- a/rust/sys/denali/src/ahci/controller.rs +++ b/rust/sys/denali/src/ahci/controller.rs @@ -155,8 +155,13 @@ impl AhciController { mammoth::debug!("Sector size: {:#0x}", new_sector_size); mammoth::debug!("LBA Count: {:#0x}", lba_count); - //self.sector_size = Some(new_sector_size as u64); - //self.sector_cnt = Some(lba_count); + // We hardcode assumptions about sector size in a few places, better to panic if we + // are wrong. + assert_eq!( + new_sector_size, 512, + "Sector size {} differs from 512.", + new_sector_size + ); } else { mammoth::debug!("Skipping non-sata sig: {:#0x}", sig); }