summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-15 17:22:51 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-15 17:24:59 +0100
commit79090c31b60c95dcabd4572031353c9e0f54fc67 (patch)
tree5d8c7ccedfb040ab28c4f855f438d73b593e8c74
parent0b11c0cdac02f67dba3c55b97269edba212906ed (diff)
feat: new properties and improved vettable system.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--src/kernel/HALKit/AMD64/HalKernelMain.cc11
-rw-r--r--src/kernel/KernelKit/ZXD.h4
-rw-r--r--src/kernel/NeKit/Config.h8
-rw-r--r--src/kernel/NeKit/Vettable.h4
4 files changed, 23 insertions, 4 deletions
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 <misc/BenchKit/HWChronometer.h>
#include <modules/ACPI/ACPIFactoryInterface.h>
#include <modules/CoreGfx/TextGfx.h>
+#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 <class Type>
+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<IVettable> final {
static constexpr bool kValue = true;
};
-using FallbackType = bool (*)(bool);
+using FallbackType = bool (*)(bool type_value);
/// @brief Concept version of Vettable.
template <typename Type, FallbackType OnFallback>
concept IsVettable = requires() {
- { Vettable<Type>::kValue ? TrueResult<Type>::kValue : OnFallback(FalseResult<Type>::kValue) };
+ { Vettable<Type>::kValue ? TrueResult<Type>::kValue : OnFallback(PropertyResult<Type>::kValue) };
};
} // namespace Kernel