diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-07 15:37:46 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-07 15:37:46 +0100 |
| commit | 8d6975f2ec360f696ac40ea703033fc9217227b6 (patch) | |
| tree | 225a26b3f62f5e9f47ef61e16ccfe56f241a4a2f /dev/ZKAKit | |
| parent | 829821e56b88a2aa825265f5c3ca9c97a8c1e961 (diff) | |
FIXING: The next set of patches.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKAKit')
| -rw-r--r-- | dev/ZKAKit/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 16 | ||||
| -rw-r--r-- | dev/ZKAKit/HALKit/AMD64/HalKernelMain.cc | 4 | ||||
| -rw-r--r-- | dev/ZKAKit/HALKit/ARM64/HalKernelMain.cc | 4 |
3 files changed, 21 insertions, 3 deletions
diff --git a/dev/ZKAKit/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/ZKAKit/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index db400e02..80da073d 100644 --- a/dev/ZKAKit/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/ZKAKit/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -56,8 +56,24 @@ EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp) /// @brief Handle scheduler interrupt. EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp) { + static BOOL is_scheduling = NO; + static Kernel::Int64 try_count_before_brute = 100000UL; + + while (is_scheduling) + { + --try_count_before_brute; + + if (try_count_before_brute < 1) + break; + } + + try_count_before_brute = 100000UL; + is_scheduling = YES; + kcout << "Kernel: Timer IRQ (Scheduler Notification).\r"; Kernel::UserProcessHelper::StartScheduling(); + + is_scheduling = NO; } /// @brief Handle math fault. diff --git a/dev/ZKAKit/HALKit/AMD64/HalKernelMain.cc b/dev/ZKAKit/HALKit/AMD64/HalKernelMain.cc index d44dd502..401e25ed 100644 --- a/dev/ZKAKit/HALKit/AMD64/HalKernelMain.cc +++ b/dev/ZKAKit/HALKit/AMD64/HalKernelMain.cc @@ -94,10 +94,10 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept Kernel::HAL::Register64 idt_reg; idt_reg.Base = (Kernel::UIntPtr)kInterruptVectorTable; + Kernel::rtl_create_process(ke_dll_entrypoint, "Kernel System"); + Kernel::HAL::IDTLoader idt_loader; idt_loader.Load(idt_reg); - ke_dll_entrypoint(); - Kernel::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } diff --git a/dev/ZKAKit/HALKit/ARM64/HalKernelMain.cc b/dev/ZKAKit/HALKit/ARM64/HalKernelMain.cc index f10f2948..58c44e58 100644 --- a/dev/ZKAKit/HALKit/ARM64/HalKernelMain.cc +++ b/dev/ZKAKit/HALKit/ARM64/HalKernelMain.cc @@ -44,7 +44,9 @@ EXTERN_C void hal_init_platform( kKernelBitMpStart = reinterpret_cast<Kernel::VoidPtr>( reinterpret_cast<Kernel::UIntPtr>(kHandoverHeader->f_BitMapStart)); - ke_dll_entrypoint(); + /// @note do initialize the interrupts after it. + + Kernel::rtl_create_process(ke_dll_entrypoint, "Kernel System"); Kernel::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } |
