From 79090c31b60c95dcabd4572031353c9e0f54fc67 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 15 Dec 2025 17:22:51 +0100 Subject: feat: new properties and improved vettable system. Signed-off-by: Amlal El Mahrouss --- src/kernel/HALKit/AMD64/HalKernelMain.cc | 11 +++++++++-- src/kernel/KernelKit/ZXD.h | 4 ++++ src/kernel/NeKit/Config.h | 8 ++++++++ src/kernel/NeKit/Vettable.h | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/HALKit/AMD64/HalKernelMain.cc b/src/kernel/HALKit/AMD64/HalKernelMain.cc index 5f1d2430..7994a017 100644 --- a/src/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/src/kernel/HALKit/AMD64/HalKernelMain.cc @@ -17,6 +17,7 @@ #include #include #include +#include "NeKit/Config.h" #ifndef __NE_MODULAR_KERNEL_COMPONENTS__ EXTERN_C Kernel::VoidPtr kInterruptVectorTable[]; @@ -142,9 +143,15 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) { NeFS::fs_init_nefs(); #endif - UserProcessScheduler::The().SwitchTeam(kHighUserTeam); + UserProcessScheduler::The().SwitchTeam(kRTUserTeam); - rtl_create_user_process([]() -> void { while (YES); }, "NeKernel"); + // AMLALE: TODO: Prosan, Process sanitizer. + rtl_create_user_process([]() -> void { while (YES); }, "Prosan"); + + UserProcessScheduler::The().SwitchTeam(kMidUserTeam); + + // AMLALE: TODO, Vet sanitizer. + rtl_create_user_process([]() -> void { while (YES); }, "Vetsan"); HAL::mp_init_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); diff --git a/src/kernel/KernelKit/ZXD.h b/src/kernel/KernelKit/ZXD.h index 705a50d4..1ead7b1f 100644 --- a/src/kernel/KernelKit/ZXD.h +++ b/src/kernel/KernelKit/ZXD.h @@ -45,11 +45,15 @@ struct PACKED ZxdExec final { /// @details This header is used to identify ZXD stub files. It contains the size of the stub, the /// offset of the stub, and the CRC32 checksum of the stub. struct PACKED ZxdStub final { + Char fName[8]; UInt32 fStubSize; UInt32 fStubOffset; UInt32 fStubCRC32; }; +inline constexpr auto kDriverName = ".drvr"; +inline constexpr auto kProsanName = ".pros"; + using ZxdExecPtr = ZxdExec*; using ZxdStubPtr = ZxdStub*; } // namespace Kernel diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h index 900ea28c..7cf01a2c 100644 --- a/src/kernel/NeKit/Config.h +++ b/src/kernel/NeKit/Config.h @@ -203,4 +203,12 @@ struct TrueResult final { static constexpr bool kValue = true; }; + +template +struct PropertyResult final { + using ResultType = Type; + using ResultTypeRef = ResultType&; + + static constexpr bool kValue = Type::kValue; +}; } // namespace Kernel diff --git a/src/kernel/NeKit/Vettable.h b/src/kernel/NeKit/Vettable.h index c8c27fe3..294aaad5 100644 --- a/src/kernel/NeKit/Vettable.h +++ b/src/kernel/NeKit/Vettable.h @@ -40,12 +40,12 @@ struct Vettable final { static constexpr bool kValue = true; }; -using FallbackType = bool (*)(bool); +using FallbackType = bool (*)(bool type_value); /// @brief Concept version of Vettable. template concept IsVettable = requires() { - { Vettable::kValue ? TrueResult::kValue : OnFallback(FalseResult::kValue) }; + { Vettable::kValue ? TrueResult::kValue : OnFallback(PropertyResult::kValue) }; }; } // namespace Kernel -- cgit v1.2.3