summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/src/UserProcessScheduler.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 11:12:31 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 11:13:38 +0200
commit54a0f4c49d9bfb955174c87dae2f442d7f5a8b25 (patch)
treead59d31c9444fcfc6d5f0da7b17c8843710e6014 /dev/kernel/src/UserProcessScheduler.cc
parentfc67c4af554189c941c811486a0b2b21aa3f54ea (diff)
feat!(Kernel): Improvements on the BitMapMgr, HTS, and UPS.
other: - Add ZXD header file. - Reworking AMD64 interrupts. - Improved HTS's design implementation. - Improved UPS's balancing implementation. breaking changes: - Rename MemoryMgr to HeapMgr. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/src/UserProcessScheduler.cc')
-rw-r--r--dev/kernel/src/UserProcessScheduler.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc
index 0a26938a..3251e0dc 100644
--- a/dev/kernel/src/UserProcessScheduler.cc
+++ b/dev/kernel/src/UserProcessScheduler.cc
@@ -15,9 +15,9 @@
#include <ArchKit/ArchKit.h>
#include <KernelKit/HardwareThreadScheduler.h>
+#include <KernelKit/HeapMgr.h>
#include <KernelKit/IPEFDylibObject.h>
#include <KernelKit/KPC.h>
-#include <KernelKit/MemoryMgr.h>
#include <KernelKit/ProcessScheduler.h>
#include <NeKit/KString.h>
#include <SignalKit/Signals.h>
@@ -487,13 +487,6 @@ SizeT UserProcessScheduler::Run() noexcept {
return 0UL;
}
- auto& process = this->TheCurrentProcess().Leak();
-
- //! Increase the usage time of the process.
- if (process.UTime < process.PTime) {
- ++process.UTime;
- }
-
SizeT process_index = 0UL; //! we store this guy to tell the scheduler how many
//! things we have scheduled.
@@ -502,7 +495,12 @@ SizeT UserProcessScheduler::Run() noexcept {
//! Check if the process needs to be run.
if (UserProcessHelper::CanBeScheduled(process)) {
- kout << process.Name << " will be scheduled...\r";
+ kout << process.Name << " will be run...\r";
+
+ //! Increase the usage time of the process.
+ if (process.UTime < process.PTime) {
+ ++process.UTime;
+ }
this->TheCurrentProcess() = process;
@@ -622,6 +620,9 @@ Bool UserProcessHelper::Switch(HAL::StackFramePtr frame_ptr, PID new_pid) {
continue;
}
+ (Void)(kout << "AP_" << hex_number(index));
+ kout << " is now trying to run a new task!\r";
+
////////////////////////////////////////////////////////////
/// Prepare task switch. ///
////////////////////////////////////////////////////////////
@@ -641,6 +642,9 @@ Bool UserProcessHelper::Switch(HAL::StackFramePtr frame_ptr, PID new_pid) {
HardwareThreadScheduler::The()[index].Leak()->fPTime =
UserProcessScheduler::The().TheCurrentTeam().AsArray()[new_pid].PTime;
+ (Void)(kout << "AP_" << hex_number(index));
+ kout << " is now running a new task!\r";
+
return YES;
}