diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-10 07:58:47 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-10 08:00:25 +0200 |
| commit | 80039963ff08d1810e22a0ae41497b156e861db0 (patch) | |
| tree | 32b0f12573584668e656b4869a733e31264a06ba /Kernel | |
| parent | 1c217ed09c6c4b13ec09b897270a208439f0db55 (diff) | |
[META] Important refactors and fixes.
+ FIX SCIBase.hxx header and inline scm.internal.inl header.
+ Rename targets libSCI, libDDK to sci.dll and ddk.dll.
+ Don't initialize again the values of heap and such in
HalKernelMain.cxx
+ Add 'STOP code' in ke_stop call.
+ Updated ReadMe.md.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel')
| -rw-r--r-- | Kernel/HALKit/AMD64/HalKernelMain.cxx | 34 | ||||
| -rw-r--r-- | Kernel/Sources/KernelCheck.cxx | 28 |
2 files changed, 23 insertions, 39 deletions
diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx index 924eb6c9..d24099f2 100644 --- a/Kernel/HALKit/AMD64/HalKernelMain.cxx +++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx @@ -50,16 +50,9 @@ namespace Kernel::HAL { /// @brief Gets the system cores using the MADT. /// @param rsdPtr The 'RSD PTR' data structure. - extern void hal_system_get_cores(Kernel::voidPtr rsdPtr); + EXTERN void hal_system_get_cores(Kernel::voidPtr rsdPtr); } // namespace Kernel::HAL -namespace Kernel -{ - EXTERN SizeT kHeapCount; - EXTERN PageManager kHeapPageManager; - EXTERN Bool kOperationInProgress; -} // namespace Kernel - /* GDT. */ STATIC Kernel::HAL::Detail::NewOSGDT cGdt = { {0, 0, 0, 0x00, 0x00, 0}, // null entry @@ -70,7 +63,7 @@ STATIC Kernel::HAL::Detail::NewOSGDT cGdt = { {0, 0, 0, 0x92, 0xaf, 0}, // user data }; -void hal_real_init(void); +Kernel::Void hal_real_init(Kernel::Void) noexcept; static Kernel::User* cRoot; @@ -90,16 +83,8 @@ EXTERN_C void hal_init_platform( hal_real_init(); } -EXTERN Kernel::Boolean kAllocationInProgress; - -void hal_real_init(void) -{ - Kernel::kHeapPageManager = Kernel::PageManager(); - Kernel::kHeapCount = 0UL; - Kernel::kOperationInProgress = No; - kAllocationInProgress = No; - - // get page size. +Kernel::Void hal_real_init(Kernel::Void) noexcept +{ // get page size. kKernelVirtualSize = kHandoverHeader->f_VirtualSize; // get virtual address start (for the heap) @@ -228,16 +213,13 @@ void hal_real_init(void) cRoot = new Kernel::User(Kernel::RingKind::kRingSuperUser, kSuperUser); #ifdef __DEBUG__ - cRoot->TrySave("6aa162f3-20f6-4143-92f9-5dd37066aedc"); + const auto cPassword = "6aa162f3-20f6-4143-92f9-5dd37066aedc"; #else - cRoot->TrySave("password"); + const auto cPassword = "password"; #endif -#ifdef __DEBUG__ - Kernel::UserManager::The()->TryLogIn(cRoot, "6aa162f3-20f6-4143-92f9-5dd37066aedc"); -#else - Kernel::UserManager::The()->TryLogIn(cRoot, "password"); -#endif + cRoot->TrySave(cPassword); + Kernel::UserManager::The()->TryLogIn(cRoot, cPassword); Kernel::ke_stop(RUNTIME_CHECK_FAILED); } diff --git a/Kernel/Sources/KernelCheck.cxx b/Kernel/Sources/KernelCheck.cxx index cff17077..b65a4114 100644 --- a/Kernel/Sources/KernelCheck.cxx +++ b/Kernel/Sources/KernelCheck.cxx @@ -19,7 +19,7 @@ #define CopyMem(dst, src, sz) Kernel::rt_copy_memory((Kernel::VoidPtr)src, (Kernel::VoidPtr)dst, sz) #define MoveMem(dst, src, sz) Kernel::rt_copy_memory((Kernel::VoidPtr)src, (Kernel::VoidPtr)dst, sz) -#define cWebsiteMacro "https://zka.ma/help" +#define cWebsiteMacro "https://zka.nl/help" #include <BootKit/Vendor/Qr.hxx> @@ -65,49 +65,51 @@ namespace Kernel start_y += 10; + // show text according to error id. + switch (id) { case RUNTIME_CHECK_PROCESS: { - cg_write_text("Process scheduler error (Catasrophic failure).", start_y, x, panicTxt); + cg_write_text("0x00000008 Process scheduler error (Catasrophic failure).", start_y, x, panicTxt); break; } case RUNTIME_CHECK_ACPI: { - cg_write_text("ACPI error.", start_y, x, panicTxt); + cg_write_text("0x00000006 ACPI error.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_POINTER: { - cg_write_text("Kernel heap error.", start_y, x, panicTxt); + cg_write_text("0x00000000 Kernel heap error.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_BAD_BEHAVIOR: { - cg_write_text("Undefined Behavior error.", start_y, x, panicTxt); + cg_write_text("0x00000009 Undefined Behavior error.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_BOOTSTRAP: { - cg_write_text("End of code.", start_y, x, panicTxt); + cg_write_text("0x0000000A End of code.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_HANDSHAKE: { - cg_write_text("Handshake error.", start_y, x, panicTxt); + cg_write_text("0x00000005 Handshake error.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_IPC: { - cg_write_text("Kernel IPC error.", start_y, x, panicTxt); + cg_write_text("0x00000003 Kernel IPC error.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_INVALID_PRIVILEGE: { - cg_write_text("Privilege violation.", start_y, x, panicTxt); + cg_write_text("0x00000007 Kernel privilege violation.", start_y, x, panicTxt); break; case RUNTIME_CHECK_UNEXCPECTED: { - cg_write_text("Catasrophic failure.", start_y, x, panicTxt); + cg_write_text("0x0000000B Catasrophic failure.", start_y, x, panicTxt); break; } case RUNTIME_CHECK_FAILED: { - cg_write_text("Assertion failed.", start_y, x, panicTxt); + cg_write_text("0x10000001 Assertion failed.", start_y, x, panicTxt); break; } default: { - cg_write_text("Unknown error.", start_y, x, panicTxt); + cg_write_text("0xFFFFFFFF Unknown error.", start_y, x, panicTxt); break; } } @@ -118,7 +120,7 @@ namespace Kernel Void RecoveryFactory::Recover() noexcept { - while (true) + while (Yes) { asm volatile("cli; hlt"); } |
