diff options
| author | Amlal <amlal@nekernel.org> | 2025-04-27 23:31:27 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-04-27 23:31:27 +0200 |
| commit | 8a7396493c3effb356d2dc4484b993b4698bc422 (patch) | |
| tree | 1726a7342eaf1ae3adaefbfe019e20cff9b9ab09 /dev/boot | |
| parent | 11dd858e1d9da71a182bc707ca3a481dafbccbe4 (diff) | |
dev, kernel: HeFS had to be redesigned to be less problematic with hard-drives.
why?
the struct were way too big to fit wihin a sector.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/boot')
| -rw-r--r-- | dev/boot/BootKit/BootKit.h | 2 | ||||
| -rw-r--r-- | dev/boot/modules/SysChk/SysChk.cc | 4 | ||||
| -rw-r--r-- | dev/boot/src/HEL/AMD64/BootSATA.cc | 4 |
3 files changed, 4 insertions, 6 deletions
diff --git a/dev/boot/BootKit/BootKit.h b/dev/boot/BootKit/BootKit.h index 7a25e2a5..d10ce0de 100644 --- a/dev/boot/BootKit/BootKit.h +++ b/dev/boot/BootKit/BootKit.h @@ -262,7 +262,7 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* part_name) { const auto kBlockName = "OS (EPM)"; epm_boot.FsVersion = 0; - epm_boot.LbaStart = 1024; + epm_boot.LbaStart = sizeof(EPM_PART_BLOCK); epm_boot.LbaEnd = fDiskDev.GetDiskSize() - 1; epm_boot.SectorSz = BootDev::kSectorSize; epm_boot.Kind = kEPMNeKernel; diff --git a/dev/boot/modules/SysChk/SysChk.cc b/dev/boot/modules/SysChk/SysChk.cc index 05ac6da0..c93ef83b 100644 --- a/dev/boot/modules/SysChk/SysChk.cc +++ b/dev/boot/modules/SysChk/SysChk.cc @@ -36,7 +36,5 @@ EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) { #endif if (partition_factory.IsPartitionValid()) return kEfiOk; - auto ret = partition_factory.Format(kMachineModel) == YES; - - return ret; + return partition_factory.Format(kMachineModel); } diff --git a/dev/boot/src/HEL/AMD64/BootSATA.cc b/dev/boot/src/HEL/AMD64/BootSATA.cc index 783acb4c..2b1bc78e 100644 --- a/dev/boot/src/HEL/AMD64/BootSATA.cc +++ b/dev/boot/src/HEL/AMD64/BootSATA.cc @@ -52,7 +52,7 @@ BootDeviceSATA& BootDeviceSATA::Read(CharacterTypeUTF8* Buf, SizeT SectorSz) { NE_UNUSED(Buf); NE_UNUSED(SectorSz); - drv_std_read(mTrait.mBase, Buf, SectorSz, mTrait.mSize); + drv_std_read(mTrait.mBase / SectorSz, Buf, SectorSz, mTrait.mSize); return *this; } @@ -66,7 +66,7 @@ BootDeviceSATA& BootDeviceSATA::Write(CharacterTypeUTF8* Buf, SizeT SectorSz) { NE_UNUSED(Buf); NE_UNUSED(SectorSz); - drv_std_write(mTrait.mBase, Buf, SectorSz, mTrait.mSize); + drv_std_write(mTrait.mBase / SectorSz, Buf, SectorSz, mTrait.mSize); return *this; } |
