summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/KernelKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 21:42:49 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-14 21:42:49 +0100
commitef101c1852301f828531ee1e2217fc64bf26bd12 (patch)
tree1d0d82c97ca84b77ba3d3d238899b1d38d08a25d /dev/Kernel/KernelKit
parent57e99bd9a0adac271b5cf1fd9b426b6b4eb8ebee (diff)
Kernel: Patch UserProcess::Delete, and AHCI identify command.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/KernelKit')
-rw-r--r--dev/Kernel/KernelKit/Timer.h10
-rw-r--r--dev/Kernel/KernelKit/UserProcessScheduler.inl12
2 files changed, 16 insertions, 6 deletions
diff --git a/dev/Kernel/KernelKit/Timer.h b/dev/Kernel/KernelKit/Timer.h
index 6328c1a1..abca5352 100644
--- a/dev/Kernel/KernelKit/Timer.h
+++ b/dev/Kernel/KernelKit/Timer.h
@@ -14,6 +14,8 @@ namespace NeOS
class SoftwareTimer;
class TimerInterface;
+ inline constexpr Int16 kTimeUnit = 1000;
+
class TimerInterface
{
public:
@@ -62,20 +64,20 @@ namespace NeOS
Int64 fWaitFor{0};
};
- inline Int64 Milliseconds(Int64 time)
+ inline Int64 rtl_ms(Int64 time)
{
if (time < 0)
return 0;
// TODO: nanoseconds maybe?
- return 1000 * 1000 * time;
+ return kTimeUnit * kTimeUnit * time;
}
- inline Int64 Seconds(Int64 time)
+ inline Int64 rtl_seconds(Int64 time)
{
if (time < 0)
return 0;
- return 1000 * Milliseconds(time);
+ return kTimeUnit * rtl_ms(time);
}
} // namespace NeOS
diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.inl b/dev/Kernel/KernelKit/UserProcessScheduler.inl
index ecb668fe..6b3b9300 100644
--- a/dev/Kernel/KernelKit/UserProcessScheduler.inl
+++ b/dev/Kernel/KernelKit/UserProcessScheduler.inl
@@ -19,6 +19,12 @@ namespace NeOS
if (!ptr)
return No;
+ if (!this->ProcessMemoryHeap)
+ {
+ kout << "Process Memory is empty.\r";
+ return No;
+ }
+
ProcessMemoryHeapList* entry = this->ProcessMemoryHeap;
while (entry != nullptr)
@@ -29,16 +35,18 @@ namespace NeOS
#ifdef __NE_AMD64__
auto pd = hal_read_cr3();
+
hal_write_cr3(this->VMRegister);
auto ret = mm_delete_heap(entry->MemoryEntry);
hal_write_cr3(pd);
- return ret;
+ return ret == kErrorSuccess;
#else
Bool ret = mm_delete_heap(ptr.Leak().Leak());
- return ret;
+
+ return ret == kErrorSuccess;
#endif
}