From cb2f383f45dda8d1cdcef0b87fe4c70243659701 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sun, 27 Apr 2025 17:30:36 +0200 Subject: 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 --- dev/boot/modules/SysChk/SysChk.cc | 14 +++++++------- dev/boot/modules/SysChk/amd64-ahci-epm.json | 12 +++++++++--- dev/boot/modules/SysChk/amd64-ahci-gpt.json | 15 ++++++++++----- dev/boot/modules/SysChk/amd64-pio-gpt.json | 2 +- 4 files changed, 27 insertions(+), 16 deletions(-) (limited to 'dev/boot/modules') diff --git a/dev/boot/modules/SysChk/SysChk.cc b/dev/boot/modules/SysChk/SysChk.cc index a3697bb1..05ac6da0 100644 --- a/dev/boot/modules/SysChk/SysChk.cc +++ b/dev/boot/modules/SysChk/SysChk.cc @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -26,17 +27,16 @@ #endif // !kMachineModel EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) { -#if defined(__ATA_PIO__) fw_init_efi((EfiSystemTable*) handover->f_FirmwareCustomTables[1]); +#if defined(__ATA_PIO__) Boot::BDiskFormatFactory partition_factory; - +#elif defined(__AHCI__) + Boot::BDiskFormatFactory partition_factory; +#endif if (partition_factory.IsPartitionValid()) return kEfiOk; - return partition_factory.Format(kMachineModel) == YES; -#else - NE_UNUSED(handover); + auto ret = partition_factory.Format(kMachineModel) == YES; - return kEfiOk; -#endif + return ret; } diff --git a/dev/boot/modules/SysChk/amd64-ahci-epm.json b/dev/boot/modules/SysChk/amd64-ahci-epm.json index 1a82cf55..3c56cfe8 100644 --- a/dev/boot/modules/SysChk/amd64-ahci-epm.json +++ b/dev/boot/modules/SysChk/amd64-ahci-epm.json @@ -10,7 +10,13 @@ "../../src/HEL/AMD64/BootAPI.S", "../../src/BootTextWriter.cc", "../../src/BootSupport.cc", - "../../src/New+Delete.cc" + "../../src/New+Delete.cc", + "../../../kernel/HALKit/AMD64/PCI/*.cc", + "../../../kernel/HALKit/AMD64/Storage/*.cc", + "../../../kernel/src/Storage/*.cc", + "../../../kernel/HALKit/AMD64/*.cc", + "../../../kernel/HALKit/AMD64/*.s", + "../../../kernel/src/*.cc" ], "output_name": "chk.efi", "compiler_flags": [ @@ -22,11 +28,11 @@ ], "cpp_macros": [ "__NEOSKRNL__", - "__BOOTZ__", - "__BOOTZ_STANDALONE__", "__NE_AMD64__", "__AHCI__", + "__SYSCHK__", "BOOTZ_EPM_SUPPORT", + "__NE_MODULAR_KERNEL_COMPONENTS__", "kChkVersionHighest=0x0100", "kChkVersionLowest=0x0100", "kChkVersion=0x0100" diff --git a/dev/boot/modules/SysChk/amd64-ahci-gpt.json b/dev/boot/modules/SysChk/amd64-ahci-gpt.json index cb538eed..80bb433e 100644 --- a/dev/boot/modules/SysChk/amd64-ahci-gpt.json +++ b/dev/boot/modules/SysChk/amd64-ahci-gpt.json @@ -10,7 +10,13 @@ "../../src/HEL/AMD64/BootAPI.S", "../../src/BootTextWriter.cc", "../../src/BootSupport.cc", - "../../src/New+Delete.cc" + "../../src/New+Delete.cc", + "../../../kernel/HALKit/AMD64/PCI/*.cc", + "../../../kernel/HALKit/AMD64/Storage/*.cc", + "../../../kernel/src/Storage/*.cc", + "../../../kernel/HALKit/AMD64/*.cc", + "../../../kernel/HALKit/AMD64/*.s", + "../../../kernel/src/*.cc" ], "output_name": "chk.efi", "compiler_flags": [ @@ -22,12 +28,11 @@ ], "cpp_macros": [ "__NEOSKRNL__", - "__BOOTZ__", - "__BOOTZ_STANDALONE__", "__NE_AMD64__", "__AHCI__", - "__NE_VEPM__", - "BOOTZ_VEPM_SUPPORT", + "__SYSCHK__", + "BOOTZ_GPT_SUPPORT", + "__NE_MODULAR_KERNEL_COMPONENTS__", "kChkVersionHighest=0x0100", "kChkVersionLowest=0x0100", "kChkVersion=0x0100" diff --git a/dev/boot/modules/SysChk/amd64-pio-gpt.json b/dev/boot/modules/SysChk/amd64-pio-gpt.json index 21c81667..b1a4d38b 100644 --- a/dev/boot/modules/SysChk/amd64-pio-gpt.json +++ b/dev/boot/modules/SysChk/amd64-pio-gpt.json @@ -33,7 +33,7 @@ "__NE_AMD64__", "__ATA_PIO__", "__NE_VEPM__", - "BOOTZ_VEPM_SUPPORT", + "BOOTZ_GPT_SUPPORT", "kChkVersionHighest=0x0100", "kChkVersionLowest=0x0100", "kChkVersion=0x0100" -- cgit v1.2.3