diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-22 18:30:00 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-22 18:30:00 +0200 |
| commit | 5ba2b615e172d93d1ffb06f611b19a4388ed074e (patch) | |
| tree | 3d3ad0d7c195a2d01aaf03155e77499cd6788fcf /dev/kernel/HALKit | |
| parent | 8434a141533891ebd7cb5369c0541cb9a9c07971 (diff) | |
dev, kernel: Milestone towards 0.0.2, see details.
Details:
- Added support for 512 process teams (kTeams array).
- New SwitchTeam() API in UserProcessScheduler.
- Kernel main loop rotates active team every 200ms.
- Renamed syscall tables for clarity (kSyscalls → kSysCalls, etc.).
- Replaced kKernelMaxSystemCalls with kMaxDispatchCallCount.
- Updated call sites to match new naming.
- Bumped format version to 0x0101.
- Added reserved fields to HEFS_BOOT_NODE for future use.
- Changed inode indexing logic to operate on (start, size) pairs.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 16 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalKernelMain.cc | 17 |
2 files changed, 24 insertions, 9 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index 7209fd06..46775a7f 100644 --- a/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -190,15 +190,15 @@ EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp) /// @return nothing. EXTERN_C Kernel::Void hal_system_call_enter(Kernel::UIntPtr rcx_syscall_index, Kernel::UIntPtr rdx_syscall_struct) { - if (rcx_syscall_index < kSyscalls.Count()) + if (rcx_syscall_index < kSysCalls.Count()) { Kernel::kout << "syscall: Enter Syscall.\r"; - if (kSyscalls[rcx_syscall_index].fHooked) + if (kSysCalls[rcx_syscall_index].fHooked) { - if (kSyscalls[rcx_syscall_index].fProc) + if (kSysCalls[rcx_syscall_index].fProc) { - (kSyscalls[rcx_syscall_index].fProc)((Kernel::VoidPtr)rdx_syscall_struct); + (kSysCalls[rcx_syscall_index].fProc)((Kernel::VoidPtr)rdx_syscall_struct); } else { @@ -219,15 +219,15 @@ EXTERN_C Kernel::Void hal_system_call_enter(Kernel::UIntPtr rcx_syscall_index, K /// @return nothing. EXTERN_C Kernel::Void hal_kernel_call_enter(Kernel::UIntPtr rcx_kerncall_index, Kernel::UIntPtr rdx_kerncall_struct) { - if (rcx_kerncall_index < kKerncalls.Count()) + if (rcx_kerncall_index < kKernCalls.Count()) { Kernel::kout << "kerncall: Enter Kernel Call List.\r"; - if (kKerncalls[rcx_kerncall_index].fHooked) + if (kKernCalls[rcx_kerncall_index].fHooked) { - if (kKerncalls[rcx_kerncall_index].fProc) + if (kKernCalls[rcx_kerncall_index].fProc) { - (kKerncalls[rcx_kerncall_index].fProc)((Kernel::VoidPtr)rdx_kerncall_struct); + (kKernCalls[rcx_kerncall_index].fProc)((Kernel::VoidPtr)rdx_kerncall_struct); } else { diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc index ce8c1245..60d05e11 100644 --- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -98,8 +98,23 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept idt_loader.Load(idt_reg); + auto constexpr kSchedTeamSwitchMS = 200U; /// @brief Team switch time in milliseconds. + + Kernel::HardwareTimer timer(rtl_ms(kSchedTeamSwitchMS)); + + SizeT i = 0U; + while (YES) { - ; + timer.Wait(); + + UserProcessScheduler::The().SwitchTeam(kTeams[i]); + + ++i; + + if (i > kSchedTeamCount) + { + i = 0U; + } } } |
