summaryrefslogtreecommitdiffhomepage
path: root/src/boot/modules/SysChk
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/modules/SysChk')
-rw-r--r--src/boot/modules/SysChk/.hgkeep0
-rw-r--r--src/boot/modules/SysChk/README.md5
-rw-r--r--src/boot/modules/SysChk/SysChk.cpp6
-rw-r--r--src/boot/modules/SysChk/arm64-ahci-epm.json49
-rw-r--r--src/boot/modules/SysChk/arm64.json26
5 files changed, 58 insertions, 28 deletions
diff --git a/src/boot/modules/SysChk/.hgkeep b/src/boot/modules/SysChk/.hgkeep
deleted file mode 100644
index e69de29b..00000000
--- a/src/boot/modules/SysChk/.hgkeep
+++ /dev/null
diff --git a/src/boot/modules/SysChk/README.md b/src/boot/modules/SysChk/README.md
new file mode 100644
index 00000000..9c5a25e2
--- /dev/null
+++ b/src/boot/modules/SysChk/README.md
@@ -0,0 +1,5 @@
+# SysChk
+
+This module repairs an EPM or GPT partition after it's been damaged by tampering.
+
+This is for EFI only, as NeBoot support is not planned yet.
diff --git a/src/boot/modules/SysChk/SysChk.cpp b/src/boot/modules/SysChk/SysChk.cpp
index c7217504..09522b98 100644
--- a/src/boot/modules/SysChk/SysChk.cpp
+++ b/src/boot/modules/SysChk/SysChk.cpp
@@ -1,4 +1,4 @@
-// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/ne-foss-org/nekernel
@@ -28,9 +28,11 @@ EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) {
Boot::BDiskFormatFactory<Boot::BootDeviceATA> partition_factory;
#elif defined(__AHCI__)
Boot::BDiskFormatFactory<Boot::BootDeviceSATA> partition_factory;
+#elif defined(__NVME__)
+ Boot::BDiskFormatFactory<Boot::BootDeviceNVME> partition_factory;
#endif
- if (!partition_factory.IsPartitionValid()) return kEfiFail;
+ if (partition_factory.IsPartitionValid()) return kEfiOk;
return partition_factory.Format(kMachineModel);
}
diff --git a/src/boot/modules/SysChk/arm64-ahci-epm.json b/src/boot/modules/SysChk/arm64-ahci-epm.json
new file mode 100644
index 00000000..d73f90c3
--- /dev/null
+++ b/src/boot/modules/SysChk/arm64-ahci-epm.json
@@ -0,0 +1,49 @@
+{
+ "compiler_path": "clang++",
+ "compiler_std": "c++20",
+ "headers_path": ["../", "../../", "../../../kernel", "../../../", "./"],
+ "sources_path": [
+ "*.cpp",
+ "*.S",
+ "../../src/HEL/ARM64/BootSATA.cpp",
+ "../../src/HEL/ARM64/BootPlatform.cpp",
+ "../../src/HEL/ARM64/BootAPI.S",
+ "../../src/BootTextWriter.cpp",
+ "../../src/BootSupport.cpp",
+ "../../src/New+Delete.cpp",
+ "../../../kernel/HALKit/ARM64/PCI/*.cpp",
+ "../../../kernel/HALKit/ARM64/Storage/*.cpp",
+ "../../../kernel/src/Storage/*.cpp",
+ "../../../kernel/src/Network/*.cpp",
+ "../../../kernel/HALKit/ARM64/*.cpp",
+ "../../../kernel/HALKit/ARM64/*.s",
+ "../../../kernel/src/*.cpp"
+ ],
+ "output_name": "chk.efi",
+ "compiler_flags": [
+ "-ffreestanding",
+ "-nostdlib",
+ "-std=c++20",
+ "-fno-rtti",
+ "-fno-exceptions",
+ "-fuse-ld=lld",
+ "-Wl,-subsystem:efi_application,-entry:BootloaderMain",
+ "-target aarch64-unknown-windows"
+ ],
+ "cpp_macros": [
+ "__NEOSKRNL__",
+ "__BOOTZ__",
+ "__BOOTZ_STANDALONE__",
+ "__NE_ARM64__",
+ "__SYSCHK__",
+ "BOOTZ_EPM_SUPPORT",
+ "__nekernel_max_cores=8",
+ "__nekernel_dma_best_align=8",
+ "__nekernel_dma_pool_start=0x1000000",
+ "__nekernel_dma_pool_size=0x1000000",
+ "__nekernel_halkit_include_processor=\"<HALKit/ARM64/Processor.h>\"",
+ "kChkVersionHighest=0x0100",
+ "kChkVersionLowest=0x0100",
+ "kChkVersion=0x0100"
+ ]
+}
diff --git a/src/boot/modules/SysChk/arm64.json b/src/boot/modules/SysChk/arm64.json
deleted file mode 100644
index 2a04c772..00000000
--- a/src/boot/modules/SysChk/arm64.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "compiler_path": "clang++",
- "compiler_std": "c++20",
- "headers_path": ["../", "../../", "../../../kernel", "../../../", "./"],
- "sources_path": ["*.cpp", "*.S", "../../src/HEL/ARM64/*.cpp", "../../src/HEL/ARM64/*.S", "../../src/*.cpp"],
- "output_name": "chk.efi",
- "compiler_flags": [
- "-ffreestanding",
- "-nostdlib",
- "-std=c++20",
- "-fno-rtti",
- "-fno-exceptions",
- "-fuse-ld=lld",
- "-Wl,-subsystem:efi_application,-entry:BootloaderMain",
- "-target aarch64-unknown-windows"
- ],
- "cpp_macros": [
- "__NEOSKRNL__",
- "__BOOTZ__",
- "__BOOTZ_STANDALONE__",
- "__NE_ARM64__",
- "kChkVersionHighest=0x0100",
- "kChkVersionLowest=0x0100",
- "kChkVersion=0x0100"
- ]
-}