summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
commit6a30f42d5dcd0f944262147b2806db6c14fe7ffc (patch)
tree86d86a66df2941e49d1d332aaa1671c11db594e5 /dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc
parentf8aaa274535b6541f376090958eedbbba3ba00ba (diff)
feat(kernel): Finalizing the first version of the user scheduler.
other: - Removed DmaPool into its own Kit. - ApplicationProcessor unit has been cleaned up. - Rename functions of MemoryMgr. - Use KIB instead of MIBs of stack. - Cleanup parts of the scheduler, and hw scheduler. - Use UD handler for INT 6. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc')
-rw-r--r--dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc53
1 files changed, 0 insertions, 53 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc
index 2fb6ad4c..b8eb8fe9 100644
--- a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc
+++ b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc
@@ -8,56 +8,10 @@
#include <FSKit/NeFS.h>
#include <HALKit/AMD64/Processor.h>
-#define kPITDefaultTicks (1000U)
-
namespace Kernel::HAL {
namespace Detail {
STATIC ::Kernel::Detail::AMD64::InterruptDescriptorAMD64 kInterruptVectorTable[kKernelIdtSize] =
{};
-
- STATIC ATTRIBUTE(unused) void hal_set_irq_mask(UInt8 irql) [[maybe_unused]] {
- UInt16 port;
- UInt8 value;
-
- if (irql < 8) {
- port = kPICData;
- } else {
- port = kPIC2Data;
- irql -= 8;
- }
-
- value = rt_in8(port) | (1 << irql);
- rt_out8(port, value);
- }
-
- STATIC void hal_clear_irq_mask(UInt8 irql) [[maybe_unused]] {
- UInt16 port;
- UInt8 value;
-
- if (irql < 8) {
- port = kPICData;
- } else {
- port = kPIC2Data;
- irql -= 8;
- }
-
- value = rt_in8(port) & ~(1 << irql);
- rt_out8(port, value);
- }
-
- STATIC Void hal_enable_pit(UInt16 ticks) noexcept {
- if (ticks == 0) ticks = kPITDefaultTicks;
-
- // Configure PIT to receieve scheduler interrupts.
-
- UInt16 kPITCommDivisor = kPITFrequency / ticks; // 100 Hz.
-
- HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT
- HAL::rt_out8(kPITChannel0Port, kPITCommDivisor & 0xFF); // Send low byte
- HAL::rt_out8(kPITChannel0Port, (kPITCommDivisor >> 8) & 0xFF); // Send high byte
-
- hal_clear_irq_mask(32);
- }
} // namespace Detail
/// @brief Loads the provided Global Descriptor Table.
@@ -72,8 +26,6 @@ Void GDTLoader::Load(Register64& gdt) {
Void IDTLoader::Load(Register64& idt) {
rt_cli();
- const Int16 kPITTickForScheduler = kPITDefaultTicks;
-
volatile ::Kernel::UIntPtr** ptr_ivt = (volatile ::Kernel::UIntPtr**) idt.Base;
for (SizeT idt_indx = 0; idt_indx < kKernelIdtSize; ++idt_indx) {
@@ -92,12 +44,7 @@ Void IDTLoader::Load(Register64& idt) {
idt.Base = (UIntPtr) &Detail::kInterruptVectorTable[0];
idt.Limit = sizeof(::Kernel::Detail::AMD64::InterruptDescriptorAMD64) * (kKernelIdtSize);
- Detail::hal_enable_pit(kPITTickForScheduler);
-
-#ifndef __NE_MODULAR_KERNEL_COMPONENTS__
hal_load_idt(idt);
-#endif // __NE_MODULAR_KERNEL_COMPONENTS__
-
rt_sti();
}