From 92e86a036219d31c56d12ba41adab51d62a26ecc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 27 Feb 2026 05:41:16 +0100 Subject: chore: kernel, boot: updated sources copyright year and improve stability. Signed-off-by: Amlal El Mahrouss --- src/boot/modules/SysChk/SysChk.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/boot/modules/SysChk/SysChk.cpp (limited to 'src/boot/modules/SysChk/SysChk.cpp') diff --git a/src/boot/modules/SysChk/SysChk.cpp b/src/boot/modules/SysChk/SysChk.cpp new file mode 100644 index 00000000..ebc2be68 --- /dev/null +++ b/src/boot/modules/SysChk/SysChk.cpp @@ -0,0 +1,36 @@ +// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/nekernel-org/nekernel + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Makes the compiler shut up. +#ifndef kMachineModel +#define kMachineModel "OS" +#endif // !kMachineModel + +EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) { + fw_init_efi((EfiSystemTable*) handover->f_FirmwareCustomTables[Kernel::HEL::kHandoverTableST]); + +#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); +} -- cgit v1.2.3