summaryrefslogtreecommitdiffhomepage
path: root/dev/boot/BootKit
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-04-27 17:30:36 +0200
committerAmlal <amlal@nekernel.org>2025-04-27 17:30:36 +0200
commitcb2f383f45dda8d1cdcef0b87fe4c70243659701 (patch)
treef109c3c44fa3f142d34f8ca61cfa69672e556614 /dev/boot/BootKit
parent14d5ee9e0cfededddfceec73d5dfa8a2fcda6c5d (diff)
dev, kernel: AHCI, HeFS filesystem, SysChk, and BootSATA improvements.
what? - AHCI now writes to disk, forgot to do it. - Codebase's architecutre has been used to reuse the Generic+AHCI driver in SysChk for AHCI. (tradeoff is 256K in size instead of 36K) - DriveMgr now detects EPM. - And HeFS is still being worked on. Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'dev/boot/BootKit')
-rw-r--r--dev/boot/BootKit/BootKit.h12
-rw-r--r--dev/boot/BootKit/HW/SATA.h10
2 files changed, 9 insertions, 13 deletions
diff --git a/dev/boot/BootKit/BootKit.h b/dev/boot/BootKit/BootKit.h
index aa7dde85..7a25e2a5 100644
--- a/dev/boot/BootKit/BootKit.h
+++ b/dev/boot/BootKit/BootKit.h
@@ -170,7 +170,7 @@ EXTERN_C UInt8 rt_in8(UInt16 port);
EXTERN_C UInt16 In16(UInt16 port);
EXTERN_C UInt32 rt_in32(UInt16 port);
-EXTERN_C void rt_hlt();
+EXTERN_C void rt_halt();
EXTERN_C void rt_cli();
EXTERN_C void rt_sti();
EXTERN_C void rt_cld();
@@ -256,16 +256,6 @@ class BDiskFormatFactory final {
template <typename BootDev>
inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* part_name) {
#if defined(BOOTZ_EPM_SUPPORT)
- /// @note A catalog roughly equal to a sector in NeFS terms.
- constexpr auto kMinimumDiskSize = kNeFSMinimumDiskSize; // at minimum.
-
- /// @note also look at EPM headers, for free part blocks. (only applies if EPM or vEPM is used)
-
- if (fDiskDev.GetDiskSize() < kMinimumDiskSize) {
- Boot::ThrowError(L"Drive-Too-Tiny", L"Can't format a EPM partition here.");
- return false;
- }
-
EPM_PART_BLOCK epm_boot{};
const auto kFsName = "HeFS";
diff --git a/dev/boot/BootKit/HW/SATA.h b/dev/boot/BootKit/HW/SATA.h
index 7e84c061..5c70c18c 100644
--- a/dev/boot/BootKit/HW/SATA.h
+++ b/dev/boot/BootKit/HW/SATA.h
@@ -6,6 +6,7 @@
#pragma once
+#include <BootKit/BootKit.h>
#include <CompilerKit/CompilerKit.h>
#include <modules/AHCI/AHCI.h>
@@ -20,14 +21,19 @@ class BootDeviceSATA final {
Kernel::SizeT mBase{1024};
Kernel::Boolean mErr{false};
Kernel::Boolean mDetected{false};
+ Kernel::SizeT mSize{0};
operator bool() { return !this->mErr; }
};
operator bool() { return this->Leak().mDetected; }
- BootDeviceSATA& Read(Kernel::WideChar* Buf, const Kernel::SizeT SecCount);
- BootDeviceSATA& Write(Kernel::WideChar* Buf, const Kernel::SizeT SecCount);
+ SizeT GetDiskSize() { return drv_get_size(); }
+
+ constexpr static auto kSectorSize = kAHCISectorSize;
+
+ BootDeviceSATA& Read(Boot::CharacterTypeUTF8* Buf, const Kernel::SizeT SecCount);
+ BootDeviceSATA& Write(Boot::CharacterTypeUTF8* Buf, const Kernel::SizeT SecCount);
SATATrait& Leak();